-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support cross compiling to BSD and CI it #8887
Conversation
No idea what is going on with |
Maybe |
f422c49
to
70da579
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-09-01-nix-team-meeting-minutes-84/32466/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/is-nixbsd-a-posibility/29612/33 |
🎉 All dependencies have been resolved ! |
Need to get tools from right package set. Could build clang tools but I don't want to wait :D.
The configure script will not tolerate it being missing.
Coppied from the main build; we really should deduplicate this more.
This is a reserved identifier on NetBSD --- it is replaced by a macro on that platform --- and so we cannot use it.
Our FreeBSD headers have `pthread_getattr_np`, but we get a link-time error that is missing. The good news is that there is another similar function which does exist, and the upstream project elsewhere does just the [fallback code] we need. As the fallback code indicates, the two functions are not identical however as the other one needs explicit initialization. NetBSD supports both in fact, and its [manpage] is therefore a good resource on what the differences are. [fallback code]: https://github.com/ivmai/bdwgc/blob/07a6d0ee8889bca5eaeadc13cabadc363725d216/os_dep.c#L1266-L1272 [manpage]: https://man.netbsd.org/pthread_attr_get_np.3
70da579
to
c189116
Compare
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.
A question. Otherwise lgtm.
++ lib.optional stdenv.cc.isClang pkgs.buildPackages.bear | ||
++ lib.optional | ||
(stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) | ||
pkgs.buildPackages.clang-tools |
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's the reason for this? buildPackages
isn't the weird package set.
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.
Oh that might actually be fine. It was just doing a really slow build and I did not want to wait. (Because Nixpkgs regressed and now has a target specific LLVM build for no good reasons because the way it depends on binutils rrather than libbfd for LTO.)
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'll do that in a follow-up PR,
This is broken and our resident nixbsd maintainers say it should probably just be temporarily removed till we switch to 24.05 instead of diagnosing it. Originally introduced in: NixOS/nix#8887 Fixes: https://git.lix.systems/lix-project/lix/issues/277 Change-Id: I1e7db8859620024a7b37dbd0cc1c5ec139b9e5cb
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-8887-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-8887-to-2.18-maintenance
git switch --create backport-8887-to-2.18-maintenance
git cherry-pick -x e44d2a6bbef113b3d8f162f75bd5c94e0101075f 28850ee90095e337bf47fbe03a0d937cb98784e2 564392b57bc44c407303e4eaf6138d61a8ea50b0 0db251e4ad07338375fd59134fb467e9ebc4176a 7f76d7f038fbb5cb7982cf9aa951b9730566e275 c18911602eb4260d59acf8c17f1c3b4c7fcf7cee |
Support cross compiling to BSD and CI it (cherry picked from commit 1f3fc08) Change-Id: I415e92952afc661cfb5ef91a76c0637678a04a19
Motivation
Fix #3280
Thanks to @alyssais effort, BSD cross compilation in Nixpkgs is now quite mature. Let's take advantage of this with Nix itself --- we've accepted patches to allow BSD builds before, but without CI bitrotting was quite likely. Now it won't bitrot, and people down download pre-built binaries.
Context
depends on #8569
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.