-
-
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
knightos-scas: fix build if clang #305821
Conversation
Result of 2 packages built:
|
Marked as draft because it should be better addressed by including the right header files. |
@@ -16423,7 +16423,9 @@ with pkgs; | |||
|
|||
knightos-mktiupgrade = callPackage ../development/tools/knightos/mktiupgrade { }; | |||
|
|||
knightos-scas = callPackage ../development/tools/knightos/scas { }; | |||
knightos-scas = callPackage ../development/tools/knightos/scas { | |||
stdenv = if stdenv.cc.isClang then llvmPackages_15.stdenv else stdenv; |
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.
Why llvm15 ? strcasecmp
should be related to either standard library or darwin sdk. Maybe their is a change in llvm16 in header search path
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.
Pinning LLVM versions adds technical debt that will have to be paid back later. It would be better to fix or mitigate the issue, so the package can continue building with newer versions of clang.
Maybe their is a change in llvm16 in header search path
Clang started rejecting implicit function declarations as errors. This was probably always a warning that was ignored, but now it’s an error.
Part of the problem was jumping to clang 16 from 11, so we had to deal with all the breaking changes at once, but clang 16 was also a very breaking release in general.
Going forward, Darwin will be updating annually after the xx.05 release of NixOS, so hopefully it will be easier to deal with breakage incrementally. I plan to open the PR for the clang 18.1 update as soon as the release is out.
This would just delay the inevitable for a while. It's the upstream project that's broken here, but we have two options:
Since this applies to all systems in practice, it may be best to raise a PR upstream adding that header and then include it as a patch in nixpkgs, until a new version is released. |
I just opened a couple of PRs that fix similar issues to this one. #305874 #305875 #305877. The problem is this is probably quite widespread among older packages. So do we want to make |
I think the patch based solution is better:
I feel that changing standard C is more trouble than adding header: some projects can use modern features but omitted an include. exemple with a commit not yet included but github generate the patch with username=NixOs (not your): https://github.com/NixOS/nixpkgs/commit/f3b1c9618441411ccab8c0e8448bc38b41d5d750.patch if this patch is accepted this commit will be available in the real nixpkges tree and keep his url valid |
The approach I generally followed with #234710 was to fix the broken code when possible. If there is an active upstream, I checked for a solution there first. If there was but no fix, I submitted a patch upstream and referenced that in my PRs to nixpkgs. Otherwise, I vendored the patches. I only fell back to suppressing errors with compile flags as a last resort. |
Ok, I will update my PRs with followups that use patches. |
Description of changes
Fix #305818
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.