!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

582 Members
127 Servers

Load older messages


SenderMessageTime
28 Mar 2025
@k900:0upti.meK900 Or maybe nix repl <nixpkgs> 20:25:25
@k900:0upti.meK900I don't remember which one works on 2.2420:25:35
@stephen:crabsin.spacen3tcatahh tyty20:25:42
@stephen:crabsin.spacen3tcatI def have so much more to learn about nix20:25:50
@stephen:crabsin.spacen3tcat
nix-repl> lib.systems.elaborate "m68k-unknown-none-elf"
{
  aesSupport = false;
  androidNdkVersion = null;
  androidSdkVersion = null;
  avx2Support = false;
  avx512Support = false;
  avxSupport = false;
  canExecute = «lambda canExecute @ /nix/store/080nxzd0qcvxfsh02kk5bzisski6yw6a-source/lib/systems/default.nix:88:20»;
  config = "m68k-unknown-none-elf";
  darwinArch = "m68k";
  darwinMinVersion = "11.3";
  darwinMinVersionVariable = null;
  darwinPlatform = null;
  darwinSdkVersion = "11.3";
  efiArch = "m68k";
  emulator = «lambda emulator @ /nix/store/080nxzd0qcvxfsh02kk5bzisski6yw6a-source/lib/systems/default.nix:314:20»;
  emulatorAvailable = «lambda emulatorAvailable @ /nix/store/080nxzd0qcvxfsh02kk5bzisski6yw6a-source/lib/systems/default.nix:308:29»;
  extensions = { ... };
  fma4Support = false;
  fmaSupport = false;
  gcc = { ... };
  hasSharedLibraries = false;
  is32bit = true;
  is64bit = false;
  isAarch = false;
  isAarch32 = false;
  isAarch64 = false;
  isAbiElfv2 = false;
  isAlpha = false;
  isAndroid = false;
  isArmv7 = false;
  isAvr = false;
  isBSD = false;
  isBigEndian = true;
  isCompatible = «lambda isCompatible @ /nix/store/080nxzd0qcvxfsh02kk5bzisski6yw6a-source/lib/systems/default.nix:92:22»;
  isCygwin = false;
  isDarwin = false;
  isEfi = false;
  isElf = false;
  isFreeBSD = false;
  isGenode = false;
  isGhcjs = false;
  isGnu = false;
  isILP32 = false;
  isJavaScript = false;
  isLLVMLibc = false;
  isLinux = false;
  isLittleEndian = false;
  isLoongArch64 = false;
  isM68k = true;
  isMacOS = false;
  isMacho = false;
  isMicroBlaze = false;
  isMinGW = false;
  isMips = false;
  isMips32 = false;
  isMips64 = false;
  isMips64n32 = false;
  isMips64n64 = false;
  isMmix = false;
  isMsp430 = false;
  isMusl = false;
  isNetBSD = false;
  isNone = true;
  isOpenBSD = false;
  isOr1k = false;
  isPower = false;
  isPower64 = false;
  isRedox = false;
  isRiscV = false;
  isRiscV32 = false;
  isRiscV64 = false;
  isRx = false;
  isS390 = false;
  isS390x = false;
  isSparc = false;
  isSparc64 = false;
  isStatic = false;
  isSunOS = false;
  isUClibc = false;
  isUnix = false;
  isVc4 = false;
  isWasi = false;
  isWasm = false;
  isWindows = false;
  isi686 = false;
  isiOS = false;
  isx86 = false;
  isx86_32 = false;
  isx86_64 = false;
  libDir = null;
  libc = "newlib";
  linker = "bfd";
  linux-kernel = «repeated»;
  linuxArch = "m68k";
  parsed = { ... };
  qemuArch = "m68k";
  rust = { ... };
  rustc = «repeated»;
  sse3Support = false;
  sse4_1Support = false;
  sse4_2Support = false;
  sse4_aSupport = false;
  ssse3Support = false;
  staticEmulatorAvailable = «lambda staticEmulatorAvailable @ /nix/store/080nxzd0qcvxfsh02kk5bzisski6yw6a-source/lib/systems/default.nix:311:35»;
  system = "m68k-none";
  ubootArch = "m68k";
  uname = { ... };
  useAndroidPrebuilt = false;
  useLLVM = false;
  useiOSPrebuilt = false;
}

nix-repl>

I assume I need to dig into gcc here but how do I do that?

20:28:01
@stephen:crabsin.spacen3tcatoh god sorry for wall20:28:06
@stephen:crabsin.spacen3tcat
nix-repl> (lib.systems.elaborate "m68k-unknown-none-elf").gcc
{ }
20:39:34
@stephen:crabsin.spacen3tcatoh ok20:39:37
31 Mar 2025
@sapphire:pub.solarSapphire joined the room.01:15:48
@weethet:catgirl.cloudWeetHet joined the room.13:06:20
@weethet:catgirl.cloudWeetHet

Why does adding meta.platforms = [ "wasm32-unknown-none" ]; not work?

Calling nix-build -E '(import <nixpkgs> { crossSystem = "wasm32-unknown-none"; }).callPackage ./package.nix { }'
gives me

Package <...> is not available on the requested hostPlatform:
         hostPlatform.config = "wasm32-unknown-none"
         package.meta.platforms = [ ]
13:09:01
@weethet:catgirl.cloudWeetHetAm I insane?13:09:10
@weethet:catgirl.cloudWeetHet I never built packages for platforms not in lib.platforms 13:09:33
@weethet:catgirl.cloudWeetHet Does callPackage filter out platforms not present there? 13:09:49
@weethet:catgirl.cloudWeetHetOh, it's some rustPlatform shenanigans13:21:14
@weethet:catgirl.cloudWeetHet

Whyyyy

{
  system ? builtins.currentSystem,
  pkgs ? import <nixpkgs> {
    inherit system;
    crossSystem = "wasm32-unknown-none";
    overlays = [
      (final: prev: {
        lib = prev.lib // {
          platforms = prev.lib.platforms // {
            wasm32-unknown-none = [ "wasm32-unknown-none" ];
            all = prev.lib.platforms.all ++ final.lib.platforms.wasm32-unknown-none;
          };
        };
        rustc = prev.rustc // {
          targetPlatforms = prev.rustc.targetPlatforms ++ final.lib.platforms.wasm32-unknown-none;
        };
      })
    ];
  },
}:
pkgs.callPackage ./package.nix { }
$ nix-instantiate --eval -E '(import ./. { }).meta.platforms'
[ ]
13:30:13
@weethet:catgirl.cloudWeetHetI swear to god I'm going to just use hooks13:30:27
@weethet:catgirl.cloudWeetHet

Oh you also need to redefine rustPlatform, I see:

rustPlatform = prev.makeRustPlatform {
  inherit (final) rustc cargo;
};
13:46:06
@weethet:catgirl.cloudWeetHet

Wait what:

error: Package <...> is not available on the requested hostPlatform:
         hostPlatform.config = "wasm32-unknown-none"
         package.meta.platforms = [
           "wasm32-unknown-none"
         ]
13:46:46
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all) joined the room.15:40:12
1 Apr 2025
@strum355:matrix.orgstroem changed their display name from stroem - sourcegraph to stroem.09:41:51
@sandro:supersandro.deSandro changed their display name from Sandro 🐧 to Sandro 🐧 [c3d2].13:57:58
@sandro:supersandro.deSandro changed their display name from Sandro 🐧 [c3d2] to Sandro 🐧.13:59:27
@rosssmyth:matrix.orgrosssmythI would appreciate it if someone could please review this to see if it is acceptable https://github.com/NixOS/nixpkgs/pull/39220417:48:06
2 Apr 2025
@fabaff:matrix.orgfabaff joined the room.07:32:09
3 Apr 2025
@diamondburned:matrix.orgdiamond (it/its) changed their display name from Diamond (it/she) to diamond (it/its).01:06:39
@2xsaiko:tchncs.de@2xsaiko:tchncs.de changed their display name from 2xsaiko to 2xsaiko (moved! @saiko:knifepoint.net).12:52:01
4 Apr 2025
@etehtsea:matrix.orgkis-kis joined the room.03:44:38
@qbit:tapenet.org@qbit:tapenet.org left the room.15:58:39
8 Apr 2025
@yuri:peori.space@yuri:peori.space left the room.11:24:35

Show newer messages


Back to Room ListRoom Version: 6