-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Linux builder forced to host platform system instead of it's package variant #313784
Comments
Before this commit, aarch64 users building the following configuration would end up with an aarch64-linux builder, while after it, they get the x86_64-linux builder they expect: ```nix nix.linux-builder = { enable = true; package = pkgs.darwin.linux-builder-x86_64; }; ``` Before, in order to get an x86_64-linux builder, they would have needed to use this configuration instead: ```nix nix.linux-builder = { enable = true; config.nixpkgs.hostPlatform = "x86_64-linux"; systems = ["x86_64-linux"]; }; ``` The reason for this is that the linux-builder module calls `override` on the package option, and the `linux-builder-x86_64` package is also defined using override: ```nix linux-builder-x86_64 = linux-builder.override { modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ]; }; ``` The module was effectively discarding the `nixpkgs.hostPlatform` option. Example issue: NixOS/nixpkgs#313784
I think the qemu binary is set correctly in the builders, in this file:
I was also having this problem, and found this issue while looking into it. But I realized the result is being caused by these lines in nix-darwin:
(https://github.com/LnL7/nix-darwin/blob/master/modules/nix/linux-builder.nix#L10-L12) That looks fine, but the builder package we're trying to use is also created using override! linux-builder-x86_64 = self.linux-builder.override {
modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ];
}; So the You can work around this by setting that value in your nix darwin config, like this:
I've opened a pull request to make this work the way we expected it to: LnL7/nix-darwin#974 Thank you for this issue, it confirmed that I wasn't the only person having this problem, and led me to find the cause. 😄 |
Before this commit, aarch64 users building the following configuration would end up with an aarch64-linux builder, while after it, they get the x86_64-linux builder they expect: ```nix nix.linux-builder = { enable = true; package = pkgs.darwin.linux-builder-x86_64; }; ``` Before, in order to get an x86_64-linux builder, they would have needed to use this configuration instead: ```nix nix.linux-builder = { enable = true; config.nixpkgs.hostPlatform = "x86_64-linux"; systems = ["x86_64-linux"]; }; ``` The reason for this is that the linux-builder module calls `override` on the package option, and the `linux-builder-x86_64` package is also defined using override: ```nix linux-builder-x86_64 = linux-builder.override { modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ]; }; ``` The module was effectively discarding the `nixpkgs.hostPlatform` option. Example issue: NixOS/nixpkgs#313784
Before this commit, aarch64 users building the following configuration would end up with an aarch64-linux builder, while after it, they get the x86_64-linux builder they expect: ```nix nix.linux-builder = { enable = true; package = pkgs.darwin.linux-builder-x86_64; }; ``` Before, in order to get an x86_64-linux builder, they would have needed to use this configuration instead: ```nix nix.linux-builder = { enable = true; config.nixpkgs.hostPlatform = "x86_64-linux"; systems = ["x86_64-linux"]; }; ``` The reason for this is that the linux-builder module calls `override` on the package option, and the `linux-builder-x86_64` package is also defined using override: ```nix linux-builder-x86_64 = linux-builder.override { modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ]; }; ``` The module was effectively discarding the `nixpkgs.hostPlatform` option. Example issue: NixOS/nixpkgs#313784
Before this commit, aarch64 users building the following configuration would end up with an aarch64-linux builder, while after it, they get the x86_64-linux builder they expect: ```nix nix.linux-builder = { enable = true; package = pkgs.darwin.linux-builder-x86_64; }; ``` Before, in order to get an x86_64-linux builder, they would have needed to use this configuration instead: ```nix nix.linux-builder = { enable = true; config.nixpkgs.hostPlatform = "x86_64-linux"; systems = ["x86_64-linux"]; }; ``` The reason for this is that the linux-builder module calls `override` on the package option, and the `linux-builder-x86_64` package is also defined using override: ```nix linux-builder-x86_64 = linux-builder.override { modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ]; }; ``` The module was effectively discarding the `nixpkgs.hostPlatform` option. Example issue: NixOS/nixpkgs#313784
Thanks a lot ! |
Describe the bug
A clear and concise description of what the bug is.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Notify maintainers
@Enzime
Metadata
Did not find any issues related to this qemu program choice.
The text was updated successfully, but these errors were encountered: