Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package apptainer for openSUSE:Factory checked in at 2023-07-28 22:20:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/apptainer (Old) and /work/SRC/openSUSE:Factory/.apptainer.new.32662 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "apptainer" Fri Jul 28 22:20:38 2023 rev:21 rq:1101201 version:1.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/apptainer/apptainer.changes 2023-07-26 13:26:04.000768301 +0200 +++ /work/SRC/openSUSE:Factory/.apptainer.new.32662/apptainer.changes 2023-07-28 22:20:42.209322419 +0200 @@ -1,0 +2,8 @@ +Fri Jul 28 13:39:30 UTC 2023 - Christian Goll <cg...@suse.com> + +- updated to 1.2.2 with following changes: + * Fix $APPTAINER_MESSAGELEVEL to correctly set the logging level. + * Fix build failures when in setuid mode and unprivileged user namespaces are + unavailable and the --fakeroot option is not selected. + +------------------------------------------------------------------- Old: ---- apptainer-1.2.1.tar.gz New: ---- apptainer-1.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ apptainer.spec ++++++ --- /var/tmp/diff_new_pack.xST4X0/_old 2023-07-28 22:20:43.205328472 +0200 +++ /var/tmp/diff_new_pack.xST4X0/_new 2023-07-28 22:20:43.209328497 +0200 @@ -26,7 +26,7 @@ License: BSD-3-Clause-LBNL Group: Productivity/Clustering/Computing Name: apptainer -Version: 1.2.1 +Version: 1.2.2 Release: 0 # https://spdx.org/licenses/BSD-3-Clause-LBNL.html URL: https://apptainer.org ++++++ apptainer-1.2.1.tar.gz -> apptainer-1.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/CHANGELOG.md new/apptainer-1.2.2/CHANGELOG.md --- old/apptainer-1.2.1/CHANGELOG.md 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/CHANGELOG.md 2023-07-27 18:28:18.000000000 +0200 @@ -5,6 +5,12 @@ and re-branded as Apptainer. For older changes see the [archived Singularity change log](https://github.com/apptainer/singularity/blob/release-3.8/CHANGELOG.md). +## v1.2.2 - \[2023-07-27\] + +- Fix `$APPTAINER_MESSAGELEVEL` to correctly set the logging level. +- Fix build failures when in setuid mode and unprivileged user namespaces + are unavailable and the `--fakeroot` option is not selected. + ## v1.2.1 - \[2023-07-24\] ### Security fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/INSTALL.md new/apptainer-1.2.2/INSTALL.md --- old/apptainer-1.2.1/INSTALL.md 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/INSTALL.md 2023-07-27 18:28:18.000000000 +0200 @@ -137,7 +137,7 @@ for example: ```sh -git checkout v1.2.1 +git checkout v1.2.2 ``` ## Compiling Apptainer @@ -272,7 +272,7 @@ <!-- markdownlint-disable MD013 --> ```sh -VERSION=1.2.1 # this is the apptainer version, change as you need +VERSION=1.2.2 # this is the apptainer version, change as you need # Fetch the source wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz ``` @@ -324,7 +324,7 @@ <!-- markdownlint-disable MD013 --> ```sh -VERSION=1.2.1 # this is the latest apptainer version, change as you need +VERSION=1.2.2 # this is the latest apptainer version, change as you need ./mconfig make -C builddir rpm sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/apptainer-$(echo $VERSION|tr - \~)*.x86_64.rpm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/cmd/internal/cli/apptainer.go new/apptainer-1.2.2/cmd/internal/cli/apptainer.go --- old/apptainer-1.2.1/cmd/internal/cli/apptainer.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/cmd/internal/cli/apptainer.go 2023-07-27 18:28:18.000000000 +0200 @@ -15,11 +15,13 @@ "context" "fmt" "io" + "math" "os" "os/exec" "os/signal" "os/user" "path/filepath" + "strconv" "strings" "text/template" @@ -271,18 +273,26 @@ func setSylogMessageLevel() { var level int + l, err := strconv.Atoi(env.GetenvLegacy("MESSAGELEVEL", "MESSAGELEVEL")) + if err == nil { + level = l + } + if debug { level = 5 // Propagate debug flag to nested `apptainer` calls. os.Setenv("APPTAINER_DEBUG", "1") } else if verbose { level = 4 + os.Setenv("APPTAINER_VERBOSE", "1") } else if quiet { level = -1 + os.Setenv("APPTAINER_QUIET", "1") } else if silent { level = -3 + os.Setenv("APPTAINER_SILENT", "1") } else { - level = 1 + level = int(math.Max(float64(level), 1)) } color := true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/cmd/internal/cli/apptainer_test.go new/apptainer-1.2.2/cmd/internal/cli/apptainer_test.go --- old/apptainer-1.2.1/cmd/internal/cli/apptainer_test.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/cmd/internal/cli/apptainer_test.go 2023-07-27 18:28:18.000000000 +0200 @@ -12,12 +12,15 @@ import ( "math/rand" "os" + "strconv" "testing" "time" "github.com/apptainer/apptainer/pkg/sylog" ) +const messageLevelEnv = "APPTAINER_MESSAGELEVEL" + func TestCreateConfDir(t *testing.T) { // create a random name for a directory // TODO - go 1.20 initializes seed randomly by default, so can drop this @@ -44,81 +47,145 @@ } } -func TestChangeLogLevelViaEnvVariables(t *testing.T) { - tests := []struct { - Name string - Envs []string - Level int - }{ - { - Name: "silent with no color", - Envs: []string{"APPTAINER_SILENT", "APPTAINER_NOCOLOR"}, - Level: -3, - }, - { - Name: "silent", - Envs: []string{"APPTAINER_SILENT"}, - Level: -3, - }, - { - Name: "quiet with no color", - Envs: []string{"APPTAINER_QUIET", "APPTAINER_NOCOLOR"}, - Level: -1, - }, - { - Name: "quiet", - Envs: []string{"APPTAINER_QUIET"}, - Level: -1, - }, - { - Name: "verbose with no color", - Envs: []string{"APPTAINER_VERBOSE", "APPTAINER_NOCOLOR"}, - Level: 4, - }, - { - Name: "verbose", - Envs: []string{"APPTAINER_VERBOSE"}, - Level: 4, - }, - { - Name: "debug with no color", - Envs: []string{"APPTAINER_DEBUG", "APPTAINER_NOCOLOR"}, - Level: 5, - }, - { - Name: "debug", - Envs: []string{"APPTAINER_DEBUG"}, - Level: 5, - }, - } - - // initialize apptainerCmd +func TestLogEnvSuite(t *testing.T) { Init(false) - for _, test := range tests { - t.Log("starting test:" + test.Name) - for _, env := range test.Envs { - err := os.Setenv(env, "1") + + t.Run("TestMessageLevelEnv", func(t *testing.T) { + tests := []struct { + Name string + Envs []string + MessageLevel int + Level int + }{ + { + Name: "default InfoLevel", + Envs: []string{}, + MessageLevel: 0, + Level: 1, + }, + { + Name: "use MessageLevel", + Envs: []string{}, + MessageLevel: 5, + Level: 5, + }, + { + Name: "ignore MessageLevel, uses level env", + Envs: []string{"APPTAINER_SILENT"}, + MessageLevel: 5, + Level: -3, + }, + } + + for _, test := range tests { + t.Log("starting test:" + test.Name) + err := os.Setenv(messageLevelEnv, strconv.Itoa(test.MessageLevel)) if err != nil { t.Error(err) } - } - // call persistentPreRunE to update cmd - err := apptainerCmd.PersistentPreRunE(apptainerCmd, []string{}) - if err != nil { - t.Error(err) - } + for _, env := range test.Envs { + err := os.Setenv(env, "1") + if err != nil { + t.Error(err) + } + } - if len(test.Envs) == 2 { - sylog.SetLevel(test.Level, true) - } + // call persistentPreRunE to update cmd + err = apptainerCmd.PersistentPreRunE(apptainerCmd, []string{}) + if err != nil { + t.Error(err) + } + + if len(test.Envs) == 2 { + sylog.SetLevel(test.Level, true) + } + + if sylog.GetLevel() != test.Level { + t.Errorf("actual log level: %d, expected log level: %d", sylog.GetLevel(), test.Level) + } - if sylog.GetLevel() != test.Level { - t.Errorf("actual log level: %d, expected log level: %d", sylog.GetLevel(), test.Level) + os.Unsetenv(messageLevelEnv) + for _, env := range test.Envs { + os.Unsetenv(env) + } } + }) + + t.Run("TestChangeLogLevelViaEnvVariables", func(t *testing.T) { + tests := []struct { + Name string + Envs []string + Level int + }{ + { + Name: "silent with no color", + Envs: []string{"APPTAINER_SILENT", "APPTAINER_NOCOLOR"}, + Level: -3, + }, + { + Name: "silent", + Envs: []string{"APPTAINER_SILENT"}, + Level: -3, + }, + { + Name: "quiet with no color", + Envs: []string{"APPTAINER_QUIET", "APPTAINER_NOCOLOR"}, + Level: -1, + }, + { + Name: "quiet", + Envs: []string{"APPTAINER_QUIET"}, + Level: -1, + }, + { + Name: "verbose with no color", + Envs: []string{"APPTAINER_VERBOSE", "APPTAINER_NOCOLOR"}, + Level: 4, + }, + { + Name: "verbose", + Envs: []string{"APPTAINER_VERBOSE"}, + Level: 4, + }, + { + Name: "debug with no color", + Envs: []string{"APPTAINER_DEBUG", "APPTAINER_NOCOLOR"}, + Level: 5, + }, + { + Name: "debug", + Envs: []string{"APPTAINER_DEBUG"}, + Level: 5, + }, + } + + for _, test := range tests { + t.Log("starting test:" + test.Name) + for _, env := range test.Envs { + err := os.Setenv(env, "1") + if err != nil { + t.Error(err) + } + } + + // call persistentPreRunE to update cmd + err := apptainerCmd.PersistentPreRunE(apptainerCmd, []string{}) + if err != nil { + t.Error(err) + } + + if len(test.Envs) == 2 { + sylog.SetLevel(test.Level, true) + } - for _, env := range test.Envs { - os.Unsetenv(env) + if sylog.GetLevel() != test.Level { + t.Errorf("actual log level: %d, expected log level: %d", sylog.GetLevel(), test.Level) + } + + for _, env := range test.Envs { + os.Unsetenv(env) + } } - } + }) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/cmd/internal/cli/build.go new/apptainer-1.2.2/cmd/internal/cli/build.go --- old/apptainer-1.2.1/cmd/internal/cli/build.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/cmd/internal/cli/build.go 2023-07-27 18:28:18.000000000 +0200 @@ -381,7 +381,7 @@ if os.Getuid() != 0 { if isDeffile { sylog.Verbosef("Implying --fakeroot because building from definition file unprivileged") - fakerootExec(isDeffile, true) + fakerootExec(isDeffile, buildArgs.encrypt) } else if buildArgs.encrypt { sylog.Verbosef("Implying --fakeroot because using unprivileged encryption") fakerootExec(isDeffile, true) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/e2e/imgbuild/imgbuild.go new/apptainer-1.2.2/e2e/imgbuild/imgbuild.go --- old/apptainer-1.2.1/e2e/imgbuild/imgbuild.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/e2e/imgbuild/imgbuild.go 2023-07-27 18:28:18.000000000 +0200 @@ -1962,7 +1962,7 @@ // running under the mode 2(https://apptainer.org/docs/user/main/fakeroot.html) c.env.RunApptainer( t, - e2e.WithProfile(e2e.UserNamespaceProfile), + e2e.WithProfile(e2e.UserProfile), e2e.WithCommand("build"), e2e.WithArgs("--force", "--userns", "--ignore-subuid", "--ignore-fakeroot-command", fmt.Sprintf("%s/openssh-mode2a.sif", tmpDir), "testdata/unprivileged_build.def"), e2e.ExpectExit(255), // because chown will fail @@ -1971,7 +1971,7 @@ // running under the mode 2(https://apptainer.org/docs/user/main/fakeroot.html) c.env.RunApptainer( t, - e2e.WithProfile(e2e.UserNamespaceProfile), + e2e.WithProfile(e2e.UserProfile), e2e.WithCommand("build"), e2e.WithArgs("--force", "--userns", "--ignore-subuid", "--ignore-fakeroot-command", fmt.Sprintf("%s/openssh-mode2b.sif", tmpDir), "testdata/unprivileged_build_2.def"), e2e.ExpectExit(0), @@ -1980,7 +1980,7 @@ // running under the mode 3(https://apptainer.org/docs/user/main/fakeroot.html) c.env.RunApptainer( t, - e2e.WithProfile(e2e.FakerootProfile), + e2e.WithProfile(e2e.UserProfile), e2e.WithCommand("build"), e2e.WithArgs("--force", "--userns", "--ignore-subuid", fmt.Sprintf("%s/openssh-mode3.sif", tmpDir), "testdata/unprivileged_build.def"), e2e.ExpectExit(0), @@ -1989,7 +1989,7 @@ // running under the mode 4(https://apptainer.org/docs/user/main/fakeroot.html) c.env.RunApptainer( t, - e2e.WithProfile(e2e.FakerootProfile), + e2e.WithProfile(e2e.UserProfile), e2e.WithCommand("build"), e2e.WithArgs("--force", "--ignore-userns", "--ignore-subuid", fmt.Sprintf("%s/openssh-mode4.sif", tmpDir), "testdata/unprivileged_build_4.def"), e2e.ExpectExit(0), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/internal/pkg/image/unpacker/squashfs_apptainer.go new/apptainer-1.2.2/internal/pkg/image/unpacker/squashfs_apptainer.go --- old/apptainer-1.2.1/internal/pkg/image/unpacker/squashfs_apptainer.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/internal/pkg/image/unpacker/squashfs_apptainer.go 2023-07-27 18:28:18.000000000 +0200 @@ -364,6 +364,10 @@ fmt.Sprintf("LD_LIBRARY_PATH=%s", strings.Join(libraryPath, string(os.PathListSeparator))), fmt.Sprintf("APPTAINERENV_LD_LIBRARY_PATH=%s", strings.Join(libraryPath, string(os.PathListSeparator))), fmt.Sprintf("APPTAINER_DEBUG=%s", os.Getenv("APPTAINER_DEBUG")), + fmt.Sprintf("APPTAINER_VERBOSE=%s", os.Getenv("APPTAINER_VERBOSE")), + fmt.Sprintf("APPTAINER_QUIET=%s", os.Getenv("APPTAINER_QUIET")), + fmt.Sprintf("APPTAINER_SILENT=%s", os.Getenv("APPTAINER_SILENT")), + fmt.Sprintf("APPTAINER_MESSAGELEVEL=%s", os.Getenv("APPTAINER_MESSAGELEVEL")), } return cmd, nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/pkg/sylog/sylog.go new/apptainer-1.2.2/pkg/sylog/sylog.go --- old/apptainer-1.2.1/pkg/sylog/sylog.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/pkg/sylog/sylog.go 2023-07-27 18:28:18.000000000 +0200 @@ -20,8 +20,6 @@ "strings" ) -const messageLevelEnv = "APPTAINER_MESSAGELEVEL" - var messageColors = map[messageLevel]string{ FatalLevel: "\x1b[31m", ErrorLevel: "\x1b[31m", @@ -37,9 +35,9 @@ var logWriter = (io.Writer)(os.Stderr) func init() { - level, err := strconv.Atoi(os.Getenv(messageLevelEnv)) + l, err := strconv.Atoi(os.Getenv("APPTAINER_MESSAGELEVEL")) if err == nil { - loggerLevel = messageLevel(level) + loggerLevel = messageLevel(l) } } @@ -150,7 +148,7 @@ // GetEnvVar returns a formatted environment variable string which // can later be interpreted by init() in a child proc func GetEnvVar() string { - return fmt.Sprintf("%s=%d", messageLevelEnv, loggerLevel) + return fmt.Sprintf("APPTAINER_MESSAGELEVEL=%d", loggerLevel) } // Writer returns an io.Writer to pass to an external packages logging utility. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apptainer-1.2.1/pkg/sylog/sylog_dummy.go new/apptainer-1.2.2/pkg/sylog/sylog_dummy.go --- old/apptainer-1.2.1/pkg/sylog/sylog_dummy.go 2023-07-24 22:33:41.000000000 +0200 +++ new/apptainer-1.2.2/pkg/sylog/sylog_dummy.go 2023-07-27 18:28:18.000000000 +0200 @@ -14,6 +14,7 @@ import ( "io" "os" + "strconv" ) var ( @@ -21,6 +22,13 @@ loggerLevel = InfoLevel ) +func init() { + l, err := strconv.Atoi(os.Getenv("APPTAINER_MESSAGELEVEL")) + if err == nil { + loggerLevel = messageLevel(l) + } +} + func getLoggerLevel() messageLevel { if loggerLevel <= -noColorLevel { return loggerLevel + noColorLevel ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/apptainer/vendor.tar.gz /work/SRC/openSUSE:Factory/.apptainer.new.32662/vendor.tar.gz differ: char 15, line 1