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

2022-10-14 Thread James Hilliard
URL:
  

 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:

  

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




[bug #63157] Unlink temporary files.

2022-10-14 Thread Dmitry Goncharov
Follow-up Comment #17, bug #63157 (project make):

i think, it is fine (maybe even good) if the changes in comment 11 are
abandoned. The whole critical section only lasts while make is reading and
parsing the temp stdin file. The duration of this critical section is likely
to be a fraction of compilation time of even one source file.
Paul, if you decide to proceed with changes in comment 11, temp_stdin_fileno
should probably be of type volatile sig_atomic_t, rather than int.


___

Reply to this item at:

  

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