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

clang 11 with libc++ does not work #120727

Open
ivan-tkatchev opened this issue Apr 26, 2021 · 3 comments
Open

clang 11 with libc++ does not work #120727

ivan-tkatchev opened this issue Apr 26, 2021 · 3 comments
Labels
0.kind: bug 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related

Comments

@ivan-tkatchev
Copy link
Contributor

ivan-tkatchev commented Apr 26, 2021

Describe the bug
Right now it is impossible to use Clang 11 with libc++

To Reproduce
nix-shell for this derivation

with import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/cd63096.tar.gz") {};
let
  s = llvmPackages_11.libcxxStdenv;
in
s.mkDerivation {
  name = "clang11-nix-shell";
  buildInputs = [ ];
}

results in these errors:

these derivations will be built:
  /nix/store/ydwjfb2pb4pajw8xqknwg7v8aw2isi3g-libc++abi-11.0.0rc5.drv
  /nix/store/qb70m98pnrpf3bjk0xp3bsq627mjs0hr-libc++-11.0.0rc5.drv
  /nix/store/2pl2ras2k48dna2ca80qz09ihbd9g3cq-clang-wrapper-11.0.0rc5.drv
  /nix/store/wjwv41b1akmrwc6ik5n1j4a0why59820-stdenv-linux.drv
building '/nix/store/ydwjfb2pb4pajw8xqknwg7v8aw2isi3g-libc++abi-11.0.0rc5.drv'...
unpacking sources
unpacking source archive /nix/store/4yqw03wyl2z7l9a0idjy8xc8yjh2kq8a-libcxxabi-11.0.0rc5.src.tar.xz
source root is libcxxabi-11.0.0rc5.src
unpacking source archive /nix/store/lqp6sfbf98d3a4bwy65lkb5hg8c86isl-libcxx-11.0.0rc5.src.tar.xz
unpacking source archive /nix/store/a7s8y72d4vrcc0sqv1nci29da4rzxkvs-llvm-11.0.0rc5.src.tar.xz
setting SOURCE_DATE_EPOCH to timestamp 1601465323 of file libcxxabi-11.0.0rc5.src/www/spec.html
patching sources
applying patch /nix/store/1ljrw6vjm9inhbriabfpqb0xjxmvd0rf-libcxxabi-no-threads.patch
patching file CMakeLists.txt
Hunk #1 succeeded at 354 (offset -8 lines).
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/share/doc/libcxxabi -DCMAKE_INSTALL_INFODIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/include -DCMAKE_INSTALL_SBINDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/strip -DCMAKE_RANLIB=/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ranlib -DCMAKE_AR=/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/yd2q4kyrvpf9r6r86iaan1f5k6pawji3-libc++abi-11.0.0rc5  -DLLVM_PATH=/build/llvm-11.0.0rc5.src -DLIBCXXABI_LIBCXX_PATH=/build/libcxx-11.0.0rc5.src 
CMake Error at CMakeLists.txt:4 (message):
  libc++abi now requires being built in a monorepo layout with libcxx
  available


-- Configuring incomplete, errors occurred!
builder for '/nix/store/ydwjfb2pb4pajw8xqknwg7v8aw2isi3g-libc++abi-11.0.0rc5.drv' failed with exit code 1
cannot build derivation '/nix/store/2pl2ras2k48dna2ca80qz09ihbd9g3cq-clang-wrapper-11.0.0rc5.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/wjwv41b1akmrwc6ik5n1j4a0why59820-stdenv-linux.drv': 1 dependencies couldn't be built
error: build of '/nix/store/wjwv41b1akmrwc6ik5n1j4a0why59820-stdenv-linux.drv' failed

(llvmPackages_10 instead of 11 produces the desired result.)

Expected behavior
libc++ with newer versions of clang should work.

Notify maintainers
@vlstill

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.11.11-arch1-1, Arch Linux, noversion`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - channels(itkachev): `"nixpkgs-21.05pre284073.abb55ca1315"`
 - nixpkgs: `/home/itkachev/.nix-defexpr/channels/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@dtzWill
Copy link
Member

dtzWill commented Apr 26, 2021

I might be missing something, but the mentioned revision (abb55ca) has LLVM 11.1 not 11.0-rc5; and testing the libcxxStdenv for LLVM 11 on that revision seems to work here. (and unfortunately means I can't reproduce your failure :().

So seems to be fixed on the channel you already have, as well as on latest master, FWIW.
Not saying there isn't a bug (seems worth sorting out where you're getting -rc5 from, not sure how to best go about doing so), but unsure where it might be :).

Hope this helps!

@ivan-tkatchev
Copy link
Contributor Author

I am terribly sorry, the first line of my markdown code block was swallowed. I updated the derivation to show the tar.gz I am loading nixpkgs from. I am not using a channel.

The .tar.gz should be the nixpkgs that corresponds with the 20.09 release.

@patka-123
Copy link
Contributor

Hello @ivan-tkatchev 👋

Are you still experiencing this issue? I tried to reproduce it with nix-shell -p llvmPackages_11.libcxxStdenv and then seems to build fine for me. If you think the problem has been solved by now, would you mind closing this issue?

(I'm going through older issues to see what can be triaged. If you still experience this issue then don't mind me).

@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related
Projects
None yet
Development

No branches or pull requests

4 participants