-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/fontsdir: fix cross #371049
nixos/fontsdir: fix cross #371049
Conversation
I don't see how this is possible. I've tried to reproduce this issue where you've got an aarch64-linux let
someRevOnMaster = "742e83951eefc0a0a74dd95a6523300dacfb4238";
inherit
(import (builtins.getFlake "github:nixos/nixpkgs/${someRevOnMaster}") {
system = "aarch64-linux";
})
pkgsCross
;
in
builtins.head (
builtins.filter (drv: drv.name == "X11-fonts")
(pkgsCross.riscv64.nixos {
fonts.fontDir.enable = true;
boot.isContainer = true;
}).config.environment.systemPackages
) This results in the following: $ nix eval --impure --file /tmp/test.nix
evaluation warning: system.stateVersion is not set, defaulting to 25.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.sta
teVersion.
«derivation /nix/store/0gp81b50wg2bf2dbqswkbhvy21i8x552-X11-fonts.drv» And that drv has the following properties {
"/nix/store/0gp81b50wg2bf2dbqswkbhvy21i8x552-X11-fonts.drv": {
"args": [
"-e",
"/nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh"
],
"builder": "/nix/store/rm5cm7wk2a6y17gz52ymh39d5fzai2lv-bash-5.2p37/bin/bash",
"env": {
"__structuredAttrs": "",
"buildCommand": "mkdir -p \"$out/share/X11/fonts\"\nfont_regexp='.*\\.\\(ttf\\|ttc\\|otb\\|otf\\|pcf\\|pfa\\|pfb\\|bdf\\)\\(\\.gz\\)?'\nfind -regex \"$font_
regexp\" \\\n -exec ln -sf -t \"$out/share/X11/fonts\" '{}' \\;\ncd \"$out/share/X11/fonts\"\n\nmkfontscale\nmkfontdir\ncat $(find /nix/store/vji0ax6kvdm8sxbf7b8m
m1rbwj2ns271-font-alias-riscv64-unknown-linux-gnu-1.0.5/ -name fonts.alias) >fonts.alias\n",
"buildInputs": "",
"builder": "/nix/store/rm5cm7wk2a6y17gz52ymh39d5fzai2lv-bash-5.2p37/bin/bash",
"cmakeFlags": "-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=riscv64 -DCMAKE_HOST_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_PROCESSOR=aarch64",
"configureFlags": "--build=aarch64-unknown-linux-gnu --host=riscv64-unknown-linux-gnu",
"depsBuildBuild": "",
"depsBuildBuildPropagated": "",
"depsBuildTarget": "",
"depsBuildTargetPropagated": "",
"depsHostHost": "",
"depsHostHostPropagated": "",
"depsTargetTarget": "",
"depsTargetTargetPropagated": "",
"doCheck": "",
"doInstallCheck": "",
"enableParallelBuilding": "1",
"enableParallelChecking": "1",
"enableParallelInstalling": "1",
"mesonFlags": "--cross-file=/nix/store/75gpq48zk7xppjl5hpxrwrqkv68hpwd5-cross-file.conf",
"name": "X11-fonts",
"nativeBuildInputs": "/nix/store/fl5mjwwd1ibphb011kmwqsl697n2abhr-gzip-1.13 /nix/store/qzwh2ml21iw67ln2qr2l9r17a2jmh6a8-mkfontscale-1.2.3 /nix/store/qzwh2ml2
1iw67ln2qr2l9r17a2jmh6a8-mkfontscale-1.2.3",
"out": "/nix/store/dlrbwcc2i14a2c8yhlylxwnw268ss6pf-X11-fonts",
"outputs": "out",
"passAsFile": "buildCommand",
"patches": "",
"preferLocalBuild": "1",
"propagatedBuildInputs": "",
"propagatedNativeBuildInputs": "",
"stdenv": "/nix/store/1vf838bcfr4hdi1pvy0wvhsm16gl8y98-stdenv-linux",
"strictDeps": "1",
"system": "aarch64-linux"
},
"inputDrvs": {
"/nix/store/1fyz1cf9m2yvxjyq3gx4zqnrmxl9i7lp-font-alias-riscv64-unknown-linux-gnu-1.0.5.drv": {
"dynamicOutputs": {},
"outputs": [
"out"
]
},
"/nix/store/9g3kgj711gg4pvfnl5aad1rghzw81sr8-gzip-1.13.drv": {
"dynamicOutputs": {},
"outputs": [
"out"
]
},
"/nix/store/cggy6p43sd1qcil8h56cp3gxdx3q7dy3-mkfontscale-1.2.3.drv": {
"dynamicOutputs": {},
"outputs": [
"out"
]
},
"/nix/store/dmvym833yfmarj3ybjknd50h6wq8vs26-stdenv-linux.drv": {
"dynamicOutputs": {},
"outputs": [
"out"
]
},
"/nix/store/lczmm84pj8qgp3kpkwrg1lqy0bji53gh-bash-5.2p37.drv": {
"dynamicOutputs": {},
"outputs": [
"out"
]
}
},
"inputSrcs": [
"/nix/store/75gpq48zk7xppjl5hpxrwrqkv68hpwd5-cross-file.conf",
"/nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh"
],
"name": "X11-fonts",
"outputs": {
"out": {
"path": "/nix/store/dlrbwcc2i14a2c8yhlylxwnw268ss6pf-X11-fonts"
}
},
"system": "aarch64-linux"
}
} As can be seen, |
That's strange, I'm just using the local and cross system config under the |
Can you paste a minimal reproducer here? callPackage is supposed to choose the package-set for us, so I wouldn't expect this extra fix to be needed. |
let
nixpkgs = builtins.getFlake "github:nixos/nixpkgs/d29ab98cd4a70a387b8ceea3e930b3340d41ac5a";
in
builtins.head (
builtins.filter (drv: drv.name == "X11-fonts")
(import "${nixpkgs}/nixos/lib/eval-config.nix" {
modules = [
{
fonts.fontDir.enable = true;
boot.isContainer = true;
nixpkgs.crossSystem = { system = "riscv64-linux"; };
nixpkgs.localSystem = { system = "aarch64-linux"; };
}
];
}).config.environment.systemPackages
) I made a reproducer based on what you had and it does produce the same error. |
Interesting, your reproducer works. It seems the culprit is something with passing through |
Artturin and I chased where this was going wrong, the problem is #366959 didn't get into 24.11. |
Things done
Fixes cross which @jmbaur tried fixing but it's a problem again.
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.