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

libcxx: fix build on linux musl #70244

Merged
merged 2 commits into from Nov 7, 2019
Merged

Conversation

@nmattia
Copy link
Contributor

nmattia commented Oct 2, 2019

Motivation for this change

Before this, libunwind, libcxxabi and libcxx failed to build on x86_64-linux-musl.

On current master with

for attr in libunwind libcxx libcxxabi; do for platform in linux; do for pkgs in pkgs pkgsStatic; do echo -n "$attr $platform $pkgs "; nix-build -A $pkgs.$attr --argstr system x86_64-$platform &> /dev/null && echo success || echo failure ; done; done; done | column -t

libunwind  linux  pkgs        success
libunwind  linux  pkgsStatic  failure
libcxx     linux  pkgs        success
libcxx     linux  pkgsStatic  failure
libcxxabi  linux  pkgs        success
libcxxabi  linux  pkgsStatic  failure

on this branch:

libunwind  linux  pkgs        success
libunwind  linux  pkgsStatic  success
libcxx     linux  pkgs        success
libcxx     linux  pkgsStatic  success
libcxxabi  linux  pkgs        success
libcxxabi  linux  pkgsStatic  success

I have not, I repeat not, built the pkgsStatic versions on darwin, although the pkgs versions do still work.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @basvandijk

@nmattia nmattia requested a review from matthewbauer as a code owner Oct 2, 2019
@nmattia nmattia changed the title Nm fix libcxx libcxx: fix build on linux musl Oct 2, 2019
@basvandijk

This comment has been minimized.

Copy link
Member

basvandijk commented Oct 2, 2019

@GrahamcOfBorg build libunwind libcxx libcxxabi

@basvandijk

This comment has been minimized.

Copy link
Member

basvandijk commented Oct 2, 2019

@GrahamcOfBorg build pkgsStatic.libunwind pkgsStatic.libcxx pkgsStatic.libcxxabi

@domenkozar

This comment has been minimized.

Copy link
Member

domenkozar commented Oct 2, 2019

This should go to staging as it's darwin stdenv rebuild. Good work :)

@nmattia

This comment has been minimized.

Copy link
Contributor Author

nmattia commented Oct 2, 2019

Yeah unfortunately due to https://github.com/NixOS/nixpkgs/pull/70244/files#diff-94997ad820e0a722e115eb7b6b93a404R17 I couldn't avoid the rebuild on non-static

@@ -9,6 +9,11 @@ stdenv.mkDerivation rec {
sha256 = "1y0l08k6ak1mqbfj6accf9s5686kljwgsl4vcqpxzk5n74wpm6a3";
};

# There's no "gcc_s" (shared gcc lib) on musl.

This comment has been minimized.

Copy link
@matthewbauer

matthewbauer Oct 2, 2019

Member

According to this, libunwind is broken on musl:

https://github.com/libunwind/libunwind#libc-requirements

We should probably switch to using LLVM's libunwind. I've added it for llvm/8/, but it may make sense to add it here as well:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/llvm/8/libunwind.nix

@nmattia

This comment has been minimized.

Copy link
Contributor Author

nmattia commented Oct 3, 2019

We can probably drop the first commit once #70321 lands

@nmattia nmattia force-pushed the nmattia:nm-fix-libcxx branch from ef90d6f to fadd37b Oct 4, 2019
@nmattia

This comment has been minimized.

Copy link
Contributor Author

nmattia commented Oct 4, 2019

Dropped the first commit since libunwind isn't needed anymore (#70321 ). Good to merge?

@dtzWill

This comment has been minimized.

Copy link
Contributor

dtzWill commented Oct 15, 2019

(do we have a musl team (@nixos/musl? no?)? Regardless, and no worries for new folks, but please cc me on musl issues :). I don't always have time, maybe less time than I'd like, but I would definitely fix something like this should it break again in the future! Sorry folks!)

@matthewbauer matthewbauer changed the base branch from master to staging Nov 7, 2019
@matthewbauer matthewbauer merged commit c100983 into NixOS:staging Nov 7, 2019
12 of 13 checks passed
12 of 13 checks passed
grahamcofborg-eval Cloning project
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@nmattia nmattia deleted the nmattia:nm-fix-libcxx branch Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.