Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package warewulf4 for openSUSE:Factory 
checked in at 2025-02-26 18:43:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/warewulf4 (Old)
 and      /work/SRC/openSUSE:Factory/.warewulf4.new.1873 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "warewulf4"

Wed Feb 26 18:43:41 2025 rev:31 rq:1248768 version:4.6.0rc3

Changes:
--------
--- /work/SRC/openSUSE:Factory/warewulf4/warewulf4.changes      2025-02-26 
17:17:12.031891106 +0100
+++ /work/SRC/openSUSE:Factory/.warewulf4.new.1873/warewulf4.changes    
2025-02-26 18:43:42.749568658 +0100
@@ -1,0 +2,6 @@
+Wed Feb 26 16:26:11 UTC 2025 - Christian Goll <cg...@suse.com>
+
+- added WWWORKER-overwrites-runtime.NumCPU.patch for reproducible
+  builds
+
+-------------------------------------------------------------------

New:
----
  WWWORKER-overwrites-runtime.NumCPU.patch

BETA DEBUG BEGIN:
  New:
- added WWWORKER-overwrites-runtime.NumCPU.patch for reproducible
  builds
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ warewulf4.spec ++++++
--- /var/tmp/diff_new_pack.ce6KgS/_old  2025-02-26 18:43:43.785612026 +0100
+++ /var/tmp/diff_new_pack.ce6KgS/_new  2025-02-26 18:43:43.789612194 +0100
@@ -42,6 +42,7 @@
 Source11:       adjust_overlays.sh
 Source20:       README.dnsmasq
 Source21:       README.RKE2.md
+Patch0:         WWWORKER-overwrites-runtime.NumCPU.patch
 
 BuildRequires:  distribution-release
 BuildRequires:  dracut

++++++ WWWORKER-overwrites-runtime.NumCPU.patch ++++++
>From 53f6f72917211903d2f068b48ed552a6e0e98734 Mon Sep 17 00:00:00 2001
From: Christian Goll <cg...@suse.com>
Date: Wed, 26 Feb 2025 17:07:31 +0100
Subject: [PATCH] WWWORKER overwrites runtime.NumCPU

runtime.NumCPU varies for different build hosts, so the
environment variable WWWORKER can be set to keep this number
constant as this number ends up in
docs/man/man1/wwctl-overlay-build.1
and so in the packages

Signed-off-by: Christian Goll <cg...@suse.com>
---
 CHANGELOG.md                             |  1 +
 Makefile                                 |  2 +-
 internal/app/wwctl/overlay/build/root.go | 10 +++++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93b7700a..3ea71b31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -60,6 +60,7 @@ The format is based on [Keep a 
Changelog](https://keepachangelog.com/en/1.0.0/).
 - Fix timeout problem for wwclient. #1741
 - Fixed default "true" state of NetDev.OnBoot. #1754
 - Port NFS mounts during `wwctl upgrade nodes` before applying defaults. #1758
+- Set WWWORKER from commandline for reproducible builds
 
 ### Removed
 
diff --git a/Makefile b/Makefile
index 245bdc64..88bc7921 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ wwapird: $(config) $(apiconfig) $(call 
godeps,internal/app/api/wwapird/wwapird.g
 .PHONY: man_pages
 man_pages: wwctl $(wildcard docs/man/man5/*.5)
        mkdir -p docs/man/man1
-       ./wwctl --emptyconf genconfig man docs/man/man1
+       WWWORKER=8 ./wwctl --emptyconf genconfig man docs/man/man1
        gzip --force docs/man/man1/*.1
        for manpage in docs/man/man5/*.5; do gzip <$${manpage} >$${manpage}.gz; 
done
 
diff --git a/internal/app/wwctl/overlay/build/root.go 
b/internal/app/wwctl/overlay/build/root.go
index ba1fe163..f41e0132 100644
--- a/internal/app/wwctl/overlay/build/root.go
+++ b/internal/app/wwctl/overlay/build/root.go
@@ -1,7 +1,9 @@
 package build
 
 import (
+       "os"
        "runtime"
+       "strconv"
 
        "github.com/spf13/cobra"
        "github.com/warewulf/warewulf/internal/app/wwctl/completions"
@@ -29,7 +31,13 @@ func init() {
        }
        baseCmd.PersistentFlags().StringVarP(&OverlayDir, "output", "o", "", 
`Do not create an overlay image for distribution but write to
        the given directory. An overlay must also be ge given to use this 
option.`)
-       baseCmd.PersistentFlags().IntVar(&Workers, "workers", runtime.NumCPU(), 
"The number of parallel workers building overlays")
+       workers := runtime.NumCPU()
+       numCPU := os.Getenv("WWWORKER")
+       wwWorker, err := strconv.Atoi(numCPU)
+       if err == nil {
+               workers = wwWorker
+       }
+       baseCmd.PersistentFlags().IntVar(&Workers, "workers", workers, "The 
number of parallel workers building overlays")
 }
 
 // GetRootCommand returns the root cobra.Command for the application.
-- 
2.43.0

Reply via email to