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

cc-wrapper: add libcxx for libcxxClang #54624

Merged
merged 1 commit into from
Jan 27, 2019
Merged

Conversation

matthewbauer
Copy link
Member

clang needs to find headers + libraries for compiling with libc++. We
need to add a libcxx argument to cc-wrapper. This means you do not
have to pass in c++ headers directly.

This resolves the last case remaining of #30670. Darwin clang++ now
works properly.

Fixes #30670

@matthewbauer matthewbauer force-pushed the libcxx branch 2 times, most recently from 4eebb31 to ce17f99 Compare January 27, 2019 01:58
clang needs to find headers + libraries for compiling with libc++. We
need to add a libcxx argument to cc-wrapper. This means you do not
have to pass in c++ headers directly.

This resolves the last case remaining of NixOS#30670. Darwin clang++ now
works properly.

Fixes NixOS#30670
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-darwin: 501+ 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 27, 2019
@matthewbauer matthewbauer changed the base branch from master to staging January 27, 2019 04:02
@GrahamcOfBorg GrahamcOfBorg added 6.topic: golang 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: rust 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 2.status: merge conflict This PR has merge conflicts with the target branch labels Jan 27, 2019
@matthewbauer matthewbauer changed the base branch from staging to master January 27, 2019 05:02
@matthewbauer matthewbauer changed the base branch from master to staging January 27, 2019 05:03
@GrahamcOfBorg GrahamcOfBorg removed 6.topic: golang 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: rust 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 2.status: merge conflict This PR has merge conflicts with the target branch labels Jan 27, 2019
@matthewbauer matthewbauer merged commit bb3683d into NixOS:staging Jan 27, 2019
@dtzWill
Copy link
Member

dtzWill commented Jan 27, 2019

Is this Darwin-only?

We previously had tests for this--were they failing? They seem to pass for me in my tree, FWIW.

I use libcxxStdenv for various things (including my system's nix) so I'm not sure what this is supposed to fix if it's not Darwin-only.

(regardless, is there a particular usage/scenario fixed by this? And should that be a test to ensure this works in the future?)

@matthewbauer
Copy link
Member Author

This makes clang++ work outside of a Nix derivation... It's a kind of specific use case but was often an issue. We provide it for g++, so we might as well make it work with clang.

@matthewbauer matthewbauer deleted the libcxx branch February 22, 2019 04:17
@aakropotkin
Copy link
Contributor

aakropotkin commented Jul 6, 2020

Is this Darwin-only?

We previously had tests for this--were they failing? They seem to pass for me in my tree, FWIW.

I use libcxxStdenv for various things (including my system's nix) so I'm not sure what this is supposed to fix if it's not Darwin-only.

(regardless, is there a particular usage/scenario fixed by this? And should that be a test to ensure this works in the future?)

I completely agree, why does this not work on NixOS systems as well?
I am pulling my hair out just trying to hack around on a clang-c example.

I love NixOS but it's times like this that I get really frustrated with it...

I'm not always in the mood to write up a whole shell.nix for a little throwaway example; nix-shell -p clang or nix-shell -p llvmPackages.libclang should "work out the box".

JFC I'm not criticizing the author, I'm asking why this behavior is only for Darwin?

@Ericson2314
Copy link
Member

Ericson2314 commented Jul 6, 2020

It might be better since f3f7612

@Mic92
Copy link
Member

Mic92 commented Jul 6, 2020

Is this Darwin-only?
We previously had tests for this--were they failing? They seem to pass for me in my tree, FWIW.
I use libcxxStdenv for various things (including my system's nix) so I'm not sure what this is supposed to fix if it's not Darwin-only.
(regardless, is there a particular usage/scenario fixed by this? And should that be a test to ensure this works in the future?)

I completely agree, why does this not work on NixOS systems as well?
I am pulling my hair out just trying to hack around on a clang-c example.

I love NixOS but it's times like this that I get really frustrated with it...

I'm not always in the mood to write up a whole shell.nix for a little throwaway example; nix-shell -p clang or nix-shell -p llvmPackages.libclang should "work out the box".

JFC I'm not criticizing the author, I'm asking why this behavior is only for Darwin?

nix-shell -p clang would be nice to work until this happens you may find the following shell functions useful to improve your workflow: https://github.com/direnv/direnv/wiki/Nix#shell-function-to-quickly-setup-nix--direnv-in-a-new-project

@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
6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 501+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 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.

7 participants