!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

579 Members
128 Servers

Load older messages


SenderMessageTime
19 Feb 2025
@artturin:matrix.orgArtturin https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+%2F%5C.emulator%2F&type=code 01:53:27
@axman6:matrix.orgAxman6Ok, that helped me find https://nix.dev/tutorials/cross-compilation.html#real-world-cross-compiling-of-a-hello-world-example too, thanks01:57:46
@axman6:matrix.orgAxman6now to figure out how to run x86_64 wine under some VM on aarch64-darwin 😂01:59:05
@artturin:matrix.orgArtturinIf you want a linux builder https://nixcademy.com/posts/macos-linux-builder/02:00:12
@axman6:matrix.orgAxman6That looks shockingly simple. Is it possible for the VM to share the host's /nix/store?02:06:46
@axman6:matrix.orgAxman6Oh actually, I assume remote builders will just do the build and pass back the results to the original build machine05:23:32
@axman6:matrix.orgAxman6Let me know if there's a better place to ask (#Nix on macOS maybe?), but would bit be possible to also have a x86_64-linux VM using this?05:27:38
@rosscomputerguy:matrix.orgTristan Ross
In reply to @axman6:matrix.org
Let me know if there's a better place to ask (#Nix on macOS maybe?), but would bit be possible to also have a x86_64-linux VM using this?
It technically should be, the arch shouldn't matter too much imo.
05:30:14
@sss:matrix.dark-alexandr.netsss 20:06:15
20 Feb 2025
@spacekookie:fairydust.spacekookie changed their profile picture.12:12:58
21 Feb 2025
@eureka-cpu:matrix.orgeureka-cpu
In reply to @axman6:matrix.org
Let me know if there's a better place to ask (#Nix on macOS maybe?), but would bit be possible to also have a x86_64-linux VM using this?
If you are using nix-darwin Linux builder, there is a way to use Rosetta to build x86_64-linux binaries. If you’d rather, you could have a qemu VM window open up and use that. One moment, I can link you to some relevant issues and projects I’ve worked on for creating Linux VMs on MacOS.
18:50:57
@eureka-cpu:matrix.orgeureka-cpu

https://github.com/LnL7/nix-darwin/issues/1192

https://github.com/formthefog/lasr/blob/main/flake.nix#L217
This is a project I was working on to create a generic debug VM to run a node for my team to test. It works on MacOS, opens up a Linux qemu instance.

18:53:57
@eureka-cpu:matrix.orgeureka-cpuKeep in mind the Linux builder is not actually cross compiling IIRC18:55:28
23 Feb 2025
@rhelmot:matrix.orgrhelmotIncredible success story: I got nodejs to build as linux -> freebsd cross by injecting some intermediate binaries from the native linux build. https://github.com/NixOS/nixpkgs/pull/38441303:02:20
@emilazy:matrix.orgemilythat's, uh, wow04:02:04
@rosscomputerguy:matrix.orgTristan RossIf testing is needed, I can test on Ampere lol.04:10:23
24 Feb 2025
@axman6:matrix.orgAxman6Is there a non-zero chance of being able to build a python app using pkgsCross.mingwW64? I'm running into issues early on with bash complaining it can't run as a pe executable (seems totally reasonable, but I'm not sure where it's decided it needs to do that) Or alternatively, any chance of being able to build python things for windows in some form of VM/wine/something05:30:23
@fliegendewurst:matrix.orgFliegendeWurst
In reply to @axman6:matrix.org
Is there a non-zero chance of being able to build a python app using pkgsCross.mingwW64? I'm running into issues early on with bash complaining it can't run as a pe executable (seems totally reasonable, but I'm not sure where it's decided it needs to do that)

Or alternatively, any chance of being able to build python things for windows in some form of VM/wine/something
Using Python 3.11, maybe. I think at least the interpreter built successfully, not sure about most packages..
06:38:26
25 Feb 2025
@rosssmyth:matrix.org@rosssmyth:matrix.org When using callPackage ./whatever {rustPlatform = customPlatform}, are the rust and cargo packages spliced into the package the same that are under rustPlatform.rust.{rustc, cargo}? 21:00:04
@artturin:matrix.orgArtturinYou have to add customPlatform toplevel to have it spliced 21:01:26
@artturin:matrix.orgArtturinAmd then rustPlatform = __splicedPackages.customPlatform21:01:41
@artturin:matrix.orgArtturin* You have to add customPlatform toplevel or available from thereto have it spliced 21:02:55
@rosssmyth:matrix.org@rosssmyth:matrix.org

I'm sorry, I'm not quite sure what you mean. I currently have a file that is like

{ pkgs, stdenv, rustPlatform, ...}: stdenv.mkDerivation {
depsBuildBuild = [rustPlatform.rust.rustc rustPlatform.rust.cargo];
...other stuff
}

Which is called from another file with a rust-overlay toolchain using makeRustPlatform. I am wondering if I can change it to

{ pkgs, stdenv, rustPlatform, rust, cargo, ...}: stdenv.mkDerivation {
depsBuildBuild = [rust, cargo];
...other stuff
}

as it keeps yelling at me that using rustPlatform.rust.{rustc, cargo} is deprecated.

21:09:13
@rosssmyth:matrix.org@rosssmyth:matrix.orgOk, 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.org@rosssmyth:matrix.orgyeah sorry21:31:40
@rosssmyth:matrix.org@rosssmyth:matrix.orgI had it as rustc21:31:44
@rosssmyth:matrix.org@rosssmyth:matrix.orgbut 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

Show newer messages


Back to Room ListRoom Version: 6