!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

582 Members
129 Servers

Load older messages


SenderMessageTime
14 Feb 2025
@reckenrode:matrix.orgRandy EckenrodeiOS was mentioned, so I felt it was worth speaking up about. There is not a lot of available Darwin bandwidth. I’d rather not spend it on fringe use cases when there’s still a lot that can be done to improve the common case.16:29:20
@emilazy:matrix.orgemilyfwiw still personally happy to mentor bringing iOS support up to date in line with my previous statements about how it should work :P17:20:06
@emilazy:matrix.orgemilyI think if done right it would be cleanly-factored enough to not impose burden on macOS. and also it doesn't seem that hard to inject the Xcode toolchain as previously discussed, which should be entirely within the rules. though that should be a later project.17:20:40
@rosscomputerguy:matrix.orgTristan Ross
In reply to @emilazy:matrix.org
nobody really puts effort into maintaining Android and iOS upstream in Nixpkgs so they don't really work
We've got an Android team now so the effort is starting.
17:25:21
@rosssmyth:matrix.org@rosssmyth:matrix.org joined the room.17:33:58
@rosssmyth:matrix.org@rosssmyth:matrix.org

Hello. I am trying to clean up my build process. I am attempting to use the arm-embedded cross pkg. My derivation looks something like

{
  pkgs,
  stdenv,
  optLevel ? "debug",
}:

stdenv.mkDerivation {
  nativeBuildInputs = with pkgs.pkgsBuildHost; [meson ninja gnused srecord];

  name = "Jordan";
  src = pkgs.lib.cleanSource ./.;
  doCheck = false;

  mesonBuildType = optLevel;
  dontStrip = true;
  strictDeps = true;
}

and then it is called with

default = pkgs.pkgsCross.arm-embedded.callPackage ./default.nix {};

This fails with the error

error: attribute 'version' missing
       at /nix/store/1d49vqvzrcx28yjj0rrwxr2dfy15rkp6-source/pkgs/os-specific/linux/systemd/default.nix:119:59:
          118|     # assumes hard floats
          119|     && (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6")
             |                                                           ^
          120|     # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211

The build target is armv6m, and I am building on x86. Is there some way to provide it the info it needs?

Note that if I instance a dedicated cross instance with

armPkgs = import nixpkgs { crossSystem = { config = "armv6m-none-none-eabi"; libc="newlib"; }; };
armPkgs.callPackage ./default.nix {};

It almost works (it gets to the build stage but hits an error I've not seen with the arm-embedded compiler), but it requires compiling GCC from source.

17:45:18
@rosssmyth:matrix.org@rosssmyth:matrix.org *

Hello. I am trying to clean up my build process. I am attempting to use the arm-embedded cross pkg. My derivation looks something like

{
  pkgs,
  stdenv,
  optLevel ? "debug",
}:

stdenv.mkDerivation {
  nativeBuildInputs = with pkgs.pkgsBuildHost; [meson ninja gnused srecord];

  name = "MyProject";
  src = pkgs.lib.cleanSource ./.;
  doCheck = false;

  mesonBuildType = optLevel;
  dontStrip = true;
  strictDeps = true;
}

and then it is called with

default = pkgs.pkgsCross.arm-embedded.callPackage ./default.nix {};

This fails with the error

error: attribute 'version' missing
       at /nix/store/1d49vqvzrcx28yjj0rrwxr2dfy15rkp6-source/pkgs/os-specific/linux/systemd/default.nix:119:59:
          118|     # assumes hard floats
          119|     && (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6")
             |                                                           ^
          120|     # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211

The build target is armv6m, and I am building on x86. Is there some way to provide it the info it needs?

Note that if I instance a dedicated cross instance with

armPkgs = import nixpkgs { crossSystem = { config = "armv6m-none-none-eabi"; libc="newlib"; }; };
armPkgs.callPackage ./default.nix {};

It almost works (it gets to the build stage but hits an error I've not seen with the arm-embedded compiler), but it requires compiling GCC from source.

17:45:33
@rosssmyth:matrix.org@rosssmyth:matrix.org *

Hello. I am trying to clean up my build process. I am attempting to use the arm-embedded cross pkg. My derivation looks something like

{
  pkgs,
  stdenv,
  optLevel ? "debug",
}:

stdenv.mkDerivation {
  nativeBuildInputs = with pkgs.pkgsBuildHost; [meson ninja gnused srecord];

  name = "MyProject";
  src = pkgs.lib.cleanSource ./.;
  doCheck = false;

  mesonBuildType = optLevel;
  dontStrip = true;
  strictDeps = true;
}

and then it is called with

default = pkgs.pkgsCross.arm-embedded.callPackage ./default.nix {};

This fails with the error

error: attribute 'version' missing
       at /nix/store/1d49vqvzrcx28yjj0rrwxr2dfy15rkp6-source/pkgs/os-specific/linux/systemd/default.nix:119:59:
          118|     # assumes hard floats
          119|     && (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6")
             |                                                           ^
          120|     # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211

The build target is armv6m, and I am building on x86. Is there some way to provide it the info it needs?

Note that if I instance a dedicated cross instance with

armPkgs = import nixpkgs { crossSystem = { config = "armv6m-none-none-eabi"; libc="newlib"; }; };
armPkgs.callPackage ./default.nix {};

It almost works (it gets to the build stage but hits an error I've not seen with the arm-embedded compiler), but it requires compiling GCC from source which is not really needed.

17:46:29
@artturin:matrix.orgArtturinNo version here https://github.com/NixOS/nixpkgs/blob/795a271ba11f5a7875e314d2d197a7bd361e695f/lib/systems/parse.nix#L11117:53:43
@artturin:matrix.orgArtturin arm-embedded is arm-none-eabi 17:54:04
@artturin:matrix.orgArtturinTheres no way to know the cpu.version for arm-none-eabi 17:55:19
@artturin:matrix.orgArtturin* I think theres no way to know the cpu.version for arm-none-eabi from the name17:55:28
@artturin:matrix.orgArtturin* I think theres no way to know the cpu.version for arm-none-eabi from the triplet17:55:34
@artturin:matrix.orgArtturin The systemd conditional should check stdenv.hostPlatform.parsed.cpu ? version 17:55:55
@artturin:matrix.orgArtturin screcord -> ghostscript -> cups -> systemd 18:00:14
@artturin:matrix.orgArtturinIf srecord does not need to know targetPlatform (not compiler) then you can put it in depsBuildBuild18:00:51
@artturin:matrix.orgArtturinfrom pkgsBuildBuild18:00:57
@artturin:matrix.orgArtturin* If srecord does not need to know targetPlatform (is not a compiler) then you can put it in depsBuildBuild18:05:23
@rosssmyth:matrix.org@rosssmyth:matrix.orgThat did not change anything18:06:42
@artturin:matrix.orgArtturin
nix-repl> pkgsCross.arm-embedded.pkgsBuildBuild.srecord
«derivation /nix/store/88q413an8c5nnrhan3lqk3ggsjdwal7v-srecord-1.64.drv»
18:10:42
@rosssmyth:matrix.org@rosssmyth:matrix.org Oh, I did not know of pkgs.pkgsBuildBuild I thought you just meant moving it to depsBuildBuild = [pkgs.pkgsBuildHost.srecord];. That does work. Thanks. 18:12:56
@rosssmyth:matrix.org@rosssmyth:matrix.orgWhat's the difference between pkgsBuildHost and pkgsBuildBuild?18:13:34
@artturin:matrix.orgArtturinCompilers in pkgsBuildBuild compile for build platform Compilers in pkgsBuildHost compile for host platform18:14:48
@artturin:matrix.orgArtturinhttps://nixos.org/manual/nixpkgs/unstable/#var-stdenv-depsBuildBuild18:18:23
@rosssmyth:matrix.org@rosssmyth:matrix.orgCool, thanks for your help.18:18:52
@artturin:matrix.orgArtturin rosssmyth: https://github.com/NixOS/nixpkgs/pull/382110 18:23:20
@emilazy:matrix.orgemilyyou shouldn't need to explicitly specify the package set18:29:02
@emilazy:matrix.orgemily splicing ensures that depsBuildBuild = [ srecord ]; should do the right thing 18:29:11
@artturin:matrix.orgArtturin(callPackage has spliced packages so you don't have to specify the set)18:29:45
@rosssmyth:matrix.org@rosssmyth:matrix.orgOh, I see.18:33:03

Show newer messages


Back to Room ListRoom Version: 6