-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libwacom: simplify tests enablement #1
libwacom: simplify tests enablement #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think @Atemu?
pkgs/by-name/li/libwacom/package.nix
Outdated
}); | ||
passthru = { | ||
# finalAttrs.finalPackage does not have .override | ||
tests = libwacom.override { withTests = true; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this finalAttrs.finalPackage.overrideAttrs so that libwacom-surface has the right .tests
derivation.
tests = libwacom.override { withTests = true; }; | |
tests = finalAttrs.finalPackage.overrideAttrs (prevAttrs: { doCheck = true; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, this is undesirable because it makes our code depend on doCheck
which is an implementation detail of mkDerivation
.
OTOH, we also need to pass through libwacom
to itself which is a bit of an odd pattern and comes with some caveats.
Additionally, this isn't really something we need to expose externally as that flag itself is an implementation detail for producing a passthru attr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm saying is that libwacom-surface
is defined as libwacom.overrideAttrs
.
That means nix-build -A libwacom-surface.tests
is going to run tests against the base, not against the patched version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's simpler and breaks fewer surprises. Please pull.
pkgs/by-name/li/libwacom/package.nix
Outdated
# Tests are in the `tests` pass-through derivation because one of them is flaky, frequently causing build failures. | ||
# See https://github.com/NixOS/nixpkgs/issues/328140 | ||
withTests ? false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this and will apply
pkgs/by-name/li/libwacom/package.nix
Outdated
mesonFlags = [ | ||
testsDisabled | ||
"--sysconfdir=/etc" | ||
(lib.mesonEnable "tests" withTests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(lib.mesonEnable "tests" withTests) | |
(lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) |
testsDisabled | ||
"--sysconfdir=/etc" | ||
(lib.mesonEnable "tests" withTests) | ||
(lib.mesonOption "sysconfdir" "/etc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
pkgs/by-name/li/libwacom/package.nix
Outdated
|
||
mesonFlags = map replaceDisabledWithEnabled prevAttrs.mesonFlags; | ||
nativeCheckInputs = lib.optionals withTests [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nativeCheckInputs = lib.optionals withTests [ | |
nativeCheckInputs = lib.optionals finalAttrs.finalPackage.doCheck [ |
f88642a
to
e43286d
Compare
e43286d
to
ba96bbb
Compare
Ooh got a (literally) last minute simplification in even ;) You did create a merge commit instead of fast-forwarding though; you should rebase that away for Nixpkgs purposes. |
There's a maybe bug about
Normally, |
Oh I saw it 😁 I love those |
Not-so-final attrs, huh?
I think it's fine to keep it as is.
No, I removed the |
This adds some extremely helpful and popular encoders in by default: * openjpeg * celt * libwebp * libaom On the `master` branch, closure size for ffmpeg-headless went up 18.5 MiB. ``` $ nix store diff-closures nixpkgs#ffmpeg-headless^bin .#ffmpeg-headless^bin celt: ∅ → 0.11.3, +168.4 KiB ffmpeg-headless: +70.0 KiB giflib: ∅ → 5.2.2, +398.7 KiB lcms2: ∅ → 2.16, +466.2 KiB lerc: ∅ → 4.0.0, +840.2 KiB libaom: ∅ → 3.9.0, +8047.8 KiB libdeflate: ∅ → 1.20, +427.0 KiB libtiff: ∅ → 4.6.0, +655.9 KiB libvmaf: ∅ → 3.0.0, +2665.0 KiB libwebp: ∅ → 1.4.0, +2559.7 KiB openjpeg: ∅ → 2.5.2, +1525.1 KiB zstd: ∅ → 1.5.6, +1158.0 KiB $ nvd diff $(nix build nixpkgs#ffmpeg-headless^bin --print-out-paths --no-link) $(nix build .#ffmpeg-headless^bin --print-out-paths --no-link) <<< /nix/store/4n60lnj3zkjpasd4c56bzhpx2m8lc1sx-ffmpeg-headless-6.1.1-bin >>> /nix/store/884f487w5hac6rs94jq6hq5zqkxdv666-ffmpeg-headless-6.1.1-bin Added packages: [A.] #1 celt 0.11.3 [A.] NixOS#2 giflib 5.2.2 [A.] NixOS#3 lcms2 2.16 [A.] NixOS#4 lerc 4.0.0 [A.] NixOS#5 libaom 3.9.0 [A.] NixOS#6 libdeflate 1.20 [A.] NixOS#7 libtiff 4.6.0 [A.] NixOS#8 libvmaf 3.0.0 [A.] NixOS#9 libwebp 1.4.0 x2 [A.] NixOS#10 openjpeg 2.5.2 [A.] NixOS#11 zstd 1.5.6 Closure size: 66 -> 78 (15 paths added, 3 paths removed, delta +12, disk usage +18.5MiB). ```
Strongly inspired by the forgejo counterpart[1], for the following reasons: * The feature is broken with the current module and crashes on authentication with the following stacktrace (with a PAM service `gitea` added): server # Stack trace of thread 1008: server # #0 0x00007f3116917dfb __nptl_setxid (libc.so.6 + 0x8ddfb) server # #1 0x00007f3116980ae6 setuid (libc.so.6 + 0xf6ae6) server # NixOS#2 0x00007f30cc80f420 _unix_run_helper_binary (pam_unix.so + 0x5420) server # NixOS#3 0x00007f30cc8108c9 _unix_verify_password (pam_unix.so + 0x68c9) server # NixOS#4 0x00007f30cc80e1b5 pam_sm_authenticate (pam_unix.so + 0x41b5) server # NixOS#5 0x00007f3116a84e5b _pam_dispatch (libpam.so.0 + 0x3e5b) server # NixOS#6 0x00007f3116a846a3 pam_authenticate (libpam.so.0 + 0x36a3) server # NixOS#7 0x00000000029b1e7a n/a (.gitea-wrapped + 0x25b1e7a) server # NixOS#8 0x000000000047c7e4 n/a (.gitea-wrapped + 0x7c7e4) server # ELF object binary architecture: AMD x86-64 server # server # [ 42.420827] gitea[897]: pam_unix(gitea:auth): unix_chkpwd abnormal exit: 159 server # [ 42.423142] gitea[897]: pam_unix(gitea:auth): authentication failure; logname= uid=998 euid=998 tty= ruser= rhost= user=snenskek It only worked after turning off multiple sandbox settings and adding `shadow` as supplementary group to `gitea.service`. I'm not willing to maintain additional multiple sandbox settings for different features, especially given that it was probably not used for quite a long time: * There was no PR or bugreport about sandboxing issues related to PAM. * Ever since the module exists, it used the user `gitea`, i.e. it had never read-access to `/etc/shadow`. * Upstream has it disabled by default[2]. If somebody really needs it, it can still be brought back by an overlay updating `tags` accordingly and modifying the systemd service config. [1] 07641a9 [2] https://docs.gitea.com/usage/authentication#pam-pluggable-authentication-module
The first assumption[1] we had was that the `aarch64-unknown-none` target was missing from rustc and that this was the cause for the regression. However, it turns out that the relevant code from `rustc` wasn't used anyways because the Makefile does `--sysroot /dev/null`[2] which prevents rustc from using its own libcore. So luckily we don't have to patch the Rust bootstrap to get aarch64-linux back working[3]. In fact, the Rust part seems broken for both 6.10 and 6.11[4], but I decided to not bother since none of those are longterm versions. So all that's left here is to enable Rust for aarch64-linux because it clearly works[5]. [1] NixOS#315121 (comment) [2] https://lore.kernel.org/all/[email protected]/ [3] Of course I only realized this _after_ I spent some time hacking a rustc patch together 🙃 [4] This broke with error[E0463]: can't find crate for `core` | = note: the `aarch64-unknown-none` target may not be installed = help: consider downloading the target with `rustup target add aarch64-unknown-none` = help: consider building the standard library from source with `cargo build -Zbuild-std` [5] While the build is fine, the VM tests are still panicking, but that's also the case for `kernel-generic` because of a 9p regression: switch_root: can't execute '/nix/store/zv87gw0yxfsslq0mcc35a99k54da9a4z-nixos-system-machine-test/init': Exec format error [ 1.734997] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100 [ 1.736002] CPU: 0 UID: 0 PID: 1 Comm: switch_root Not tainted 6.12.0-rc1 #1-NixOS [...] Reported as https://lore.kernel.org/all/[email protected]/T/#u
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.