[bug #63215] --shuffle=random doesn't properly initialize config.seed

2022-10-16 Thread James Hilliard
Follow-up Comment #2, bug #63215 (project make):


[comment #1 comment #1:]
> Using 0 here still gives a random shuffle because 0 means "generate a new
random number".  However you're right that this is not correct because it
doesn't allow us to recreate the random value.
> 
> Thanks for the note!

Should I send my suggested change as a patch to the mailing list or is a
different approach preferred?


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #63215] --shuffle=random doesn't properly initialize config.seed

2022-10-14 Thread James Hilliard
URL:
  <https://savannah.gnu.org/bugs/?63215>

 Summary: --shuffle=random doesn't properly initialize
config.seed
 Project: make
   Submitter: jameshilliard
   Submitted: Fri 14 Oct 2022 10:50:44 PM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: SCM
Operating System: POSIX-Based
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Fri 14 Oct 2022 10:50:44 PM UTC By: James Hilliard 
When using submake it seems the seed isn't getting set properly as MAKEFLAGS
just gets passed "--shuffle=0" when the toplevel make is invoked with
"--shuffle=random".

I think we need to do something like this so that we initialize the seed
before it gets passed to MAKEFLAGS:
diff --git a/src/shuffle.c b/src/shuffle.c
index 4cfdc943..471c56b1 100644
--- a/src/shuffle.c
+++ b/src/shuffle.c
@@ -82,7 +82,11 @@ shuffle_set_mode (const char *cmdarg)
 }
   else
 {
-  if (strcasecmp (cmdarg, "random") != 0)
+  if (strcasecmp (cmdarg, "random") == 0)
+{
+  config.seed = make_rand ();
+}
+  else
 {
   /* Assume explicit seed.  */
   const char *err;







___

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63215>

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #63187] make: *** invalid shuffle mode: Invalid value: '0r'. Stop.

2022-10-09 Thread James Hilliard
Follow-up Comment #2, bug #63187 (project make):

I tried reverting a recent shuffle related commit:
https://github.com/mirror/make/commit/a99378ebe46f5245ef1307c6a9834d19d57882d0

This didn't fix the error but it did change the error message.

With revert:
$ /home/buildroot/make/make BR2_JLEVEL=1 --shuffle=random -j1
>>> glibc 2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Building
PATH="/home/buildroot/buildroot/output/host/bin:/home/buildroot/buildroot/output/host/sbin:/home/buildroot/bin:/home/buildroot/.local/bin:/home/buildroot/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
 /home/buildroot/make/make   -C
/home/buildroot/buildroot/output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3/build
/home/buildroot/make/make -r PARALLELMFLAGS="" -C
/home/buildroot/buildroot/output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3
objdir=`pwd` all

type "make help" for help with common glibc makefile targets

/home/buildroot/make/make  subdir=csu -C csu ..=../ subdir_lib
make: *** invalid shuffle mode: Invalid value: '1667232151r'.  Stop.
make[3]: *** [Makefile:484: csu/subdir_lib] Error 2 shuffle=1667232151
make[2]: *** [Makefile:9: all] Error 2 shuffle=1667232151
make[1]: *** [package/pkg-generic.mk:293:
/home/buildroot/buildroot/output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3/.stamp_built]
Error 2 shuffle=1667232151
make: *** [Makefile:84: _all] Error 2 shuffle=1667232151

Without revert:
$ /home/buildroot/make/make BR2_JLEVEL=1 --shuffle=random -j1
>>> glibc 2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Building
PATH="/home/buildroot/buildroot/output/host/bin:/home/buildroot/buildroot/output/host/sbin:/home/buildroot/bin:/home/buildroot/.local/bin:/home/buildroot/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
 /home/buildroot/make/make   -C
/home/buildroot/buildroot/output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3/build
/home/buildroot/make/make -r PARALLELMFLAGS="" -C
/home/buildroot/buildroot/output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3
objdir=`pwd` all

type "make help" for help with common glibc makefile targets

/home/buildroot/make/make  subdir=csu -C csu ..=../ subdir_lib
make: *** invalid shuffle mode: Invalid value: '0r'.  Stop.
make[3]: *** [Makefile:484: csu/subdir_lib] Error 2 shuffle=0
make[2]: *** [Makefile:9: all] Error 2 shuffle=0
make[1]: *** [package/pkg-generic.mk:293:
/home/buildroot/buildroot/output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3/.stamp_built]
Error 2 shuffle=0
make: *** [Makefile:84: _all] Error 2 shuffle=0


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #63187] make: *** invalid shuffle mode: Invalid value: '0r'. Stop.

2022-10-09 Thread James Hilliard
Follow-up Comment #1, bug #63187 (project make):

Looks like my account didn't get linked when I make this report, I'm the
reporter.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/