public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Stephen Kitt <steve@sk2.org>
Cc: binutils@sourceware.org
Subject: Re: [PATCH v2] tests: force non-deterministic mode in non-deterministic tests
Date: Thu, 21 Dec 2023 08:22:43 +0100	[thread overview]
Message-ID: <2db63c69-1b7f-4914-9bb0-a3fee24bc1cd@suse.com> (raw)
In-Reply-To: <20231220184025.61f0e8fd@heffalump.sk2.org>

On 20.12.2023 18:40, Stephen Kitt wrote:
> On Wed, 20 Dec 2023 09:03:37 +0100, Jan Beulich <jbeulich@suse.com> wrote:
>> 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.
> 
> Right, I’ll update the wording.
> 
>>> --- 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.
> 
> Yes, that makes sense.
> 
>> 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.
> 
> The scenario I’m trying to address is indeed when SOURCE_DATE_EPOCH is set in
> the environment on entry to the tests. This is what happens for example in
> Debian builds, and that’s where I ran into this.
> https://buildd.debian.org/status/fetch.php?pkg=binutils-mingw-w64&arch=amd64&ver=11.1&stamp=1702977480&raw=0
> provides an example.
> 
> I think it’s fine for tests to make sure their environment is appropriate for
> their own tests, but I agree it would be better for them to restore the
> environment as it was on entry.
> 
> The Linaro build bot is complaining about this too; it’s failing because
> unsetenv is called on a variable which isn’t present in the environment. It
> seems I should check for the variable’s presence before unsetting it, or
> perhaps just set it to empty...
> 
> Incidentally, builds with this patch in Debian all pass these tests (with
> SOURCE_DATE_EPOCH set in the environment), but fail on i386 tests on
> big-endian systems; see
> https://buildd.debian.org/status/package.php?p=binutils-mingw-w64 for logs.
> git bisect tells me that the culprit is
> 734dfd1cc966aff736eaeda68bfa4807ee4b50c1 but I haven’t figured out why yet.

That has been there for a while. I would have looked at the build logs, but
the link above points only at their tails, and I can't spot how to obtain
them through just the browser (needing to obtain any debian specific software
for this purpose is a no-go imo).

Jan

  reply	other threads:[~2023-12-21  7:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 21:53 Stephen Kitt
2023-12-20  8:03 ` Jan Beulich
2023-12-20 17:40   ` Stephen Kitt
2023-12-21  7:22     ` Jan Beulich [this message]
2023-12-21  8:13       ` Stephen Kitt
2023-12-21  8:34         ` Jan Beulich
2023-12-22 11:29         ` Jan Beulich
2023-12-22 22:03           ` Stephen Kitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2db63c69-1b7f-4914-9bb0-a3fee24bc1cd@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=steve@sk2.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).