!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
126 Servers

Load older messages


SenderMessageTime
25 Feb 2025
@rosssmyth:matrix.orgrosssmythOk, the answer is no you cannot do that.21:18:23
@emilazy:matrix.orgemily [rust, cargo] is invalid syntax 21:27:54
@emilazy:matrix.orgemily [rustc cargo] should work. but you probably want rustPlatform.cargo{Setup,Build}Hook? and you probably even just want rustPlatform.buildRustPackage 21:28:55
@rosssmyth:matrix.orgrosssmythyeah sorry21:31:40
@rosssmyth:matrix.orgrosssmythI had it as rustc21:31:44
@rosssmyth:matrix.orgrosssmythbut I looked at nix-diff and it pulls in the incorrect rustc and cargo21:32:01
@artturin:matrix.orgArtturinYour rustPlatform override only affects that attr21:32:35
@emilazy:matrix.orgemily is there a reason you're not just using rustPlatform.buildRustPackage? 21:32:40
@rosssmyth:matrix.orgrosssmythI do use the hooks, but you must supply rustc and cargo in the build inputs otherwise it fails to build.21:33:04
@emilazy:matrix.orgemily right. but I mean if you're just building a simple Rust package you don't need to explicitly specify any of that with buildRustPackage. (if it's more elaborate then carry on) 21:33:45
@rosssmyth:matrix.orgrosssmythAnd I am not using buildRustPackage because my snippet isn't exactly what I have written. I am using finalAttrs a lot which is not compatible with buildRustPackage (yet)21:33:54
@rosssmyth:matrix.orgrosssmythOnce either #354999 or #194475 are merged I shall switch to buildRustPackage21:34:58
@danielbarter:matrix.orgdanielbarter

In the past month, a rust cross build in my CI broke: https://github.com/NixOS/nixpkgs/issues/384662.

I don't have a lot of rust experience, but experimenting in nix-shell, it seems like cargo isn't understanding that we are attempting to do a cross build.

Any help would be much appreciated :D

23:55:13
@danielbarter:matrix.orgdanielbarterit could be caused by something up stream, but haven't been able to verify23:56:14
26 Feb 2025
@emilazy:matrix.orgemilymaybe related to https://github.com/NixOS/nixpkgs/pull/36942400:09:05
@axman6:matrix.orgAxman6 This is more a style thing than anything I guess, but if you're developing a project which is intended to build cross compiled packages (using flakes), would you add those a individual packages and use nix build .#foo-aarch64-linux or would you use legacyPackages and use nix build .#legacyPackages.pkgsCross.aarch64-multiplatform.foo? I have a flake which currently does the former, and I need the binaries it produces for specific platforms in another flake, and it feels a bit weird sometimes using packages.bar = pkgs.foo; and sometimes using packages.bar-platform = pkgs.bar.override {foo = foo-flake.packages.${system}.foo-platform;}; (where foo-platform was defined as packages.foo-platform = pkgs.pkgsCross.platform.foo;) 01:46:40
@danielbarter:matrix.orgdanielbarter emily: thanks that is indeed the cause 02:23:43
@emilazy:matrix.orgemilyI suggest leaving a comment :)02:24:27
@danielbarter:matrix.orgdanielbarteryep! https://github.com/NixOS/nixpkgs/pull/369424#issuecomment-268373947302:31:13
@artturin:matrix.orgArtturinprovide an overlay14:48:12
@sananatheskenana:matrix.orglzcunt changed their display name from sananatheskenana to lzcunt.18:20:26
@cowpuncher1:matrix.orgcowpuncher1 joined the room.19:14:38
27 Feb 2025
@hab25:matrix.orghab25 joined the room.17:43:29
1 Mar 2025
@achnazoor:matrix.org@achnazoor:matrix.org left the room.12:44:13
3 Mar 2025
@bendanm:matrix.orgbendanm joined the room.04:43:44
4 Mar 2025
@lassulus:lassul.uslassulus changed their profile picture.17:48:51
5 Mar 2025
@phanirithvij:matrix.orgloudgolem joined the room.02:40:28
@rhelmot:matrix.orgrhelmotThe conclusion of this journey: I got immich to stand up cross compiled from linux to freebsd. This entailed fixing the build for immich itself (node, ffmpeg -> pipewire -> ...), postgres, a postgres plugin which uses a niche build system for postgres rust plugins (pgrx) which claims to not support cross, and redis07:36:43
@rhelmot:matrix.orgrhelmot and of course, the requisite nixbsd pieces, including nixos containers nixbsd jails now existing 07:37:26
@rhelmot:matrix.orgrhelmotso many pull requests to submit in the coming days...07:39:41

Show newer messages


Back to Room ListRoom Version: 6