In the context of musl, users are typically expecting statically-linked tools,
as this is one of musl's strong suits and one of the biggest reasons to use it
instead of glibc (that is not static-link-friendly for reasons).
- remove the build-flag which was causing musl libc to be linked dynamically
- re-add feat_os_unix_musl which was removed in 21d5cef153
- exclude stdbuf from feat_os_unix_musl, since libstdbuf.so can't be built with a statically linked musl libc
- add test_musl_no_dynamic_deps so that this does not regress in the future
Fixes https://github.com/uutils/coreutils/issues/8572
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* add support for systemd-logind
Add support for systemd-logind for systems where `/var/run/utmp` does not exist any more (e.g. Ubuntu 25.04).
Here is some context explaining the switch from utmp to systemd-logind:
https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/
Fixes https://github.com/uutils/coreutils/issues/8376
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* fix duplicated boot record
When feature feat_systemd_logind is enabled and utmp is present, two boot records were printed.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* improve error forwarding
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* remove unnecessary negation in if/else block
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* use getpwuid_r() instead of getpwuid()
getpwuid() is not thread-safe.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* improve error handling
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* use Path instead of string
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* use closure to reduce the number of clones() calls
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* use MaybeUninit instead of mem::zeroed()
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* systemd-logind: add some unit-tests
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* use sysconf(_SC_GETPW_R_SIZE_MAX) instead of 1024
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* fix cspell
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* add auto-enablement of feat_systemd_logind in GNUmakefile
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* Revert "add auto-enablement of feat_systemd_logind in GNUmakefile"
This breaks "Tests/BusyBox test suite" in CI.
This reverts commit 16626d4653.
---------
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
- Added devcontainer configuration based on Ubuntu 24.04
- Added GitHub Actions workflow for devcontainer testing
- Update cSpell configuration to ingore spelling in devcontainer configs
- Update pre-commit hooks to exclude cSpell.json because pre-commit
fails for that file due to json with comments format
- Fix filename for cSpell config in vscode settings
- Two tests in `test_dd.rs` are now skipped if /dev/sda1 is not
available, which is the case in devcontainer
- Update check for existing gnu clone in build-gnu.sh, not checking the
existence of the directory but the presence of the .git directory.
This allows us to have the directly as a volume mount in devcontainer
- Remove temporary file `g` after use in build-gnu.sh
Looks like the "system boot" entry is not present in /var/lib/utmp
on recent ubuntu-latest images.
Not totally clear why it disappeared, but let's just create a fake
one instead.
* tests: fix execution on WSL2, Ubuntu 24.04
Skip incompatible parts of tests to ensure that
cargo nextest run --features unix
executes successfully in WSL2, Ubuntu 24.04 distribution.
Changes
* Skip tests that required sys/kernel/profiling which is not
available in WSL2 default configuration.
* Use timezones in tests that are part of the standard tzdata
list and not only available in backwards list. Backwards list is
not installed by default in Ubuntu 24.04 (package tzdata-legacy).
* check that /proc/modules is not empty when expecting content,
because it is empty in WSL2 default configuration.
* Skip logname test not only in WSL1, also in WSL2.
* Add workflow for WSL2
This will setup WSL2 on windows-latest runner, install
Ubuntu-24.04, and run the feat_os_unix tests.
* wsl2: implemented review findings
---------
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
* .github/workflows/GnuTests.yml: Move variables to env
Will make it easier to split the work into 2 jobs.
* .github/workflows/GnuTests.yml: Move all Selinux steps to a separate job
* .github/workflows/GnuTests.yml: Create a new summary job
That aggregates between native and selinux results.
* .github/workflows/GnuTests.yml: Fix log uploading
This... didn't work, even in the previous version.
(found by Gemini...)
* .github/workflows/GnuTests.yml: Improve aggregate
Variables don't always help make things clearer.
* .github/workflows/GnuTests.yml: Make selinux and native flow identical
Also add some headers to make things easier to follow.
* .github/workflows/GnuTests.yml: More misc cleanup
In particular, SELinux flow is simplified, and fixed.
Also fix artifact download name.
* .github/workflows/GnuTests.yml: Fix aggregate job
There was a small bug in `Makefile` that caused the `target`
directory to be created by `install`, not `cargo`, which
lead to a missing `target/CACHEDIR.TAG`.
Test for that in CI, so that the issue does not recur.
The issue referenced has been long fixed, and for reasons not
totally clear to me, blake3 fails after the GCC update (I tried
to dig into this, but couldn't really figure out if this is really
a problem with GCC 15, or with the version provided by MSYS, or
some other side effect of the exact sequence in CI).
Since blake3 CI doesn't do that gcc update (it uses the default gcc ~12
in the github windows image), let's _also_ not do that, and if there's a
real problem with gcc 15+, that'll presumably fail their CI as well.
Fixes#7977.