!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

570 Members
124 Servers

Load older messages


SenderMessageTime
4 Jul 2025
@thewholeworldisburning123:rougebordeaux.xyzmissbehaves I'm new to Nix, and I'm trying to target a specific RISC-V toolchain for cross compilation, which is using arch rv32i and abi ilp32. I was using riscv32-none-elf but sadly it has differences and does not give me the format of binary i need. How do i build and configure the riscv toolchainfor my specific arch/abi ? 10:03:04
@qyliss:fairydust.spaceAlyssa Ross You can set gcc.arch and some other options in your platform attrset. 10:12:45
@qyliss:fairydust.spaceAlyssa RossHave a look at machineFlags in pkgs/build-support/cc-wrapper/default.nix for what you can set10:14:32
@dramforever:matrix.orgdramforever just demo'd nix to a friend, and i want to thank the entirety of #cross-compiling:nixos.org for maintaining my go to demo for nix and nixpkgs so it mostly works: cross compiling something in a single command 12:11:01
@dramforever:matrix.orgdramforever* just demo'd nix to a coworker, and i want to thank the entirety of #cross-compiling:nixos.org for maintaining my go to demo for nix and nixpkgs so it mostly works: cross compiling something in a single command12:11:13
@alexfmpe:matrix.orgalexfmpedepending on what the demo is, might want to add it to one of the release-foo.nix jobs to watch for regressions though I'm not sure how to actually lookup or be notified of failures there12:32:19
@dramforever:matrix.orgdramforeverit's a bit of a weird thing since if i add it to release-*, i can't demo it anymore14:11:06
@dramforever:matrix.orgdramforeverit'll just download from cache.nixos.org and be way less impressive14:11:21
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all) you could add --rebuild in your demo 14:13:48
@dramforever:matrix.orgdramforever😅14:36:44
@dramforever:matrix.orgdramforeveryeah probably14:43:34
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event15:09:11
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event15:09:26
@emilazy:matrix.orgemilyjemalloc is deprecated upstream now anyway, so it's the better choice15:33:59
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event15:34:55
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event15:35:07
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event15:35:12
@winston:milli.ng@winston:milli.ng left the room.15:40:53
@alexfmpe:matrix.orgalexfmpe seems there's also a --offline 15:46:57
@alexfmpe:matrix.orgalexfmpehttps://nix.dev/manual/nix/2.28/command-ref/new-cli/nix3-build.html?highlight=--rebuild#opt-offline15:46:59
@sananatheskenana:matrix.orglzcuntHey there17:31:52
@sananatheskenana:matrix.orglzcuntI've asked this question here before but now after rebasing it occurs again17:32:35
@sananatheskenana:matrix.orglzcunti am overriding python3Minimal to add zlib back, then overriding meson to use my python3Minimal17:33:12
@sananatheskenana:matrix.orglzcuntthe first part works but the second part doesn't seem to work (it seems to use regular python3Minimal instead)17:33:38
@sananatheskenana:matrix.orglzcunti don't really understand splicing, is this something to do with that and what can I do about it?17:33:51
@sananatheskenana:matrix.orglzcuntmeson does use python3.pkgs which I've heard is bad for cross but switching it to python3Packages doesn't help17:34:19
@sananatheskenana:matrix.orglzcunt

the previous solution was this abomination:

(buildPackages.meson.override { python3 = (buildPackages.__splicedPackages.python3Minimal); }) 
17:35:20
@sananatheskenana:matrix.orglzcunt

this is basically what I'm trying to do after rebasing to add zlib back in, but what I explained happens

(buildPackages.meson.override { python3 = (buildPackages.__splicedPackages.python3Minimal.override { zlib = buildPackages.zlib; allowedReferenceNames = []; }); })
17:36:19
@artturin:matrix.orgArtturin overriding doesn't preserve splicing so the __splicedPackages there does nothing 18:13:27
@artturin:matrix.orgArtturinWhat commis?18:16:39

Show newer messages


Back to Room ListRoom Version: 6