bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: James Hilliard
Subject: [bug #63215] --shuffle=random doesn't properly initialize config.seed
Date: Fri, 14 Oct 2022 18:50:46 -0400 (EDT)

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 <jameshilliard>
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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]