!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

187 Members
59 Servers

Load older messages


SenderMessageTime
27 Jun 2025
@emilazy:matrix.orgemilybut for anything early in bootstrap you can just build early bootstrap stuff when iterating since ideally it gets "washed out" past a certain point anyway20:02:12
@sielicki:matrix.orgsielicki with the current stdenv, my main complaint is that it's imprecise with respect to the languages supported. ie: there's no stdenv.cxx/stdenv.fc/stdenv.objcc/stdenv.objcxx/stdenv.nvcc/stdenv.hipcc 20:04:36
@sielicki:matrix.orgsielickithere's really no good reason that a C compiler implies a C++ compiler or vice versa. I'm looking at this in the context of generating cmake toolchains from stdenvs20:05:14
@emilazy:matrix.orgemily in an ideal world stdenvNoCC would be the default and C toolchains would be added explicitly as dependencies 20:13:49
@emilazy:matrix.orgemilyI doubt we'd realistically decouple C and C++ though20:14:00
@sielicki:matrix.orgsielicki

one of the biggest rough spots for me is in trying to setup environments between clang/gcc and libc++ vs libstdc++:

nix-repl> pkgs.stdenv.cc.libcxx # on darwin
«derivation /nix/store/clhcsg5l0lwabkniwqfgfjcfhydp0xxs-libcxx-19.1.7.drv»

nix-repl> pkgs.pkgsLinux.stdenv.cc.libcxx
null

both of these stdenvs are capable of building C++ programs

20:25:44
@emilazy:matrix.orgemily libcxx is the LLVM C++ library 20:37:24
@emilazy:matrix.orgemily on Linux we use libstdc++ by default 20:37:28
@emilazy:matrix.orgemilywell, I guess you know that :)20:37:35
@emilazy:matrix.orgemily but I'm not sure why you're looking at stdenv.cc.libcxx to begin with, what are you trying to accomplish? 20:37:44
@sielicki:matrix.orgsielickiI dunno, that's a good question. I guess my main idea here is to avoid cc-wrapper as much as possible, for build systems where it is possible. In the case of autotools, I don't see a way around cc-wrapper. But for meson or cmake, I think passing the unwrapped compiler, alongside a nix-generated toolchain, can help out in some hand-wavey way. https://github.com/sielicki/nix-cmake/blob/main/pkgs/cmake-toolchain-hook/cmake-toolchain.nix https://github.com/sielicki/nix-cmake/blob/main/pkgs/cmake-dependency-hook/cmakeBuildHook.cmake this is very rough but it's a start. 20:43:57
@emilazy:matrix.orgemilywe (or at least I) would generally like to move in the direction of fewer wrappers, but it's hard (will require upstream compiler work)20:45:12
@emilazy:matrix.orgemilysince exactly what the flags inject depends on what flags are being passed20:45:18
@emilazy:matrix.orgemilyI think that is generally hard to express in the toolchain information files build systems support20:45:32
@sielicki:matrix.orgsielickihmm, I'm not sure I see why -- what's something we can accomplish with cc-wrapper that we can't do otherwise?20:47:00
@emilazy:matrix.orgemily e.g., we look at -nostdlib/-nostdinc when deciding what flags to inject 20:55:05
@emilazy:matrix.orgemily which is import for things like getting libc to work without breaking freestanding builds (including libc itself) 20:55:58
@emilazy:matrix.orgemilyperhaps not a common use-case for CMake, but pretty critical for our compilers to work :)20:56:16
@emilazy:matrix.orgemilythere is also stuff about cross-compilation role variable demangling but theoretically a sufficiently clueful build system could handle that sort of thing (otoh CMake is pretty bad at cross in practice)20:57:16
@sielicki:matrix.orgsielickiI'm probably missing context on the specifics, but I'd think those would be different stdenvs (and different triples) -- freestanding corresponding to something like aarch64-none-elf and used to bootstrap something like aarch64-unknown-linux-eabi, right?21:04:29
@emilazy:matrix.orgemilynot quite – there are reasons to forego standard headers and libraries even on a hosted platform21:05:39
@emilazy:matrix.orgemily but the obvious example is that glibc for aarch64-unknown-linux-gnu is of course built without glibc :) 21:05:50
@emilazy:matrix.orgemily(but is definitely not building for bare metal)21:06:03
@emilazy:matrix.orgemily pkgs/build-support/bintools-wrapper/ld-wrapper.sh has an example of gnarly non-trivial logic we have in wrappers around the rpath stuff 21:08:27
@rosscomputerguy:matrix.orgTristan Ross
In reply to @sielicki:matrix.org
with the current stdenv, my main complaint is that it's imprecise with respect to the languages supported. ie: there's no stdenv.cxx/stdenv.fc/stdenv.objcc/stdenv.objcxx/stdenv.nvcc/stdenv.hipcc
This is something that's in the pipeline of changes we're working on. Hopefully soon we'll have some movement.
21:23:25
@emilazy:matrix.orgemilyit… is? :)21:27:44
@emilazy:matrix.orgemily I'm not aware of any current work on that front (for C-family languages I'm not sure it's a good idea to split up, though stdenvNoCC by default would obviously be great but is a hugely breaking change for external users) 21:28:07
@rosscomputerguy:matrix.orgTristan Ross
In reply to @emilazy:matrix.org
I'm not aware of any current work on that front (for C-family languages I'm not sure it's a good idea to split up, though stdenvNoCC by default would obviously be great but is a hugely breaking change for external users)
We've already got split GCC on the way and so far, it's doing good.
21:35:20
@rosscomputerguy:matrix.orgTristan RossI was thinking of having derivations which mirror the toolchain attributes21:35:46
@rosscomputerguy:matrix.orgTristan Ross So cc is your C/C++ compiler while cxxlib would be your C++ std implementation. 21:36:19

Show newer messages


Back to Room ListRoom Version: 9