!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

578 Members
129 Servers

Load older messages


SenderMessageTime
12 Oct 2021
@sternenseemann:systemli.orgsterninice17:36:18
@trofi:matrix.orgtrofiProposed as https://github.com/NixOS/nixpkgs/pull/141397. I also noticed that llvm_{8..git} completely drop this backport probably due to the same conflict. I'll have a look at it and restore patches for newer versions. Should be trivial.19:00:38
13 Oct 2021
@janne.hess:helsinki-systems.deJanne Heß joined the room.15:17:29
@janne.hess:helsinki-systems.deJanne HeßHey, I don't know if this is the correct channel for these kinds of questions but I couldn't find any so this one is my best guess. Is there any easy way to test cross NixOS builds? Like my desktop or any other system? The reason I'm asking is that I need to test whether a PR that I created breaks cross builds15:19:08
@sternenseemann:systemli.orgsternido you want to test a package or a system configuration?15:36:38
@janne.hess:helsinki-systems.deJanne Heßa full system configuration15:42:21
@janne.hess:helsinki-systems.deJanne HeßIt's about a PR that changes top-level.nix 👀15:42:59
@sternenseemann:systemli.orgsterni Janne Heß: have you tried (pkgsCross.<platform>.nixos /path/to/configuration.nix).build? 15:43:46
@sternenseemann:systemli.orgsterniah it's not called build isn't it15:44:50
@sternenseemann:systemli.orgsterni * ah it's not called build is it15:44:55
@sternenseemann:systemli.orgsterni * Janne Heß: have you tried (pkgsCross.<platform>.nixos /path/to/configuration.nix).toplevel? 15:45:07
@janne.hess:helsinki-systems.deJanne Heßconfig.system.build.toplevel probably15:45:13
@sternenseemann:systemli.orgsterniyeah15:45:17
@sternenseemann:systemli.orgsterniyou probably need a quite minimal configuration to try15:45:52
@sternenseemann:systemli.orgsternimine fails instantly because we can't cross compile perl :)15:46:01
@janne.hess:helsinki-systems.deJanne Heßoh we can't cross-compile perl?15:46:16
@sternenseemann:systemli.orgsternioh hm we can15:46:46
@sternenseemann:systemli.orgsterniah we can't compile it statically? iirc15:46:57
@sternenseemann:systemli.orgsterniseems like git can't be cross compiled with perlSupport rather15:47:38
@sternenseemann:systemli.orgsterniso no gitFull for me15:47:59
@janne.hess:helsinki-systems.deJanne Heß

Thanks, your hints worked \o/
So the trick is to use

((import <nixpkgs> {}).pkgsCross.aarch64-multiplatform.nixos /tmp/lal.nix ).config.system.build.toplevel

and then the minimal configuration:

{ boot.loader.grub.enable = false; fileSystems."/".device = "tmpfs"; }
15:49:32
@janne.hess:helsinki-systems.deJanne Heß *

Thanks, your hints worked \o/
So the trick is to use

((import <nixpkgs> {}).pkgsCross.aarch64-multiplatform.nixos /tmp/lal.nix).config.system.build.toplevel

and then the minimal configuration:

{ boot.loader.grub.enable = false; fileSystems."/".device = "tmpfs"; }
15:49:55
@janne.hess:helsinki-systems.deJanne HeßLet's see if it builds from a stock nixpkgs…15:51:11
@sternenseemann:systemli.orgsterni alternatively you can pass crossSystem to nixpkgs 15:51:15
@sternenseemann:systemli.orgsterniI think you can set the system in the configuration as well, but not quite sure15:51:39
@janne.hess:helsinki-systems.deJanne HeßAh yes there's nixpkgs.config I think… but if it works like this I'm happy (or rather Alyssa because I don't break her setup again)15:52:20
15 Oct 2021
@janne.hess:helsinki-systems.deJanne Heß left the room.09:42:35
17 Oct 2021
@trofi:matrix.orgtrofi How does one portably detects musl to work on nixos? gnulib assumes that --host= has musl substring: https://git.savannah.gnu.org/cgit/gnulib.git/tree/m4/musl.m4#n16 13:40:56
@trofi:matrix.orgtrofi But nixpkgs does not have a habit of passing --host=, as a result icnov() wrappers in gnulib break occasionally: https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/unicodeio.c#n151 13:42:16
@trofi:matrix.orgtrofi iconv() idiosyncrasy seems to be intentional: https://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv 13:52:47

Show newer messages


Back to Room ListRoom Version: 6