Skip to content
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

crystal: fix build with newer versions of clang #262659

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

reckenrode
Copy link
Contributor

Description of changes

Crystal requires linking libc++abi when building with newer versions of clang. See #166205.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 11-100 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 22, 2023
@peterhoeg
Copy link
Member

Are you able to test if there is any issues as a consequence of the llvm build on nixos too?

Crystal requires linking libc++abi when building with newer versions of
clang. See NixOS#166205.
@reckenrode
Copy link
Contributor Author

Are you able to test if there is any issues as a consequence of the llvm build on nixos too?

It shouldn’t affect standard Linux. I reworked the patch to check for clang and libc++, so it should work with pkgsLLVM, but cpio failed to build when I tried it (with LLVM 16).

@reckenrode
Copy link
Contributor Author

reckenrode commented Oct 27, 2023

This is failing on staging-next: https://hydra.nixos.org/build/239425775. #263535

Copy link
Contributor

@toonn toonn left a comment

Choose a reason for hiding this comment

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

LGTM

When rebased on staging-next the commit indeed fixes the crystal build.

On master the commit also builds, but, when editing the crystal derivation to use llvmPackages_16.stdenv (because crystal is not overridable) a segmentation fault occurs when running the built crystal compiler (this happens during the build). On master without the commit, but, changing the derivation to use LLVM 16 stdenv the segmentation fault does not happen and instead the same error as on staging-next happens.

Since staging-next will soon be merged into master and building crystal with a different stdenv is not straightforward anyway I'm going ahead with merging this.

@toonn toonn merged commit 754ada3 into NixOS:master Nov 5, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 11-100 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants