| 19 Aug 2025 |
Artturin | I don't use binfmt | 15:22:51 |
Artturin | { crossSystem = lib.systems.examples.aarch64-multiplatform; } | 15:25:28 |
Artturin | or crossSystem = "aarch64-unknown-linux-gnu" or crossSystem.config = "aarch64-unknown-linux-gnu" | 15:27:05 |
Artturin | https://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix | 15:27:26 |
QuadRadical (Ping) | thank you | 17:00:59 |
QuadRadical (Ping) | yeah i got that after you explained what pkgs.path is | 17:01:08 |
| 20 Aug 2025 |
QuadRadical (Ping) | for binfmt though dont i have to set smth globally | 00:42:05 |
QuadRadical (Ping) | dont i need to set boot.binfmt.emulatedSystems? | 00:42:13 |
QuadRadical (Ping) | maybe it would be easiest to build everything on binfmt except for a few packages | 00:44:34 |
| jopejoe1 (4094@39c3) changed their display name from jopejoe1 (4094@GPN23) to jopejoe1. | 18:50:11 |
| 21 Aug 2025 |
| Theo Paris joined the room. | 22:10:34 |
emily | Artturin: does this targetPackages stuff from Rust seem as dodgy stage-wise to you as it does me
prefixForStdenv = stdenv: "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}";
ccPrefixForStdenv =
stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang" else "cc"}";
cxxPrefixForStdenv =
stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang++" else "c++"}";
setBuild = "--set=target.${stdenv.buildPlatform.rust.rustcTarget}";
setHost = "--set=target.${stdenv.hostPlatform.rust.rustcTarget}";
setTarget = "--set=target.${stdenv.targetPlatform.rust.rustcTarget}";
ccForBuild = ccPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
cxxForBuild = cxxPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
ccForHost = ccPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
cxxForHost = cxxPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
ccForTarget = ccPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
cxxForTarget = cxxPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
| 22:29:41 |
Artturin | In reply to @emilazy:matrix.org
Artturin: does this targetPackages stuff from Rust seem as dodgy stage-wise to you as it does me
prefixForStdenv = stdenv: "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}";
ccPrefixForStdenv =
stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang" else "cc"}";
cxxPrefixForStdenv =
stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang++" else "c++"}";
setBuild = "--set=target.${stdenv.buildPlatform.rust.rustcTarget}";
setHost = "--set=target.${stdenv.hostPlatform.rust.rustcTarget}";
setTarget = "--set=target.${stdenv.targetPlatform.rust.rustcTarget}";
ccForBuild = ccPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
cxxForBuild = cxxPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
ccForHost = ccPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
cxxForHost = cxxPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
ccForTarget = ccPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
cxxForTarget = cxxPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
I recall there being more of xPkgs.targetPackages in nixpkgs | 23:43:06 |
Artturin | * I recall there being more of xPkgs.targetPackages.stdenv in nixpkgs | 23:44:30 |
| 22 Aug 2025 |
| RichInOverdraft joined the room. | 00:43:13 |
emily | but... is it wrong? :) | 10:57:33 |
emily | it seems like it's accessing earlier bootstrap stages in some cases, maybe. | 10:57:50 |
dramforever | targetPackages.stdenv is okay i think | 10:59:21 |
dramforever | it's like the one package that's okay to get from targetPackages | 10:59:40 |
dramforever | as of whether the mapping to ccFor* tbh idfk | 10:59:58 |
dramforever | * as of whether the mapping to ccFor* is correct tbh idfk | 11:00:06 |
emily | honestly I guess it's more likely one of these things
++
optional
(stdenv.hostPlatform.isLinux && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD && useLLVM)
"--push-state --as-needed -L${llvmPackages.libcxx}/lib -lc++ -lc++abi -lLLVM-${lib.versions.major llvmPackages.llvm.version} --pop-state"
++ optional (stdenv.hostPlatform.isDarwin && !withBundledLLVM) "-lc++ -lc++abi"
++ optional stdenv.hostPlatform.isFreeBSD "-rpath ${llvmPackages.libunwind}/lib"
++ optional (useLLVM && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD) [
llvmPackages.libunwind
# Hack which is used upstream https://github.com/gentoo/gentoo/blob/master/dev-lang/rust/rust-1.78.0.ebuild#L284
(runCommandLocal "libunwind-libgcc" { } ''
mkdir -p $out/lib
ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so
ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so.1
'')
];
| 11:08:51 |
emily | since the hack that "fixes" it just involves overriding llvmPackages | 11:09:00 |
emily | so leaning more towards "llvmPackages wire-up is busted", as I've observed that myself | 11:09:14 |
| André Lima joined the room. | 15:07:26 |
| elikoga changed their profile picture. | 17:27:46 |
| 23 Aug 2025 |
André Lima | Any tips on cross-compiling a package out-of-tree with a compiler that's also built out-of-tree? I was looking into mkScopeWithSplicing', but I'm not sure how to use it outside of the Nixpkgs repository.
The concrete goal I'm trying to achieve is 1. compile a specific revision of LLVM that's used by Polygeist and 2. be able to use the clang compiler with the libc provided by that revision to cross-compile programs to another architecture. Any help is appreciated 🙏 | 22:37:19 |
| 24 Aug 2025 |
| RichInOverdraft changed their display name from Richman to rich. | 04:10:44 |
Artturin | With overlays | 12:22:57 |
Artturin | * With a overlay | 12:23:14 |