Skip to content

Support for compilers and build tools in profiles #42059

@uri-canva

Description

@uri-canva

I'm planning to use nix as a package manager for my development toolchain, but not do the actual development in nix, is that a supported use case?

I've hit some issues and have been sending in PRs to resolve them, but looking into it more the issues I've been hitting might have been derivations just working as intended.

https://nixos.wiki/wiki/FAQ/I_installed_a_library_but_my_compiler_is_not_finding_it._Why%3F explains that library derivations in Nix only work when used in a nix environment, be it nix-shell or within nixpkgs.

Is the same true for all development derivations, for example compilers and build tools?

Examples:

  1. clang++ doesn't work outside of nix-shell on darwin, but it does on linux, and I'm not sure which of the two is correct (stdenv.cc: use libc++ as default c++ standard library on darwin #41589).
  2. wrapCC creates compiler wrappers to handle the way flags from dependencies are propagated in nixpkgs, but those wrappers are unnecessary when using the compilers from profiles.
  3. in the bazel derivation bin/bazel is a script that wraps bazel to make it use clang and java from nix, instead of resolving it from the caller's PATH, so that it can be used from within nixpkgs, but it results in a bazel that doesn't function correctly when installed.

If existing development derivations are meant to be only used in a nix environment, would it be ok to add new derivations for use outside of a nix environment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions