Commit Graph

1534 Commits

Author SHA1 Message Date
Hadi Chokr f84d5f8416 Update toolbox-unexport.1.md
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:14 +03:00
Hadi Chokr 4ec89ed1d6 Update toolbox-export.1.md
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:14 +03:00
Hadi Chokr 3054161c87 Update unexport.go
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Hadi Chokr 95e0bf2e31 Update export.go
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Hadi Chokr 6917465aac Add unexport Help
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Hadi Chokr 0bb8b677b3 add help function
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Hadi Chokr 230ac941b9 Add new subcommands to common Usage
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Hadi Chokr cc714d6af7 Add Docs to new Features
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Hadi Chokr 1dad3c86fe Add unexport and export.
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2025-08-18 20:46:13 +03:00
Debarshi Ray e3ce0bc457 Prepare 0.2
https://github.com/containers/toolbox/pull/1703
2025-08-08 21:38:17 +02:00
Debarshi Ray b7e70e28c4 test/system: Tighten the regular expression used to check the version
The MAJOR version will always be 0, the MINOR version can't be 0 after
the release of 0.1.0; until 1.0.0 or 1.0 is released, which won't happen
in the short-term future.  Similarly, the MICRO version can't be 0 after
the release of 0.1.1, until 0.2.0 is released.

Future releases will default to not having a MICRO version and use a
MAJOR.MINOR versioning scheme.  A MICRO version will be reserved for the
same purposes that a NANO version was reserved for until now, and it
will never be 0.

Tighten the regular expression used to check the version to match this
present reality.  It can be revisited when 1.0 is eventually released.

https://github.com/containers/toolbox/pull/1703
2025-08-08 21:38:17 +02:00
Debarshi Ray e2dda19349 test/system: Prepare for shorter version numbers
Toolbx started out with a MAJOR.MINOR.MICRO versioning scheme.  eg.,
0.0.1, 0.0.2, etc..  A NANO version was reserved for releases to address
brown paper bag bugs [1] or other critical issues, and release
candidates.  eg., a few releases used the MAJOR.MINOR.MICRO.NANO
versioning scheme between 0.0.98 and 0.1.0 to act as an extended set of
release candidates for the dot-zero 0.1.0 release.

The MAJOR.MINOR.MICRO versioning scheme was meant to indicate the
nascent nature of the Toolbx project and the ideas behind it when it
first started in August 2018.  It's been seven years since then, and
both the project and the ideas that it implements are a lot more mature
and widely adopted.  So much so, that there are a few independent
reimplementations today [2,3].

In version 0.0.90, Toolbx switched from a POSIX shell implementation to
a Go implementation.  The practice of bundling and statically linking
the Go dependencies sometimes makes it necessary to update the
dependencies to address security bugs or other critical issues.  It's
more convenient to do this as part of an upstream release than through
downstream patches by distributors.

Hence, it will be helpful for downstream distributors, especially those
that offer long-term support, to have targeted bug-fix releases that
only have the critical dependency updates or other critical fixes, and
nothing else.

To address this situation, future releases will default to not having a
MICRO version and use a MAJOR.MINOR versioning scheme.  A MICRO version
will be reserved for the same purposes that a NANO version was reserved
for until now.

It's easier to read and remember a shorter MAJOR.MINOR version than a
longer one, and appropriately conveys the maturity of the project.  When
a MICRO version is needed, it will also be easier to read and remember
than a longer one with a NANO version.

As per this new scheme, the next release will be version 0.2.

[1] https://www.computer-dictionary-online.org/definitions-b/brown-paper-bag-bug

[2] https://github.com/89luca89/distrobox/

[3] https://github.com/openSUSE/microos-toolbox/

https://github.com/containers/toolbox/pull/1703
2025-08-08 21:11:16 +02:00
Debarshi Ray 7fa23036cd .mailmap: Canonicalize Mario's name
From now on, masch <the.masch@gmail.com> will show up as Mario Sebastian
Chacon <the.masch@gmail.com>.

https://github.com/containers/toolbox/pull/1703
2025-08-08 14:27:31 +02:00
Debarshi Ray a273d25c1c NEWS: Add missing entry about the minimum Go version
Fallout from 82e85bac9f and
40e3c5a63f

https://github.com/containers/toolbox/pull/1700
2025-08-08 01:15:36 +02:00
Brian Koropoff 39e0800867 pkg/utils, test/system: Preserve the Konsole profile, tab and window
Konsole injects the name of the current profile, and the identifiers
of the current tab and window into the process running inside it
through the KONSOLE_PROFILE_NAME, KONSOLE_DBUS_SESSION and
KONSOLE_DBUS_WINDOW environment variables respectively [1,2,3].  These
are used by programs like Neovim to detect the terminal features
supported by Konsole [4,5], or by users to save the shell's history
separately for each profile, tab or window [6].

These environment variables are not meant to be set by the shell's
start-up scripts, but directly by Konsole, and hence needs to be
preserved across the host operating system and Toolbx container.

Note that KONSOLE_PROFILE_NAME was later removed from Konsole [7].
However, Neovim still uses it, so it's better to preserve it.

[1] Konsole commit debfec2eb3c8ede8
    https://invent.kde.org/utilities/konsole/-/commit/debfec2eb3c8ede8
    https://bugs.kde.org/show_bug.cgi?id=227296

[2] Konsole commit fcd815256c3729f2
    https://invent.kde.org/utilities/konsole/-/commit/fcd815256c3729f2

[3] Konsole commit 07cddfe302233c35
    https://invent.kde.org/utilities/konsole/-/commit/07cddfe302233c35
    https://bugs.kde.org/show_bug.cgi?id=276912
    https://bugs.kde.org/show_bug.cgi?id=281513
    https://bugs.kde.org/show_bug.cgi?id=292309

[4] Neovim commit 5fc4c2d442f01ab5
    https://github.com/neovim/neovim/commit/5fc4c2d442f01ab5
    https://github.com/neovim/neovim/pull/3129

[5] Neovim commit 3ccd59ee8216f3da
    https://github.com/neovim/neovim/commit/3ccd59ee8216f3da
    https://github.com/neovim/neovim/pull/6432
    https://github.com/neovim/neovim/issues/6429
    https://github.com/neovim/neovim/issues/6430

[6] https://userbase.kde.org/Konsole/en

[7] Konsole commit 9e3a30fdca2078e0
    https://invent.kde.org/utilities/konsole/-/commit/9e3a30fdca2078e0
    https://bugs.kde.org/show_bug.cgi?id=406955

https://github.com/containers/toolbox/issues/1449
https://github.com/containers/toolbox/pull/1696
https://github.com/containers/toolbox/pull/1698
2025-08-08 01:08:55 +02:00
Brian Koropoff 1f127759b3 pkg/utils: Preserve environment variables set by a KDE session
A KDE session sets some environment variables to influence the behaviour
of various programs and to access various settings [1].  eg., if the
KDE_SESSION_VERSION environment variable is absent then applications
won't respect KDE's theme or display scaling settings.

These environment variables are not meant to be set by the shell's
start-up scripts, but directly by KDE, and hence needs to be preserved
across the host operating system and Toolbx container.

[1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables

https://github.com/containers/toolbox/pull/1696
https://github.com/containers/toolbox/pull/1698
2025-08-08 01:08:55 +02:00
Dalibor Kricka 6c98db6ba2 test/system: Unbreak the 'toolbox run /etc' tests with Bash >= 5.3
Bash 5.3.0 changed the error messages shown by its exec built-in [1].

With Bash 5.2.37:
  $ exec /etc
  bash: /etc: Is a directory
  bash: exec: /etc: cannot execute: Is a directory

With Bash 5.3.0:
  $ exec /etc
  bash: /etc: Is a directory

The 'assert' function cannot directly handle compound commands.  So,
those need to be wrapped in 'bash -c "..."' [2].

[1] Bash commit b8c60bc9ca365f82
    See how exec_builtin() handles EX_NOEXEC and EISDIR from
    shell_execve() to avoid printing a duplicate error message.
    https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?id=b8c60bc9ca365f82

[2] https://github.com/bats-core/bats-assert

https://github.com/containers/toolbox/pull/1688
https://github.com/containers/toolbox/pull/1699
2025-08-08 01:07:31 +02:00
Debarshi Ray d32dd5d322 Fix resolving /etc/localtime
Detected by https://www.shellcheck.net/:
  Line 1255:
  if ! localtime_target=$(readlink /etc/localtime >/dev/null 2>&3) \
                        ^-- SC2327 (warning): This command substitution
                            will be empty because the command's output
                            gets redirected away.
                                                  ^-- SC2328 (error):
                                                      This redirection
                                                      takes output away
                                                      from the command
                                                      substitution.

See:
https://www.shellcheck.net/wiki/SC2327
https://www.shellcheck.net/wiki/SC2328

Fallout from 8db414ddc2

https://github.com/containers/toolbox/pull/1701
2025-08-08 01:05:55 +02:00
Debarshi Ray f1f7d9c3d3 cmd/initContainer: Unbreak access to CA certificates in sshd(8) sessions
When a Toolbx container is set up to use the p11-kit-client.so PKCS #11
module instead of the usual p11-kit-trust.so module, the
P11_KIT_SERVER_ADDRESS environment variable must be set inside the
container, so that it can communicate with the host operating system.

Currently, this works as described above with the 'enter' and 'run'
commands, but not within child sessions started by an sshd(8) [1]
instance running inside a container, because P11_KIT_SERVER_ADDRESS is
absent.

To make this work, sshd(8) [1] must be configured [2] to set
P11_KIT_SERVER_ADDRESS in its child sessions.

If sshd(8) uses the /etc/ssh/sshd_config.d directory for configuration,
then the entry point will automatically do this from now on.  This
requires at least OpenSSH 8.2, which added support for the 'Include'
directive in sshd_config(5) [2,3], and the directive must be used to
include the configuration from /etc/ssh/sshd_config.d.

Otherwise, the user will have to do it themself.  eg., Ubuntu 16.04
Xenial Xerus and 18.04 Bionic Beaver don't use /etc/ssh/sshd_config.d
because their OpenSSH is too old [4,5].

Note that the permissions of the /etc/ssh/sshd_config.d directory and
its contents differ across operating system distributions.  OSes within
the Fedora family use 0700 for the directory and 0600 for its contents.
Arch Linux and Ubuntu use 0755 and 0644.  The entry point tries to
follow the permissions used by the distribution.

Fallout from 5ed2442214

[1] https://man7.org/linux/man-pages/man8/sshd.8.html

[2] https://man7.org/linux/man-pages/man5/sshd_config.5.html

[3] OpenSSH commit c2bd7f74b0e0f3a3
    https://github.com/openssh/openssh-portable/commit/c2bd7f74b0e0f3a3
    https://bugzilla.mindrot.org/show_bug.cgi?id=2468

[4] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/openssh/+git/openssh/+ref/ubuntu/xenial-updates

[5] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/openssh/+git/openssh/+ref/ubuntu/bionic-updates

https://github.com/containers/toolbox/issues/626
https://github.com/containers/toolbox/issues/1674
2025-08-07 14:32:28 +02:00
Debarshi Ray 55582290eb cmd/initContainer: Detect mount points when creating symbolic links
An error like this shouldn't happen unless Podman did something
unexpected or was used wrong or something else happened that inserted an
unexpected mount point in the container to surprise the entry point.
eg., removing the --no-hosts option from 'podman create' will trigger
this.

This change replaces the more generic error message:
  $ toolbox enter
  Error: failed to redirect /etc/hosts to /run/host/etc/hosts: remove
      /etc/hosts: device or resource busy

... to something more precise:
  $ toolbox enter
  Error: failed to redirect /etc/hosts to /run/host/etc/hosts:
      /etc/hosts is a mount point

https://github.com/containers/toolbox/pull/1692
2025-07-31 00:01:09 +02:00
Debarshi Ray 655e5cca51 cmd/initContainer: Fail if non-folder files can't be removed for linking
There's no reason to ignore an error when trying to remove a file within
the container that's not a directory, before turning it into a symbolic
link.

The POSIX shell implementation didn't make any distinction between
directories and other types of files.

For files that aren't directories, it did:
  cd /path/to \
  && rm --force file \
  && ln --symbolic /run/host/path/to/file file

For directories, it did:
  rmdir /path/to/directory \
  && mkdir --parents /path/to/target \
  && ln --symbolic /path/to/target /path/to/directory

It's possible that this was a misunderstanding about the behaviour of
'rm --force' when writing the Go implementation.  It only ignores errors
arising from missing files, and not every error [1].  eg., if the file
is a mount point, it won't ignore the error:
  $ sudo mount --rbind /etc/machine-id foo
  $ rm --force foo
  rm: cannot remove 'foo': Device or resource busy

Fallout from 772b66bf3e

[1] https://man7.org/linux/man-pages/man1/rm.1.html

https://github.com/containers/toolbox/pull/1692
2025-07-30 23:49:23 +02:00
Debarshi Ray 87b4c0c3e3 cmd/initContainer: Use errors.Is() instead of os.IsNotExist()
The os.IsNotExist() function [1] predates the introduction of the
errors.Is() function [2] in Go 1.13 [3].  From Go >= 1.16, the
documentation explicitly recommends the use of errors.Is() instead of
os.IsNotExist() [4].

The Go implementation of Toolbx never used any Go older than 1.13 [5],
and currently it requires Go >= 1.22 [6].  So, there's no reason not to
use the more modern and recommended alternative.

[1] https://pkg.go.dev/os#IsNotExist

[2] https://pkg.go.dev/errors#Is

[3] https://go.dev/blog/go1.13-errors

[4] Go commit b641f0dcf48aa748
    https://github.com/golang/go/commit/b641f0dcf48aa748
    https://github.com/golang/go/issues/41122

[5] Commit d857471aa2
    https://github.com/containers/toolbox/commit/d857471aa2f233e5
    https://github.com/containers/toolbox/pull/318

[6] Commit eb73692618
    https://github.com/containers/toolbox/commit/eb736926183b1c20
    https://github.com/containers/toolbox/pull/1662

https://github.com/containers/toolbox/pull/1691
2025-07-30 22:00:05 +02:00
Tino Calancha a61b85cf8f playbooks/dependencies-fedora: Unbreak the missing subordinate ID ranges
On Fedora 42 onwards, useradd(8) stopped automatically assigning
subordinate group and user ID ranges [1,2] to address a security concern
marked as CVE-2024-56433 [3].  This breaks rootless Podman and Skopeo,
and therefore Toolbx [4].

Restore the subordinate group and user ID ranges until a different
solution emerges.

[1] Fedora shadow-utils commit e1cfa31731cd68aa
    https://src.fedoraproject.org/rpms/shadow-utils/c/e1cfa31731cd68aa
    https://bugzilla.redhat.com/show_bug.cgi?id=2334168

[2] Fedora shadow-utils commit 4929903292e027ca
    https://src.fedoraproject.org/rpms/shadow-utils/c/4929903292e027ca
    https://bugzilla.redhat.com/show_bug.cgi?id=2334169

[3] https://github.com/shadow-maint/shadow/issues/1157

[4] https://bugzilla.redhat.com/show_bug.cgi?id=2382662

https://github.com/containers/toolbox/pull/1688
2025-07-25 00:09:02 +02:00
Debarshi Ray 69fb9c3bb5 build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.8
... for CVE-2025-23266 and CVE-2025-23267.

The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1687
2025-07-22 10:21:55 +02:00
Debarshi Ray b3d259ca07 build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.7
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1687
2025-07-21 22:47:33 +02:00
Debarshi Ray fd0a7bf418 build: Bump github.com/NVIDIA/go-nvlib to 0.7.2
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1687
2025-07-21 22:37:58 +02:00
Debarshi Ray 25ab60d01a build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.6
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1687
2025-07-21 21:36:42 +02:00
Penn Bauman 1a1b956201 .github/workflows, test/system: Enable 210-ulimit.bats on Ubuntu 22.04
When 'toolbox run ulimit' is invoked, it comes down to invoking
"bash --login -c 'exec ulimit'" inside the container, and it leads to
different outcomes on Fedora and Ubuntu hosts.

On Fedora:
  $ bash --login -c 'exec ulimit'
  unlimited

On Ubuntu:
  $ bash --login -c 'exec ulimit'
  bash: line 1: exec: ulimit: not found

This is because Bash's exec built-in cannot execute another built-in and
needs an external command; and Fedora ships a wrapper for the ulimit
built-in as an external command [1] to satisfy POSIX [2]:
  $ cat /usr/bin/ulimit
  #!/usr/bin/sh
  builtin ulimit "$@"

... that Ubuntu doesn't.

Wrapping the 'ulimit' as 'bash -c ulimit' solves this problem because
then it becomes "bash --login -c 'exec bash -c ulimit'", and the exec
built-in can execute the external command bash(1).

[1] Fedora bash commit 3b09d0d67fe7ff4c
    Fedora bash commit a28ab9933095eaf6
    https://src.fedoraproject.org/rpms/bash/c/3b09d0d67fe7ff4c
    https://src.fedoraproject.org/rpms/bash/c/a28ab9933095eaf6
    https://bugzilla.redhat.com/show_bug.cgi?id=1297166

[2] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/toc.html

https://github.com/containers/toolbox/pull/1599

Signed-off-by: Penn Bauman <me@pennbauman.com>
2025-07-16 15:34:00 +02:00
Debarshi Ray e2fd458335 .github/workflows: Enable 230-cdi.bats on Ubuntu 22.04
Fallout from 6e848b250b

https://github.com/containers/toolbox/pull/1686
2025-07-16 01:53:11 +02:00
Debarshi Ray 62322a9c76 .github/workflows: Bump Go to 1.22 for CI on Ubuntu 22.04
Fallout from eb73692618

https://github.com/containers/toolbox/pull/1685
2025-07-16 00:13:45 +02:00
Debarshi Ray 2099190211 playbooks: Use the same commands as mentioned in the documentation
... at https://containertoolbx.org/install/

This should have been part of commit df22010e4f.

https://github.com/containers/toolbox/pull/1678
2025-07-04 21:34:50 +02:00
Debarshi Ray fb43d3e06e pkg/utils: Remove unused functions
Fallout from d323143c46

https://github.com/containers/toolbox/pull/1677
2025-07-04 21:04:35 +02:00
Debarshi Ray 62712d7589 pkg/utils: Style fixes
Fallout from the following:
  * f5bf741f86
  * 2edc30836b
  * 872eba41a9
  * 8b6418d8aa
  * b166a1f13f
  * 0000cb0151

https://github.com/containers/toolbox/pull/1677
2025-07-04 21:01:19 +02:00
Debarshi Ray cded2709e2 test/system: Remove redundant set-up
There's no need to repeatedly create the home directory and the
containers-storage.conf(5), because their life cycles are suite-wide.
It's enough to create them once as part of the suite-wide set-up hook
(ie., setup_suite()).

It was only necessary to do it this way at a time when Bats < 1.7.0
didn't offer any hooks for suite-wide set-up and tear-down, and the
CONTAINERS_STORAGE_CONF and XDG_RUNTIME_DIR environment variables were
exported to the test cases from the _setup_environment() function.

The switch to using the suite-wide set-up hook offered by Bats >= 1.7.0
in commit 7a387dcc8b removed the need to do this set-up
repeatedly.  Currently, those two environment variables are set globally
outside the _setup_environment() function [1,2], which removes any
lingering doubts about this.

This should have been part of commit 7a387dcc8b.

[1] Commit f4591718e4
    https://github.com/containers/toolbox/commit/f4591718e483bdf5
    https://github.com/containers/toolbox/pull/1672

[2] Commit ad3346f915
    https://github.com/containers/toolbox/commit/ad3346f9153dbf0f
    https://github.com/containers/toolbox/pull/1676

https://github.com/containers/toolbox/pull/1676
2025-07-04 11:37:34 +02:00
Debarshi Ray ad3346f915 test/system: Simplify code by removing a function
It's simpler to check and set all the environment variables in one
place and in the same way, instead of having them scattered and using
different means.

https://github.com/containers/toolbox/pull/1676
2025-07-03 16:25:02 +02:00
dependabot[bot] 0f961c5ac8 build: Bump github.com/go-viper/mapstructure/v2 to 2.3.0
... for GHSA-fv92-fjc5-jj9h.

https://github.com/containers/toolbox/pull/1669
https://github.com/containers/toolbox/security/dependabot/22

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-29 20:41:15 +02:00
Debarshi Ray 009bc14c99 test/system: Restore some configuration paths to their usual values
The default location for a rootless user's storage.conf file [1], which
is overridden by the CONTAINERS_STORAGE_CONF environment variable [2],
is at $XDG_CONFIG_HOME/containers/storage.conf, and the default value of
the rootless_storage_path option is $XDG_DATA_HOME/containers/storage.
Earlier they were being set to different paths because the user's home
directory on the host operating system was not isolated from the system
tests.

Now that the user's home directory is isolated because the system tests
use a custom HOME, these configuration paths can be restored to their
default values relative to this custom HOME.  This will make things more
understandable by making the directory hierarchy within Bats' sandbox
similar to the defaults.

The CONTAINERS_STORAGE_CONF environment variable was not removed to
protect against cases where Bats might get invoked with a different
CONTAINERS_STORAGE_CONF set in the environment.  The other option is to
unset the variable from the environment.  The former was chosen to
deviate as little from the status quo as possible.

[1] https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md

[2] https://docs.podman.io/en/latest/markdown/podman.1.html

https://github.com/containers/toolbox/pull/1673
2025-06-29 20:39:32 +02:00
Debarshi Ray 4251a0409f pkg/utils, test/system: Isolate the host's HOME from the system tests
Currently, the test for the 'run' command to ensure that a login shell
is used to invoke commands temporarily changes the user's
~/.bash_profile [1].  This is really inappropriate because the system
tests shouldn't touch the user's configuration or data.

Therefore, it's better to use a custom home directory for the system
tests that's within the sandbox offered by Bats [2].

Some of the common base directories that derive from the user's home
directory [3] were redefined in terms of the custom home directory.
Podman [4,5,6], Toolbx [7] and many other programs rely on these for
various purposes, and Bats might get invoked with different values set
in the environment.  The other option is to unset the variables from the
environment.

This was made possible by commit 3bf9fdde4c that unbroke the
overriding of the HOME environment variable in the Go implementation.
Otherwise, the system tests failed with:
  not ok 8 help: Try unknown command (forwarded to host)
  # (from function `assert_line' in file
      test/system/libs/bats-assert/src/assert.bash, line 488,
  #  in test file test/system/002-help.bats, line 136)
  #   `assert_line --index 0 "Error: unknown command \"foo\" for
      \"toolbox\""' failed
  #
  # -- line differs --
  # index    : 0
  # expected : Error: unknown command "foo" for "toolbox"
  # actual   : Error: crun: chdir to
      `/var/tmp/bats-run-5pDdU0/suite/home`: No such file or
      directory: OCI runtime attempted to invoke a command that was
      not found
  # --
  #

[1] Commit 1ce59a6a2d
    https://github.com/containers/toolbox/commit/1ce59a6a2d3a4c50
    https://github.com/containers/toolbox/pull/1148
    https://github.com/containers/toolbox/issues/1076

[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html

[3] https://specifications.freedesktop.org/basedir-spec/latest/

[4] https://docs.podman.io/en/latest/markdown/podman.1.html

[5] https://github.com/containers/common/blob/main/docs/containers.conf.5.md

[6] https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md

[7] https://github.com/containers/toolbox/blob/main/doc/toolbox.conf.5.md

https://github.com/containers/toolbox/pull/1668
2025-06-29 16:52:44 +02:00
Debarshi Ray 01684a72e9 test/system: Simplify code
The "${FOO}" notation for accessing the value of a variable is not
consistently used elsewhere and ShellCheck doesn't insist on it.
Therefore, it's better to use the simpler "$FOO" notation.

https://github.com/containers/toolbox/pull/1672
2025-06-28 02:32:02 +02:00
Debarshi Ray f4591718e4 test/system: Simplify code by removing a variable
The CONTAINERS_STORAGE_CONF environment variable is documented in the
podman(1) manual page [1] and there's no need to have another layer of
indirection by having another variable.

Fallout from 7a5f3ba2e2

[1] https://docs.podman.io/en/latest/markdown/podman.1.html

https://github.com/containers/toolbox/pull/1672
2025-06-28 02:31:52 +02:00
Debarshi Ray cee75ef9f2 test/system: Rename a variable for clarity and better namespacing
Matching the name of the variable with the configuration option improves
clarity, and prefixing the name with TOOLBX prevents it from colliding
with environment variables used by other programs or projects.

https://github.com/containers/toolbox/pull/1672
2025-06-28 02:31:46 +02:00
Debarshi Ray d14d0e52dd test/system: Simplify building an image without a name
https://github.com/containers/toolbox/pull/1671
2025-06-28 01:24:18 +02:00
Debarshi Ray cc5f8fd432 pkg/utils: Preserve HOME environment variable when forwarding to host
Currently, it's impossible to create a Toolbx container with a different
home directory from the host while sitting inside a Toolbx container.

Preserving the HOME environment variable when forwarding to the host
will enable users to create containers with different home directories
for increased isolation while sitting inside a Toolbx container, and to
isolate the host's HOME from the system tests.

This was never supported by the POSIX shell implementation.

https://github.com/containers/toolbox/issues/1044
https://github.com/containers/toolbox/issues/1564
2025-06-27 21:22:49 +02:00
Debarshi Ray 3bf9fdde4c cmd/create, cmd/run, cmd/utils: Unbreak overriding the HOME variable
The POSIX shell implementation used to read and respect the HOME
environment variable.  It broke when the Go implementation started using
user.Current() [1], because it uses getpwuid_r(3), which only uses the
GNU Name Service Switch's (or NSS') password database and ignores HOME.

This created a strange situation where the toolbox(1) binary ignored the
HOME environment variable, while the profile.d/toolbox.sh shell start-up
snippet and Podman read and respected it.

Restoring the HOME environment variable will enable users to create
Toolbx containers with different home directories from the host for
increased isolation, and to isolate the host's HOME from the system
tests.

Fallout from e8d7f25e83

[1] https://pkg.go.dev/os/user#Current

https://github.com/containers/toolbox/issues/1044
https://github.com/containers/toolbox/issues/1564
2025-06-26 21:04:34 +02:00
Debarshi Ray eb73692618 build, pkg/nvidia: Bump NVIDIA Container Toolkit to 1.17.5
NVIDIA Container Toolkit 1.17.5 requires Go >= 1.22 [1], and starts
using enable-cuda-compat hooks in the Container Device Interface
specification generated by it [2].  For example:
  "hookName": "createContainer",
  "path": "/usr/bin/nvidia-cdi-hook",
  "args": [
    "nvidia-cdi-hook",
    "enable-cuda-compat",
    "--host-driver-version=570.153.02"
  ]

The new hook makes it possible to have containers with a
/usr/local/cuda/compat/libcuda.so.* that's newer than the proprietary
NVIDIA driver on the host operating system, so that applications can use
a newer CUDA without having to update the driver [3].  Even though this
sounds useful, the hook has been disabled until it's handled by the
'init-container' command and there's a clear way to test it.

The src/go.sum file was updated with 'go mod tidy'.

[1] NVIDIA Container Toolkit commit 5bdf14b1e7c24763
    https://github.com/NVIDIA/nvidia-container-toolkit/commit/5bdf14b1e7c24763
    https://github.com/NVIDIA/nvidia-container-toolkit/pull/941
    https://github.com/NVIDIA/nvidia-container-toolkit/pull/950

[2] NVIDIA Container Toolkit commit 76040ff2ad63fb82
    https://github.com/NVIDIA/nvidia-container-toolkit/commit/76040ff2ad63fb82
    https://github.com/NVIDIA/nvidia-container-toolkit/pull/906
    https://github.com/NVIDIA/nvidia-container-toolkit/pull/948

[3] https://docs.nvidia.com/deploy/cuda-compatibility/

https://github.com/containers/toolbox/pull/1662
2025-06-11 21:30:11 +02:00
Debarshi Ray a49f70effe build: Bump tags.cncf.io/container-device-interface to 0.8.1
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1662
2025-06-11 15:22:06 +02:00
Debarshi Ray 40e3c5a63f Prepare 0.1.2
https://github.com/containers/toolbox/pull/1653
2025-06-03 22:08:50 +02:00
Debarshi Ray 231904e5ad build: Unbreak 'go build' by using micro version in go.mod's go line
Currently, 'go build' is failing on Fedora 42 Workstation:
  $ meson compile -C builddir --verbose
  ...
  /path/src/go-build-wrapper /path/src /path/builddir src/toolbox 0.1.1
      cc /lib64/ld-linux-x86-64.so.2 false
  go: updates to go.mod needed; to update it:
          go mod tidy
  ninja: build stopped: subcommand failed.

... with Go version:
  $ go version
  go version go1.24.3 linux/amd64
  $ rpm -q golang
  golang-1.24.3-2.fc42.x86_64

Strangely, the CI hasn't been failing on Fedora 42 with the same Go
version [1].

Starting from Go version 1.21.0, Go started using an explicit 0 micro
version instead of skipping it - compare Go 1.20 and 1.21.0 [2].  It
looks like recent versions of Go are pedantic about using the exact
version number.

[1] https://github.com/containers/toolbox/pull/1657

[2] https://github.com/golang/go/releases/tag/go1.20
    https://github.com/golang/go/releases/tag/go1.21.0

https://github.com/containers/toolbox/pull/1659
2025-06-03 22:07:00 +02:00
Debarshi Ray 9ac6728597 build: Bump github.com/spf13/viper to 1.20.1
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1656
2025-06-02 22:34:17 +02:00
Debarshi Ray 7ee347278e .github, build, playbooks: Bump github.com/spf13/viper to 1.20.0
... to reduce the number of indirect dependencies [1].

The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

This reverts commit 8b62d7e95d because the
go.opencensus.io dependency was removed from github.com/spf13/viper in
version 1.20.0 [1].

[1] Viper commit 7ad8e1ea014790e2
    https://github.com/spf13/viper/commit/7ad8e1ea014790e2
    https://github.com/spf13/viper/pull/1860
    https://github.com/spf13/viper/issues/1845

https://github.com/containers/toolbox/pull/1657
2025-06-02 22:33:30 +02:00