public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3] tests: force non-deterministic mode in non-deterministic tests
@ 2024-01-16 13:57 Stephen Kitt
  2024-02-27  9:45 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Kitt @ 2024-01-16 13:57 UTC (permalink / raw)
  To: binutils; +Cc: Stephen Kitt

Since ar can be built defaulting to deterministic mode, tests which
expect non-deterministic behaviour need to explicitly set the U flag.

The non-deterministic member test expects SOURCE_DATE_EPOCH to not be
set; this documents that. Unconditionally unsetting the variable
causes issues in test infrastructure (which expects unsetenv to only
be called on variables which are already set).

Signed-off-by: Stephen Kitt <steve@sk2.org>
---
 binutils/testsuite/binutils-all/ar.exp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index aade419344e..4712bb2bc71 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -538,6 +538,7 @@ proc replacing_deterministic_member { } {
 }
 
 # Test replacing a member of a non-deterministic archive.
+# This test expects SOURCE_DATE_EPOCH to not be set in the environment.
 
 proc replacing_non_deterministic_member { } {
     global AR
@@ -581,7 +582,7 @@ proc replacing_non_deterministic_member { } {
 
     # Build the archive with the *newer* object file.
     
-    set got [binutils_run $AR "rc $archive ${newer_objfile}"]
+    set got [binutils_run $AR "rcU $archive ${newer_objfile}"]
     if ![string match "" $got] {
 	fail "$testname: (could not build archive)"
 	return
@@ -589,7 +590,7 @@ proc replacing_non_deterministic_member { } {
 
     # Now try to replace the newer file with the older one.  This should not work.
     
-    set got [binutils_run $AR "ru $archive $older_objfile"]
+    set got [binutils_run $AR "ruU $archive $older_objfile"]
     if ![string match "" $got] {
 	fail "$testname: (failed to replace file)"
 	return
@@ -651,7 +652,7 @@ proc replacing_sde_deterministic_member { } {
     # Build the archive with the *newer* object file.
     setenv SOURCE_DATE_EPOCH "1000"
     
-    set got [binutils_run $AR "rc $archive ${newer_objfile}"]
+    set got [binutils_run $AR "rcU $archive ${newer_objfile}"]
     if ![string match "" $got] {
 	fail "$testname: (could not build archive)"
 	unsetenv SOURCE_DATE_EPOCH
@@ -662,7 +663,7 @@ proc replacing_sde_deterministic_member { } {
     # archive this will not work, but one created to be deterministic
     # should always replace its members.
     
-    set got [binutils_run $AR "ru $archive $older_objfile"]
+    set got [binutils_run $AR "ruU $archive $older_objfile"]
     if ![string match "" $got] {
 	fail "$testname: (failed to replace file)"
 	unsetenv SOURCE_DATE_EPOCH

base-commit: c4fb39bb31a53bbb2df3be3200d694f025c5b892
-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] tests: force non-deterministic mode in non-deterministic tests
  2024-01-16 13:57 [PATCH v3] tests: force non-deterministic mode in non-deterministic tests Stephen Kitt
@ 2024-02-27  9:45 ` Jan Beulich
  2024-03-10 14:31   ` Stephen Kitt
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2024-02-27  9:45 UTC (permalink / raw)
  To: Stephen Kitt; +Cc: binutils

On 16.01.2024 14:57, 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.
> 
> The non-deterministic member test expects SOURCE_DATE_EPOCH to not be
> set; this documents that. Unconditionally unsetting the variable
> causes issues in test infrastructure (which expects unsetenv to only
> be called on variables which are already set).
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>

In the absence of any other comments, please feel free to put in.

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] tests: force non-deterministic mode in non-deterministic tests
  2024-02-27  9:45 ` Jan Beulich
@ 2024-03-10 14:31   ` Stephen Kitt
  2024-03-11  7:25     ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Kitt @ 2024-03-10 14:31 UTC (permalink / raw)
  To: Jan Beulich; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 843 bytes --]

Hi Jan,

On Tue, 27 Feb 2024 10:45:01 +0100, Jan Beulich <jbeulich@suse.com> wrote:
> On 16.01.2024 14:57, 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.
> > 
> > The non-deterministic member test expects SOURCE_DATE_EPOCH to not be
> > set; this documents that. Unconditionally unsetting the variable
> > causes issues in test infrastructure (which expects unsetenv to only
> > be called on variables which are already set).
> > 
> > Signed-off-by: Stephen Kitt <steve@sk2.org>  
> 
> In the absence of any other comments, please feel free to put in.

I’m not sure whether this was asking me to apply my patch to the binutils
tree, but I can’t push to the binutils tree myself.

Regards,

Stephen

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] tests: force non-deterministic mode in non-deterministic tests
  2024-03-10 14:31   ` Stephen Kitt
@ 2024-03-11  7:25     ` Jan Beulich
  2024-03-11  7:51       ` Stephen Kitt
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2024-03-11  7:25 UTC (permalink / raw)
  To: Stephen Kitt; +Cc: binutils

On 10.03.2024 15:31, Stephen Kitt wrote:
> On Tue, 27 Feb 2024 10:45:01 +0100, Jan Beulich <jbeulich@suse.com> wrote:
>> On 16.01.2024 14:57, 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.
>>>
>>> The non-deterministic member test expects SOURCE_DATE_EPOCH to not be
>>> set; this documents that. Unconditionally unsetting the variable
>>> causes issues in test infrastructure (which expects unsetenv to only
>>> be called on variables which are already set).
>>>
>>> Signed-off-by: Stephen Kitt <steve@sk2.org>  
>>
>> In the absence of any other comments, please feel free to put in.
> 
> I’m not sure whether this was asking me to apply my patch to the binutils
> tree, but I can’t push to the binutils tree myself.

I see; I've committed it on your behalf.

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] tests: force non-deterministic mode in non-deterministic tests
  2024-03-11  7:25     ` Jan Beulich
@ 2024-03-11  7:51       ` Stephen Kitt
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Kitt @ 2024-03-11  7:51 UTC (permalink / raw)
  To: Jan Beulich; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]

On Mon, 11 Mar 2024 08:25:16 +0100, Jan Beulich <jbeulich@suse.com> wrote:
> On 10.03.2024 15:31, Stephen Kitt wrote:
> > On Tue, 27 Feb 2024 10:45:01 +0100, Jan Beulich <jbeulich@suse.com>
> > wrote:  
> >> On 16.01.2024 14:57, 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.
> >>>
> >>> The non-deterministic member test expects SOURCE_DATE_EPOCH to not be
> >>> set; this documents that. Unconditionally unsetting the variable
> >>> causes issues in test infrastructure (which expects unsetenv to only
> >>> be called on variables which are already set).
> >>>
> >>> Signed-off-by: Stephen Kitt <steve@sk2.org>    
> >>
> >> In the absence of any other comments, please feel free to put in.  
> > 
> > I’m not sure whether this was asking me to apply my patch to the binutils
> > tree, but I can’t push to the binutils tree myself.  
> 
> I see; I've committed it on your behalf.

Thanks!

Stephen

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-11  7:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 13:57 [PATCH v3] tests: force non-deterministic mode in non-deterministic tests Stephen Kitt
2024-02-27  9:45 ` Jan Beulich
2024-03-10 14:31   ` Stephen Kitt
2024-03-11  7:25     ` Jan Beulich
2024-03-11  7:51       ` Stephen Kitt

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).