!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

578 Members
125 Servers

Load older messages


SenderMessageTime
18 Feb 2025
@k900:0upti.meK900Windows doesn't really do static05:34:57
@axman6:matrix.orgAxman6yeah ok - I guess I need to find out how windows packages things up06:10:01
19 Feb 2025
@axman6:matrix.orgAxman6Is there a way to have Nix run a VM or something else to run things like tests when cross compiling?01:32:21
@artturin:matrix.orgArtturin
In reply to @axman6:matrix.org
Is there a way to have Nix run a VM or something else to run things like tests when cross compiling?
No but in some cases it should be possible to hook up stdenv.hostPlatform.emulator buildPackages somehow
01:52:04
@artturin:matrix.orgArtturin* No but in some cases it might be possible to hook up stdenv.hostPlatform.emulator buildPackages somehow01:52:18
@artturin:matrix.orgArtturin* No but in some cases it might be possible to hook up `stdenv.hostPlatform.emulator buildPackages somehow`01:52:28
@artturin:matrix.orgArtturin* No but in some cases it might be possible to hook up `stdenv.hostPlatform.emulator buildPackages` somehow 01:52:42
@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.orgrosssmyth 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.orgrosssmyth

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

Show newer messages


Back to Room ListRoom Version: 6