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

stdenv: update ARM bootstrap tarballs #82051

Merged
merged 2 commits into from Mar 16, 2020
Merged

stdenv: update ARM bootstrap tarballs #82051

merged 2 commits into from Mar 16, 2020

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Mar 8, 2020

Motivation for this change

follow-up to #79793

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@grahamc
Copy link
Member Author

grahamc commented Mar 8, 2020

ehh....

hash mismatch in fixed-output derivation '/nix/store/crk7rqpclwd6c282lkzjpakk76iv8p7y-7a7a0266d4687eb1b44496d4d185b9ffa9b1c6260c5df1c40a4999c612312bbd':
  wanted: sha256:1g9b649cd6a91b2g2p8c4v3b3agzp62x3m4n8jsb2zk8sik04yks
  got:    sha256:18qc6w2yykh7nvhjklsqb2zb3fjh4p9r22nvmgj32jr1mjflcsjn

@thefloweringash
Copy link
Member

The executable flag in fetchurl changes the hash algorithm to recursive to include the executable metadata. see fetchurl/default.nix.

url = https://hydra.nixos.org/build/112609163/download/2/busybox;
sha256 = "0dc5471dc6a5f69ad98eb7445f51a61e88aa5792d7a677025bf012bdb513b763";
# from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv5tel.dist/latest
# from build: https://hydra.nixos.org/build/113692702
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build url in the comment is the same for all three architectures, and points to an armv7l build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hah... uh .... :)

@thefloweringash
Copy link
Member

The name of the busybox derivation appears to be significant. If I run this after fixing the hash, I get

$ nix-build . -A hello --argstr system armv7l-linux
[ ... ]
building '/nix/store/cff954wzdw9r66kwi3gipihmw8rb1ffs-bootstrap-tools.drv' on 'ssh://alex@alex7'...
crk7rqpclwd6c282lkzjpakk76iv8p7y-7a7a0266d4687eb1b44496d4d185b9ffa9b1c6260c5df1c40a4999c612312bbd: applet not found
builder for '/nix/store/cff954wzdw9r66kwi3gipihmw8rb1ffs-bootstrap-tools.drv' failed with exit code 127

Adding name = "busybox" is enough to make it start building.

@thefloweringash
Copy link
Member

My suggested changes:

diff --git a/pkgs/stdenv/linux/bootstrap-files/armv5tel.nix b/pkgs/stdenv/linux/bootstrap-files/armv5tel.nix
index e8da070c397..18a94fb1b40 100644
--- a/pkgs/stdenv/linux/bootstrap-files/armv5tel.nix
+++ b/pkgs/stdenv/linux/bootstrap-files/armv5tel.nix
@@ -3,14 +3,15 @@
   # infrastructure team to mirror the job.
   busybox = import <nix/fetchurl.nix> {
     # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv5tel.dist/latest
-    # from build: https://hydra.nixos.org/build/113692702
+    # from build: https://hydra.nixos.org/build/114081916
+    name = "busybox";
     url = https://tarballs.nixos.org/sha256/3091d8e22778d023d51c50526ac4911b617db38b7f092fa3332c1d3ff5bd53b7;
-    sha256 = "3091d8e22778d023d51c50526ac4911b617db38b7f092fa3332c1d3ff5bd53b7";
+    sha256 = "0qxp2fsvs4phbc17g9npj9bsm20ylr8myi5pivcrmxm5qqflgi8d";
     executable = true;
   };
   bootstrapTools = import <nix/fetchurl.nix> {
     # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv5tel.dist/latest
-    # from build: https://hydra.nixos.org/build/113692702
+    # from build: https://hydra.nixos.org/build/114081916
     url = https://tarballs.nixos.org/sha256/16c307ce6d22166f2da506744caf90fcb529e3cbd003da57bcd8c1c3812ebfd7;
     sha256 = "16c307ce6d22166f2da506744caf90fcb529e3cbd003da57bcd8c1c3812ebfd7";
   };
diff --git a/pkgs/stdenv/linux/bootstrap-files/armv6l.nix b/pkgs/stdenv/linux/bootstrap-files/armv6l.nix
index 8541091ded1..eac1fa32b90 100644
--- a/pkgs/stdenv/linux/bootstrap-files/armv6l.nix
+++ b/pkgs/stdenv/linux/bootstrap-files/armv6l.nix
@@ -3,14 +3,15 @@
   # infrastructure team to mirror the job.
   busybox = import <nix/fetchurl.nix> {
     # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv6l.dist/latest
-    # from build: https://hydra.nixos.org/build/113692702
+    # from build: https://hydra.nixos.org/build/114081910
+    name = "busybox";
     url = https://tarballs.nixos.org/sha256/d96c7656bf43e9ab24949a0b7f6c7c4a4daf1f89ce10ea6e86aa645cbff65bce;
-    sha256 = "d96c7656bf43e9ab24949a0b7f6c7c4a4daf1f89ce10ea6e86aa645cbff65bce";
+    sha256 = "1q02537cq56wlaxbz3s3kj5vmh6jbm27jhvga6b4m4jycz5sxxp6";
     executable = true;
   };
   bootstrapTools = import <nix/fetchurl.nix> {
     # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv6l.dist/latest
-    # from build: https://hydra.nixos.org/build/113692702
+    # from build: https://hydra.nixos.org/build/114081910
     url = https://tarballs.nixos.org/sha256/787ce488369504c29c57e36dd25eaf84e8cc8423d9f3da7359daa0023aaafb99;
     sha256 = "787ce488369504c29c57e36dd25eaf84e8cc8423d9f3da7359daa0023aaafb99";
   };
diff --git a/pkgs/stdenv/linux/bootstrap-files/armv7l.nix b/pkgs/stdenv/linux/bootstrap-files/armv7l.nix
index c788b1e436c..be69dd4ca69 100644
--- a/pkgs/stdenv/linux/bootstrap-files/armv7l.nix
+++ b/pkgs/stdenv/linux/bootstrap-files/armv7l.nix
@@ -3,14 +3,15 @@
   # infrastructure team to mirror the job.
   busybox = import <nix/fetchurl.nix> {
     # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv7l.dist/latest
-    # from build: https://hydra.nixos.org/build/113692702
+    # from build: https://hydra.nixos.org/build/114081942
+    name = "busybox";
     url = https://tarballs.nixos.org/sha256/7a7a0266d4687eb1b44496d4d185b9ffa9b1c6260c5df1c40a4999c612312bbd;
-    sha256 = "7a7a0266d4687eb1b44496d4d185b9ffa9b1c6260c5df1c40a4999c612312bbd";
+    sha256 = "18qc6w2yykh7nvhjklsqb2zb3fjh4p9r22nvmgj32jr1mjflcsjn";
     executable = true;
   };
   bootstrapTools = import <nix/fetchurl.nix> {
     # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv7l.dist/latest
-    # from build: https://hydra.nixos.org/build/113692702
+    # from build: https://hydra.nixos.org/build/114081942
     url = https://tarballs.nixos.org/sha256/c727c21ebb863f6e8e88cfef73f4ddb534ae942df1a0f9d2e1d1825b6f843a86;
     sha256 = "c727c21ebb863f6e8e88cfef73f4ddb534ae942df1a0f9d2e1d1825b6f843a86";
   };

@lopsided98
Copy link
Contributor

I applied @thefloweringash's changes and rebased on staging (to get the unpack-boostrap-tools fix), and I am building stdenv for armv7l and armv6l to make sure this still works.

@thefloweringash
Copy link
Member

I've successfully built up to hello for armv7l. I don't think you need to rebase, since 05fc2a3 is an ancestor of this commit.

@lopsided98
Copy link
Contributor

Oh I see; I assumed staging hadn't been merged yet. I'll build it for armv6l then.

@thefloweringash
Copy link
Member

I've verified the tarballs contents match their hash and correspond to the named builds. ✅

Without name = "busybox" I'm getting the "applet not found" error.

@vcunat

This comment has been minimized.

@vcunat
Copy link
Member

vcunat commented Mar 8, 2020

Nitpick: is the URL style intentionally different from the other stdenv-bootstrap tarballs? Those have e.g.

http://tarballs.nixos.org/stdenv-linux/x86_64/c5aabb0d603e2c1ea05f5a93b3be82437f5ebf31/bootstrap-tools.tar.xz;

(where the hash is for nixpkgs git commit, not for contents)

@grahamc
Copy link
Member Author

grahamc commented Mar 8, 2020

Not different on purpose, but I'm feeling too tired today to follow the (new-to-me) directions properly. Can you give me specific instructions? We need to do that before we merge this.

@vcunat
Copy link
Member

vcunat commented Mar 8, 2020

I have no idea about reasons for the style... so your hashedMirrors style might even be preferable AFAIK. (Assuming it's also never garbage-collected, right?) When I was (involved in) updating the tarballs because of the last glibc bump, I just discovered how the URL was composed and kept to the style.

If we were to follow the style currently used for x86_64, I believe the URLs would be:

http://tarballs.nixos.org/stdenv-linux/armv5tel/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/busybox
http://tarballs.nixos.org/stdenv-linux/armv5tel/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/bootstrap-tools.tar.xz
http://tarballs.nixos.org/stdenv-linux/armv6el/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/busybox
http://tarballs.nixos.org/stdenv-linux/armv6el/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/bootstrap-tools.tar.xz
http://tarballs.nixos.org/stdenv-linux/armv7el/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/busybox
http://tarballs.nixos.org/stdenv-linux/armv7el/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/bootstrap-tools.tar.xz

I'm not sure why we typically use http://tarballs.nixos.org. I'd expect https:// to be preferable nowadays, but I don't feel strongly about this case.

@lopsided98
Copy link
Contributor

hello built successfully for armv6l.

@veprbl veprbl linked an issue Mar 8, 2020 that may be closed by this pull request
@vcunat
Copy link
Member

vcunat commented Mar 10, 2020

I see there's now a Hydra machine and a jobset for armv7l (!) That verifies bootstrap in there, but apparently much was failed due to out-of-memory killer.

@misuzu
Copy link
Contributor

misuzu commented Mar 13, 2020

I have successfully built pkgs.nix using this branch on top of master on my armv7 device so it's seems to be good to go.

@grahamc
Copy link
Member Author

grahamc commented Mar 16, 2020

Updated to use the new URLs from @vcunat (thank you for the hard-to-mistake instructions :).)

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still new here, so maybe there's a valid reason you're not following RFC 45. If there is, feel free to disregard this review (though I would like to hear an explanation so I can keep it in mind for the future).

EDIT: LGTM
image

pkgs/stdenv/linux/bootstrap-files/armv5tel.nix Outdated Show resolved Hide resolved
pkgs/stdenv/linux/bootstrap-files/armv5tel.nix Outdated Show resolved Hide resolved
pkgs/stdenv/linux/bootstrap-files/armv6l.nix Outdated Show resolved Hide resolved
pkgs/stdenv/linux/bootstrap-files/armv6l.nix Outdated Show resolved Hide resolved
pkgs/stdenv/linux/bootstrap-files/armv7l.nix Outdated Show resolved Hide resolved
pkgs/stdenv/linux/bootstrap-files/armv7l.nix Outdated Show resolved Hide resolved
@grahamc
Copy link
Member Author

grahamc commented Mar 16, 2020

I need reviews on two things:

First, validate that for each URL, the string between stdenv-linux/ and /0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778 matches the name of the .nix file it is contained. Example: stdenv-linux/armv5tel/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778 is in armv5tel.nix.

Second, clone the repo and: nix-build pkgs/stdenv/linux/bootstrap-files/armv{5tel,6l,7l}.nix then nix-build pkgs/stdenv/linux/bootstrap-files/armv{5tel,6l,7l}.nix --check

Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
@misuzu
Copy link
Contributor

misuzu commented Mar 16, 2020

I can confirm that URL's are correct.

After running nix-build pkgs/stdenv/linux/bootstrap-files/armv{5tel,6l,7l}.nix:

% nix-build pkgs/stdenv/linux/bootstrap-files/armv{5tel,6l,7l}.nix --check
checking outputs of '/nix/store/4pqc9wnk7bl58ldsrp19bag989apycyk-bootstrap-tools.tar.xz.drv'...
checking outputs of '/nix/store/5s7769ikm3q8xj9lqnimxmykmv5skzd1-bootstrap-tools.tar.xz.drv'...
warning: rewriting hashes in '/nix/store/07z7gmwq8hp426lz3jqffkgab2jxi90l-bootstrap-tools.tar.xz'; cross fingers
checking outputs of '/nix/store/df6rmkjx6ibmnciidb1xjb8cvd2s6vsa-bootstrap-tools.tar.xz.drv'...
warning: rewriting hashes in '/nix/store/3m5jx9hphpvgyk1y4xl6briydlr79ry4-bootstrap-tools.tar.xz'; cross fingers
checking outputs of '/nix/store/3f0x83pm1czzzh3xa53sh4k6hvhsrk1r-busybox.drv'...
warning: rewriting hashes in '/nix/store/rs65pfdrqvzw6h65i2jwdxkksvp0m459-busybox'; cross fingers
checking outputs of '/nix/store/cn5zp12vp0k2bm97k6ykr84mkw43bvlh-busybox.drv'...
warning: rewriting hashes in '/nix/store/mg8nzxs7mmg6ff47fgv8i61g6m818r8g-busybox'; cross fingers
checking outputs of '/nix/store/cw8afs6r5dnbvqwf7bnc8w86pd4x756b-busybox.drv'...
warning: rewriting hashes in '/nix/store/imsbql435j383ha6q6nlwn5bmqdnaqhq-busybox'; cross fingers
warning: rewriting hashes in '/nix/store/iwd9w34aif01zrs1bxz5kcdkawkv7i0a-bootstrap-tools.tar.xz'; cross fingers
/nix/store/07z7gmwq8hp426lz3jqffkgab2jxi90l-bootstrap-tools.tar.xz
/nix/store/rs65pfdrqvzw6h65i2jwdxkksvp0m459-busybox
/nix/store/3m5jx9hphpvgyk1y4xl6briydlr79ry4-bootstrap-tools.tar.xz
/nix/store/mg8nzxs7mmg6ff47fgv8i61g6m818r8g-busybox
/nix/store/iwd9w34aif01zrs1bxz5kcdkawkv7i0a-bootstrap-tools.tar.xz
/nix/store/imsbql435j383ha6q6nlwn5bmqdnaqhq-busybox

@grahamc grahamc merged commit 5e57bea into master Mar 16, 2020
@grahamc grahamc deleted the arm-bootstrap branch March 16, 2020 23:36
@vcunat
Copy link
Member

vcunat commented Mar 17, 2020

I believe this MR should be picked to release-20.03. Any opinions? @NixOS/nixos-release-managers New glibc is in there as well, so the bootstrap is surely broken in there.

@lopsided98
Copy link
Contributor

If this is backported, make sure #79793 is as well.

@expipiplus1
Copy link
Contributor

It would be great to have this backported

sarcasticadmin pushed a commit to sarcasticadmin/nixpkgs that referenced this pull request Aug 3, 2020
stdenv: update ARM bootstrap tarballs
andrew-d added a commit to andrew-d/nixpkgs that referenced this pull request Nov 19, 2020
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.

Unable to build glibc on armv7l
7 participants