-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Add stdenv & CC support for Zig #318034
Add stdenv & CC support for Zig #318034
Conversation
7ddaa09
to
769cc80
Compare
e7af075
to
d667241
Compare
516e37e
to
9574baa
Compare
Close to this working, need to resolve a crash of produced binaries discovered that is being caused by the CC wrapper. |
acd42a1
to
ee2c990
Compare
We're now producing binaries correctly. |
9f04d18
to
a043f6a
Compare
Fixed eval and so this should work now properly. |
a043f6a
to
c1c6e49
Compare
666b899
to
3268c70
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/4278 |
|
@tomberek That's a strange failure, could you post the |
|
Not sure why yet, but the Zig stdenv seems to perform classical ./configure operations very slowly. |
Well @tomberek, I have your answer to that https://github.com/NixOS/nixpkgs/pull/318034/files#diff-145f2d578ddec955b3b15a9c780b174bceb9959f496e404185bb2dd63506af6dR16 We need to set the cache or it just doesn't build. Probably could make it a static path inside the build top. |
|
3268c70
to
0b2304d
Compare
Rebased to fix conflicts |
0b2304d
to
638068b
Compare
638068b
to
9f589ea
Compare
Still works, same success/fail as before. |
# https://github.com/mesonbuild/meson/pull/12293 | ||
(fetchpatch { | ||
name = "linker-support-zig-cc.patch"; | ||
url = "https://github.com/mesonbuild/meson/pull/12293/commits/2baae244c995794d9addfe6ed924dfa72f01be82.patch"; |
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.
Random commits in unmerged pull requests are not stable URLs. If you must use a non-upstream patch like this, it has to be vendored to ensure it can still be built in future.
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.
This also doesn't look like it's going to be upstream any time soon. I think this might have been a bit premature…
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, will pull this patch into it's own file in #331011
This exposed a bunch of eval failures like
|
Yeah, not surprised a new stdenv has this. Will be fixing this in #331011. |
|
Already been fixed in #331011. |
Description of changes
Introduces the ability to compile programs in nixpkgs using Zig with its own
zigStdenv
and CC adapter. This is kinda broken at the moment but it does not break anything critical so rebuilds should be 0 (except patching things like meson). However, the only problem seems to be an issue with Zig trying to link glibc right now. It is linking thelibc.so
linker script instead of the shared library.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.