!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
130 Servers

Load older messages


SenderMessageTime
13 Oct 2021
@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
@sternenseemann:systemli.orgsterni trofi: configurePlatforms = [ "build" "host" ]; will pass --host as desired 14:26:10
@trofi:matrix.orgtrofiAh, nice. That should be cleaner than https://github.com/NixOS/nixpkgs/pull/141210/commits/0c0ed6f143c66fa10ddf3db24c02889f28d4cd4d.14:27:25
@trofi:matrix.orgtrofiWas about to ask why those don't get passed unconditionall, but the TODO is already there :) https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/make-derivation.nix#L58-L6114:33:15
@mars:jupiterbroadcasting.commars joined the room.19:03:15
18 Oct 2021
@trofi:matrix.orgtrofi

I'd like to update locally a bootstrap binary tarball for musl (to make pkgsMusl use current versions of musl & co.). Can I do it from a glibc system?

I tried as nix build -f pkgs/stdenv/linux/make-bootstrap-tools.nix --arg localSystem '{ config = "x86_64-unknown-linux-gnu"; libc = "musl"; }', but it seems to pass --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu to bison.

06:58:28

Show newer messages


Back to Room ListRoom Version: 6