[PATCH v2] tests: force non-deterministic mode in non-deterministic tests
Jan Beulich
jbeulich@suse.com
Wed Dec 20 08:03:37 GMT 2023
On 19.12.2023 22:53, Stephen Kitt wrote:
> Since ar can be built defaulting to deterministic mode, tests which
> expect non-deterministic behaviour need to explicitly set the U flag.
> They also need to run without SOURCE_DATE_EPOCH since that also
> enables deterministic mode.
Not quite - the env var controls only time stamps, not UID/GID or
permissions, aiui. That's merely a matter of changing the wording of
course.
> --- a/binutils/testsuite/binutils-all/ar.exp
> +++ b/binutils/testsuite/binutils-all/ar.exp
> @@ -571,6 +571,8 @@ proc replacing_non_deterministic_member { } {
> return
> }
>
> + unsetenv SOURCE_DATE_EPOCH
> +
> set archive tmpdir/artest.a
> set older_objfile tmpdir/bintest.${obj}
> set newer_objfile tmpdir/ar/bintest.${obj}
I think it would be nice if this was done in the place where,
respectively, replacing_sde_deterministic_member has its setenv
(and then, like that, if it also had a brief comment). Unless of
course there's an issue with moving this down by a few lines.
Furthermore I'm afraid I'm less comfortable approving this, as the
correctness of the unconditional unsetenv in
replacing_sde_deterministic_member isn't really clear to me: If that
variable was indeed set in the environment up front, it's not clear
to me whether it really is okay to permanently alter the environment.
Otoh of course your change merely moves the (possible) problem ahead
by a tiny bit, so yes - with the cosmetic adjustments done the change
is probably still okay.
Jan
More information about the Binutils
mailing list