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
kernel: allow to be built on remote builder #105675
Conversation
When building a kernel for a different architecture, the build fails because `preferLocalBuild` tries to run the wrong binaries locally (i.e. aarch64 binaries on x86-64).
Tested with
|
not sure if there is a better way? |
cc @cleverca22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for such a small change scoped in a technical part of nixpkgs this is okay.
But this comes with several unanswered questions.
- Using overrides here is wrong. If there are valid cases for flipping
preferLocalBuild
andallowSubstitutes
in writeTextFile, then we should make it configurable in writeTextFile. - It is unclear why this code prevents the remote build of cross kernel builds. Is it because
a. it comes with stdev.shell that has the wrong architecture and cannot execute remotely ?
b. It also containsallowSubstitutes=false
which prevents nix from uploading that file on the remote server ?
c. Nix plays badly with the mix of options anyway. - There appears to be some mis-classification iof this script. It appears to be a nativeBuildInput, while the way it is used (an antiquotation) makes it a normal build input by default. Could the problem come from there instead ?
Please forgive my lack of knowledge on remote cross compilation if need be. But I think there is an opportunity to gain some knowledge here. An possibly generalize the issue.
I am not sure this change is required at all. I've been remote building kernels for my aarch64 machines for a while now. The build machine doesn't have the binfmt setup so whenever it has to build aarch64 derivations it does so on a remote machine. What error did you run into without this change and how did you setup the remote builders? |
|
This my nix config:
|
By setting Apply this patch to your nur repo: diff --git a/default.nix b/default.nix
index c7aa03f..43819be 100644
--- a/default.nix
+++ b/default.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> { } }:
+{ system ? builtins.currentSystem, pkgs ? import <nixpkgs> { inherit system; } }:
rec {
bitwarden_rs_ldap = pkgs.callPackage ./pkgs/bitwarden_rs_ldap { }; And then build like this: |
Thanks! |
When building a kernel for a different architecture, the build
fails because
preferLocalBuild
tries to run the wrong binarieslocally (i.e. aarch64 binaries on x86-64).
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)