Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
That's a problem with the dynamic loader:
https://discourse.nixos.org/t/no-such-file-of-directory-when-trying-to-execute-binary-file/6150
When linking
libapp.so
withhost.zig
, zig puts in the binary the standard path for the dynamic loader on linux:/lib64/ld-linux-x86-64.so.2
However in NixOS, that file is somewhere else in the nix store (see: https://nixos.wiki/wiki/Packaging/Binaries#The_Dynamic_Loader). Removing the
-target
switch makes zig uses the host target for linking and puts the right path to the dynamic loader in the resulting binary. As we want to execute that binary file in this test, it makes sense to use the default target anyway.Note that this is relevant for the creation of the binary only. For the creation of the object file, it doesn't really matter. But I removed the
-target
switch as well there for consistency.Fix #4180