!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

571 Members
125 Servers

Load older messages


SenderMessageTime
4 Jul 2025
@dramforever:matrix.orgdramforeveri'd say try including this 951538d as a patch02:56:59
@dramforever:matrix.orgdramforeveror maybe overriding the version and source like https://github.com/NixOS/nixpkgs/pull/41559402:58:32
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:06:41
@dramforever:matrix.orgdramforeveroh okay03:07:39
@dramforever:matrix.orgdramforeveryou've come in the deep end, i see03:07:49
@dramforever:matrix.orgdramforeverhow are you building the thing to begin with?03:07:59
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:11:21
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:11:22
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:11:42
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:12:32
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:13:15
@dramforever:matrix.orgdramforeverare you sure you're new to nix :P03:15:17
@dramforever:matrix.orgdramforever

but anyway i'd say bring in an extra overlay to add a patch

        overlays = [
          (import rust-overlay)
          (final: prev: {
            mimalloc =
              if final.stdenv.hostPlatform.isMusl
              then
                prev.mimalloc.overrideAttrs (old: {
                  patches = (old.patches or []) + [
                    (final.fetchpatch {
                      url = "https://github.com/microsoft/mimalloc/commit/951538d469f72532e43a2437d556a73518f5dde4.patch";
                      hash = ""; # TOFU, update with hash
                    })
                  ];
                })
              else
                prev.mimalloc;
          })
        ];
03:15:32
@dramforever:matrix.orgdramforevernote that i haven't tested this, just typed it out03:15:43
@dramforever:matrix.orgdramforever and the reason it's compiling mimalloc is just something depends on mimalloc 03:16:04
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:16:30
@freexploit:trafkin.com@freexploit:trafkin.comRedacted or Malformed Event03:17:48
@dramforever:matrix.orgdramforever final.lib.fakeHash 03:21:20
@dramforever:matrix.orgdramforeveror just leave it empty??03:21:35
@dramforever:matrix.orgdramforever* or just leave it empty?03:21:36
@thewholeworldisburning123:rougebordeaux.xyzmissbehaves 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 ? 09:53:00
@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

Show newer messages


Back to Room ListRoom Version: 6