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

libcxxabi: use cmake as native build input #41900

Merged
merged 1 commit into from Jun 13, 2018

Conversation

matthewbauer
Copy link
Member

Splicing is broken here in libcxxabi:

error: while evaluating the attribute 'depsBuildTarget' of the derivation 'aarch64-apple-ios-ghc-8.2.2' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'buildInputs' of the derivation 'llvm-3.9.1' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'buildInputs' of the derivation 'libc++abi-3.9.1-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'buildInputs' of the derivation 'cmake-3.11.2-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'buildInputs' of the derivation 'libuv-1.20.2-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'installPhase' of the derivation 'apple-framework-ApplicationServices-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'buildInputs' of the derivation 'MacOS_SDK-10.10-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'C_INCLUDE_PATH' of the derivation 'python-2.7.15-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'C_INCLUDE_PATH' at /Users/mbauer/nixpkgs/reunification/pkgs/development/interpreters/python/cpython/2.7/default.nix:163:5:
while evaluating 'makeSearchPathOutput' at /Users/mbauer/nixpkgs/reunification/lib/strings.nix:94:42, called from /Users/mbauer/nixpkgs/reunification/pkgs/development/interpreters/python/cpython/2.7/default.nix:163:22:
while evaluating 'makeSearchPath' at /Users/mbauer/nixpkgs/reunification/lib/strings.nix:84:28, called from /Users/mbauer/nixpkgs/reunification/lib/strings.nix:94:48:
while evaluating anonymous function at /Users/mbauer/nixpkgs/reunification/lib/strings.nix:85:32, called from undefined position:
while evaluating the attribute 'buildInputs' of the derivation 'configd-osx-10.8.5-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'installPhase' of the derivation 'IOKit-osx-10.11.6-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
while evaluating the attribute 'buildInputs' of the derivation 'xnu-osx-10.11.6-aarch64-apple-ios' at /Users/mbauer/nixpkgs/reunification/pkgs/stdenv/generic/make-derivation.nix:170:11:
infinite recursion encountered, at undefined position

Need to specify cmake correctly for things to work.

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/bvrz6gfvmgb620knx2d9nr8kvz4l21i7-llvm-5.0.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/pdxfn617j4frnlbz13jv2y85s2ppgnb1-llvm-5.0.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: llvm

Partial log (click to expand)

these paths will be fetched (34.41 MiB download, 219.39 MiB unpacked):
  /nix/store/xsc3rsqxrapyzicp3a19px1skwj3z4qk-llvm-5.0.2-lib
  /nix/store/zvv8vkmb0wp0499hk50n4nx6qb1gmwli-llvm-5.0.2
copying path '/nix/store/xsc3rsqxrapyzicp3a19px1skwj3z4qk-llvm-5.0.2-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/zvv8vkmb0wp0499hk50n4nx6qb1gmwli-llvm-5.0.2' from 'https://cache.nixos.org'...
/nix/store/zvv8vkmb0wp0499hk50n4nx6qb1gmwli-llvm-5.0.2

@@ -54,7 +55,7 @@ let

libcxx = callPackage ./libc++ {};

libcxxabi = callPackage ./libc++abi.nix {};
libcxxabi = callPackage ./libc++abi.nix { cmake = buildPackages.cmake; };
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to do this for all versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually it wouldn't hurt. I think this is the only place where it's used in cross bootstrapping though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I think it should be done anywhere that callPackage is being overriden like this.

/cc @Ericson2314

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/zvv8vkmb0wp0499hk50n4nx6qb1gmwli-llvm-5.0.2

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/bvrz6gfvmgb620knx2d9nr8kvz4l21i7-llvm-5.0.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/pdxfn617j4frnlbz13jv2y85s2ppgnb1-llvm-5.0.2

@matthewbauer
Copy link
Member Author

Actually this might be introducing its own issue:

builder for '/nix/store/rhvp99aryldqa1adi14hm09iz9wqpg60-libc++abi-3.9.1-aarch64-apple-ios.drv' failed with exit code 127; last 10 log lines:
  source root is libcxxabi-3.9.1.src
  unpacking source archive /nix/store/0ry8hihgwjdnifnfpkyk8vfdcndvig8m-libcxx-3.9.1.src.tar.xz
  unpacking source archive /nix/store/wbprv4amvhnp8alw8fhx7hpgmnwxa3br-llvm-3.9.1.src.tar.xz
  setting SOURCE_DATE_EPOCH to timestamp 1471277406 of file libcxxabi-3.9.1.src/test/test_demangle.pass.cpp
  patching sources
  updateAutotoolsGnuConfigScriptsPhase
  configuring
  fixing cmake files...
  cmake flags: -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/1r4881l4sga4hjzlhsbwv8s9ay4jaapn-libc++abi-3.9.1-aarch64-apple-ios/include -DCMAKE_INSTALL_LIBDIR=/nix/store/1r4881l4sga4hjzlhsbwv8s9ay4jaapn-libc++abi-3.9.1-aarch64-apple-ios/lib -DCMAKE_INSTALL_NAME_DIR=/nix/store/1r4881l4sga4hjzlhsbwv8s9ay4jaapn-libc++abi-3.9.1-aarch64-apple-ios/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=last -DCMAKE_STRIP=/nix/store/a1w8w04kr8b1glznwqyf4najcqz61pqa-aarch64-apple-ios-cctools-binutils-darwin/bin/aarch64-apple-ios-strip -DCMAKE_RANLIB=/nix/store/a1w8w04kr8b1glznwqyf4najcqz61pqa-aarch64-apple-ios-cctools-binutils-darwin/bin/aarch64-apple-ios-ranlib -DCMAKE_AR=/nix/store/a1w8w04kr8b1glznwqyf4najcqz61pqa-aarch64-apple-ios-cctools-binutils-darwin/bin/aarch64-apple-ios-ar -DCMAKE_C_COMPILER=aarch64-apple-ios-clang -DCMAKE_CXX_COMPILER=aarch64-apple-ios-clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/1r4881l4sga4hjzlhsbwv8s9ay4jaapn-libc++abi-3.9.1-aarch64-apple-ios -DLLVM_PATH=/private/tmp/nix-build-libc++abi-3.9.1-aarch64-apple-ios.drv-0/llvm-3.9.1.src -DLIBCXXABI_LIBCXX_INCLUDES=/private/tmp/nix-build-libc++abi-3.9.1-aarch64-apple-ios.drv-0/libcxx-3.9.1.src/include 
  /nix/store/z745hk4k2dzbv6dp2ydfpx7s4r6560cj-cmake-3.11.2/nix-support/setup-hook: line 79: cmake: command not found

I can't figure out why cmake can't be found. Is the buildPackages affecting it?

@matthewbauer
Copy link
Member Author

Actually I was able to just use nativeBuildInputs for cmake. @Ericson2314 does this look okay to you? I'll let you decide to merge it.

@matthewbauer matthewbauer changed the title llvm: use cmake from buildPackages libcxxabi: use cmake as native build input Jun 13, 2018
@@ -5,7 +5,7 @@ stdenv.mkDerivation {

src = fetch "libcxxabi" "1qi9q06zanqm8awzq83810avmvi52air6gr9zfip8mbg5viqn3cj";

buildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please leave libunwind in the buildInputs.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@orivej
Copy link
Contributor

orivej commented Jun 13, 2018

If it works now feel free to merge: it looks correct.

@matthewbauer matthewbauer merged commit dbfab81 into NixOS:master Jun 13, 2018
@matthewbauer
Copy link
Member Author

Ok awesome! It may need to also go in a few other places in LLVM though.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/pdxfn617j4frnlbz13jv2y85s2ppgnb1-llvm-5.0.2

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/bvrz6gfvmgb620knx2d9nr8kvz4l21i7-llvm-5.0.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: llvm

Partial log (click to expand)

/nix/store/zvv8vkmb0wp0499hk50n4nx6qb1gmwli-llvm-5.0.2

@Ericson2314 Ericson2314 deleted the fix-darwin-cross branch June 13, 2018 19:18
@Ericson2314
Copy link
Member

Yeah this looks great. Lets do it in for all other versions too. (Can do staging-requring ones after cause nice to get stuff to master.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants