Skip to content
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

build-support/docker: set default image arch to host arch #68898

Merged
merged 1 commit into from Sep 17, 2019

Conversation

nspin
Copy link
Contributor

@nspin nspin commented Sep 16, 2019

Replaces hard-coded amd64 default architecture of docker image expressions in build-support/docker with buildPackages.go.GOARCH.

Motivation for this change

The architecture for which a docker image is being composed or pulled seems like the appropriate default for the architecture of the image itself. For example, if I am cross-compiling a script from amd64 to arm64 which refers to a docker image built from buildImage, I would expect that image, by default, to be configured for arm64.

buildPackages.go.GOARCH is an easy way to compute that architecture with the correct terminology.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@FRidh
Copy link
Member

FRidh commented Sep 16, 2019

The commit message describes what change is made, but not why.

@nspin
Copy link
Contributor Author

nspin commented Sep 16, 2019

You're right. I've updated my message above.

@FRidh
Copy link
Member

FRidh commented Sep 16, 2019

please add the details to the commit message, not the PR message. They're not the same.

The architecture of an image should default to the architecture for
which that image is being composed or pulled. buildPackages.go.GOARCH is
an easy way to compute that architecture with the correct terminology.
@nspin
Copy link
Contributor Author

nspin commented Sep 16, 2019

Sorry - missed the word commit in your request! I've amended the commit.

@FRidh
Copy link
Member

FRidh commented Sep 16, 2019

Thanks.

@matthewbauer matthewbauer merged commit b32fd0c into NixOS:master Sep 17, 2019
@nspin nspin deleted the pr/docker-image-cross branch September 24, 2019 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants