Skip to content

Fix running tests inside of NixOS #100

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

Merged
merged 1 commit into from
May 31, 2025
Merged

Fix running tests inside of NixOS #100

merged 1 commit into from
May 31, 2025

Conversation

pietroalbini
Copy link
Member

The /nix directory not being mounted inside of the container caused inside-docker tests to fail.

Copy link
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about nix, or what else could be in there, to see if there might be a security impact where things are exposed to the container that shouldn't.

But shouldn't we add a test? Or do we think it's not necessary?

@pietroalbini
Copy link
Member Author

pietroalbini commented May 31, 2025

Oh this is done exclusively during tests, so it doesn't really have a security impact. All packages installed on the host are there.

This is required because on Nix the test binaries's dynamic dependencies are hardcoded paths inside of /nix:

$ ldd target/debug/deps/tests-0bd9ae4af87e59ae
linux-vdso.so.1 (0x00007f04ce6a0000)
libssl.so.3 => /nix/store/8pviily4fgsl02ijm65binz236717wfs-openssl-3.4.1/lib/libssl.so.3 (0x00007f04ce58d000)
libcrypto.so.3 => /nix/store/8pviily4fgsl02ijm65binz236717wfs-openssl-3.4.1/lib/libcrypto.so.3 (0x00007f04cd600000)
libgcc_s.so.1 => /nix/store/7c0v0kbrrdc2cqgisi78jdqxn73n3401-gcc-14.2.1.20250322-lib/lib/libgcc_s.so.1 (0x00007f04cdbd2000)
libm.so.6 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libm.so.6 (0x00007f04cd517000)
libc.so.6 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libc.so.6 (0x00007f04cd200000)
/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/ld-linux-x86-64.so.2 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib64/ld-linux-x86-64.so.2 (0x00007f04ce6a2000)
libdl.so.2 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libdl.so.2 (0x00007f04ce586000)
libpthread.so.0 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libpthread.so.0 (0x00007f04ce581000)

@syphar
Copy link
Member

syphar commented May 31, 2025

Oh this is done exclusively during tests,

Oh I missed that part, too quick to reply , not awake enough yet.

@syphar syphar merged commit b6705e9 into master May 31, 2025
5 checks passed
@pietroalbini pietroalbini deleted the pa-nixos branch May 31, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants