!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

228 Members
74 Servers

Load older messages


SenderMessageTime
11 Nov 2024
@emilazy:matrix.orgemily
In reply to @emilazy:matrix.org
do you just reference stdenv.hostPlatform.isDarwin in the ld-wrapper derivation and it means stdenv.targetPlatform.isDarwin when you put it in pkgsBuildTarget?
would this not work though? do you always have a build→target toolchain available by default?
23:20:01
@emilazy:matrix.orgemilyhow does it get set for Darwin build/host anyway?23:21:35
@emilazy:matrix.orgemily that stdenv thing only sets it for target 23:21:40
@reckenrode:matrix.orgRandy Eckenrode
preHook = preHook + lib.optionalString buildPlatform.isDarwin ''
  export NIX_DONT_SET_RPATH_FOR_BUILD=1
'' + lib.optionalString (hostPlatform.isDarwin || (!hostPlatform.isElf && !hostPlatform.isMacho)) ''
  export NIX_DONT_SET_RPATH=1
  export NIX_NO_SELF_RPATH=1
'' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
  export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
'' + lib.optionalString targetPlatform.isDarwin ''
  export NIX_DONT_SET_RPATH_FOR_TARGET=1
'';
23:22:58
@reckenrode:matrix.orgRandy Eckenrode

Just to make sure I understand, the expectation is that clang.cc == pkgsCross.x86_64-darwin.buildPackages.clang.cc == pkgsCross.gnu64.buildPackages.clang.cc?

23:23:39
@reckenrode:matrix.orgRandy EckenrodeSince clang is a multi-target cross-compiler by default.23:23:54
@reckenrode:matrix.orgRandy EckenrodeWas there an issue on GitHub? I thought I got pinged, but my notifications aren’t showing anything.23:24:33
@emilazy:matrix.orgemilythere's a discourse thread23:26:27
@emilazy:matrix.orgemily
In reply to @reckenrode:matrix.org

Just to make sure I understand, the expectation is that clang.cc == pkgsCross.x86_64-darwin.buildPackages.clang.cc == pkgsCross.gnu64.buildPackages.clang.cc?

I think this is the idea, yes
23:26:40
@reckenrode:matrix.orgRandy Eckenrode
In reply to @emilazy:matrix.org
I think this is the idea, yes

I tried reverting the NIX_DONT_SET_RPATH_FOR_TARGET change. It didn’t seem to make a difference.

23:27:03
@emilazy:matrix.orgemily
In reply to @reckenrode:matrix.org
preHook = preHook + lib.optionalString buildPlatform.isDarwin ''
  export NIX_DONT_SET_RPATH_FOR_BUILD=1
'' + lib.optionalString (hostPlatform.isDarwin || (!hostPlatform.isElf && !hostPlatform.isMacho)) ''
  export NIX_DONT_SET_RPATH=1
  export NIX_NO_SELF_RPATH=1
'' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
  export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
'' + lib.optionalString targetPlatform.isDarwin ''
  export NIX_DONT_SET_RPATH_FOR_TARGET=1
'';
honestly, just replacing all of that with NIX_DONT_SET_RPATH_aarch64_apple_darwin/NIX_DONT_SET_RPATH_x86_64_apple_darwin seems cool to me
23:27:14
@emilazy:matrix.orgemily
In reply to @reckenrode:matrix.org

I tried reverting the NIX_DONT_SET_RPATH_FOR_TARGET change. It didn’t seem to make a difference.

there's the nostdlibinc patch
23:27:24
@emilazy:matrix.orgemilytry removing it entirely23:27:32
@reckenrode:matrix.orgRandy Eckenrode
In reply to @emilazy:matrix.org
honestly, just replacing all of that with NIX_DONT_SET_RPATH_aarch64_apple_darwin/NIX_DONT_SET_RPATH_x86_64_apple_darwin seems cool to me
It’s exposing a cc-wrapper internal detail, which is also different on static Darwin builds.
23:27:38
@reckenrode:matrix.orgRandy Eckenrode
In reply to @emilazy:matrix.org
try removing it entirely
Doesn’t matter either.
23:28:47
@reckenrode:matrix.orgRandy Eckenrode
In reply to @emilazy:matrix.org
try removing it entirely
*
23:28:54
@reckenrode:matrix.orgRandy Eckenrode

Does every clang dependency have to be audited for targetPlatform stuff?

23:29:59
@reckenrode:matrix.orgRandy Eckenrode

Note that this includes my “Darwin as useLLVM” work.

23:30:30
@emilazy:matrix.orgemily well, ideally targetPlatform would be null so they would have no way of depending on it 23:30:58
@emilazy:matrix.orgemily I'm curious what nix-diff says though 23:31:09
@reckenrode:matrix.orgRandy Eckenrode

Output of nix-diff $(nix-instantiate . -A clang.cc) $(nix-instantiate . -A pkgsCross.gnu64.buildPackages.clang.cc) with the NIX_DONT_SET_RPATH_FOR_TARGET change reverted and the -nostdlibinc patches dropped.

https://gist.github.com/reckenrode/be122136283d8ed5a05d52f2f57d8809

23:41:53
@emilazy:matrix.orgemilythe bootstrap stuff seems solvable23:43:15
@emilazy:matrix.orgemily if we used the earlier stage compilers to bootstrap pkgsCross 23:43:26
@emilazy:matrix.orgemily I think comparing two pkgsCrosses would be more enlightening though 23:43:39
@emilazy:matrix.orgemilysince that's still significantly more sharing23:43:42
@emilazy:matrix.orgemilyand would eliminate that difference23:43:47
@emilazy:matrix.orgemily like gnu64 and aarch64-multiplatform instead 23:43:56
@emilazy:matrix.orgemily (or I guess aarch64-multiplatform and however x86_64-darwin is spelled, to capture OS differences) 23:45:44
12 Nov 2024
@reckenrode:matrix.orgRandy EckenrodeI can check in a bit.00:55:17
@sternenseemann:systemli.orgsterni emily: mainly the LLVM LLVMGold.so thing depending on GNU binutils or not, could be interesting to remove that somehow 12:18:23

Show newer messages


Back to Room ListRoom Version: 9