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

bionic: use fetchzip for everything #123010

Merged
merged 1 commit into from May 16, 2021

Conversation

sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented May 14, 2021

Since the hashes of the remaining two archives that used fetchurl broke,
now as good a time as any to switch the remaining fetchurls to fetchzip.

Motivation for this change
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.

@veprbl
Copy link
Member

veprbl commented May 14, 2021

/rebase master

@github-actions
Copy link
Contributor

Failed to rebase

@sternenseemann
Copy link
Member Author

The bionic-prebuilt dir thing is new in staging.

Since the hashes of the remaining two archives that used fetchurl broke,
now as good a time as any to switch the remaining fetchurls to fetchzip.
@veprbl
Copy link
Member

veprbl commented May 15, 2021

I saw this was build by ofborg previously, but for some reason the download doesn't work for me:

# cat test.nix
with import <nixpkgs> { };
[
  (
    fetchzip {
      url = "https://android.googlesource.com/kernel/common/+archive/48ffcbf0b9e7f0280bfb8c32c68da0aaf0fdfef6.tar.gz";
      sha256 = "1y7cmlmcr5vdqydd9n785s139yc4aylc3zhqa59xsylmkaf5habk";
      stripRoot = false;
    }
  )
  (
    fetchzip {
      url = "https://android.googlesource.com/platform/bionic/+archive/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz";
      sha256 = "10z5mp4w0acvjvgxv7wlqa7m70hcyarmjdlfxbd9rwzf4mrsr8d1";
      stripRoot = false;
    }
  )
]
# nix build -f test.nix -L
source> trying https://android.googlesource.com/platform/bionic/+archive/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz
source>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
source>                                  Dload  Upload   Total   Spent    Left  Speed
source> 100 6018k    0 6018k    0     0  2509k      0 --:--:--  0:00:02 --:--:-- 2509k
source> unpacking source archive /private/tmp/nix-build-source.drv-0/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz
error: --- Error --------------------------------------------------------------------------------------------------------------------------- nix
hash mismatch in fixed-output derivation '/nix/store/ka54372nq9qjlz2qa78rlc9qcvfzr926-source.drv':
  specified: sha256-oaGscyXu85za6o42WbPyDIJTj8KUn93flpspwMmt5YM=
     got:    sha256-x17xkM9TfbJdFyUT5E3lpDpumSiJCu+oe2bimm9A1KU=
source> trying https://android.googlesource.com/kernel/common/+archive/48ffcbf0b9e7f0280bfb8c32c68da0aaf0fdfef6.tar.gz
source>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
source>                                  Dload  Upload   Total   Spent    Left  Speed
source> 100  166M    0  166M    0     0  2471k      0 --:--:--  0:01:09 --:--:-- 2538k
source> unpacking source archive /private/tmp/nix-build-source.drv-0/48ffcbf0b9e7f0280bfb8c32c68da0aaf0fdfef6.tar.gz
warning: --- Large path -------------------------------------------------------------------------------------------------------------------- nix
dumping very large path (> 256 MiB); this may run out of memory
error: --- Error --------------------------------------------------------------------------------------------------------------------------- nix
hash mismatch in fixed-output derivation '/nix/store/m56dqkiv0lfxcd8n4y07qww8b9fkb0ss-source.drv':
  specified: sha256-cylYnJqVet1TURj+wahXhPk0gi7o2NSax22XzCqt7Pg=
     got:    sha256-fY1PDi494RES+shh25KvyJ/yD8V70kQsF+zRh4MtD3k=
# nix hash to-base32 sha256-oaGscyXu85za6o42WbPyDIJTj8KUn93flpspwMmt5YM=
10z5mp4w0acvjvgxv7wlqa7m70hcyarmjdlfxbd9rwzf4mrsr8d1
# nix hash to-base32 sha256-cylYnJqVet1TURj+wahXhPk0gi7o2NSax22XzCqt7Pg=
1y7cmlmcr5vdqydd9n785s139yc4aylc3zhqa59xsylmkaf5habk

@sternenseemann
Copy link
Member Author

Interesting, so maybe not only the archive hash is unstable, but its contents as well?

@veprbl
Copy link
Member

veprbl commented May 15, 2021

Interesting, so maybe not only the archive hash is unstable, but its contents as well?

If you want to look into this:

cachix use pr123010
nix-store -r /nix/store/26axwvyslbxd4jvx7x4iyn1p2rm5q6gq-source
nix-store -r /nix/store/fcydcc3fzpvpi65l3b00ilqfxwkcy4h5-source

I think this might be because of the case-insensitive filesystem

@sternenseemann
Copy link
Member Author

I can reproduce the hashes of your test.nix.

nix-build test.nix --check
checking outputs of '/nix/store/5b89ra6sl2wih65sbdwakwp8xx0bx989-source.drv'...
checking outputs of '/nix/store/vayl3g3ri1b07pc1jixm2vpjwj84didn-source.drv'...

trying https://android.googlesource.com/platform/bionic/+archive/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz

trying https://android.googlesource.com/kernel/common/+archive/48ffcbf0b9e7f0280bfb8c32c68da0aaf0fdfef6.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6018k    0 6018k    0     0  2382k      0 --:--:--  0:00:02 --:--:-- 2382k
unpacking source archive /build/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz
100  166M    0  166M    0     0  3269k      0 --:--:--  0:00:52 --:--:-- 3435k
unpacking source archive /build/48ffcbf0b9e7f0280bfb8c32c68da0aaf0fdfef6.tar.gz
/nix/store/md870bmi589116igv8py89zw0nls98qk-source
/nix/store/pq5jz0zr6dvhq9c14nwn0mpjy32b38vk-source

Not sure what you are getting at with the binary cache, of course I can successfully download already built fixed output derivations…

@veprbl
Copy link
Member

veprbl commented May 15, 2021

Seems like there is indeed a case collision

# ls /nix/store/pq5jz0zr6dvhq9c14nwn0mpjy32b38vk-source/libc/versioner-dependencies/common/kernel_uapi/linux/netfilter/xt_[cC][oO][nN][nN][mM][aA][rR][kK]*
/nix/store/pq5jz0zr6dvhq9c14nwn0mpjy32b38vk-source/libc/versioner-dependencies/common/kernel_uapi/linux/netfilter/xt_CONNMARK.h
/nix/store/pq5jz0zr6dvhq9c14nwn0mpjy32b38vk-source/libc/versioner-dependencies/common/kernel_uapi/linux/netfilter/xt_connmark.h~nix~case~hack~1
# ls /nix/store/26axwvyslbxd4jvx7x4iyn1p2rm5q6gq-source/libc/versioner-dependencies/common/kernel_uapi/linux/netfilter/xt_[cC][oO][nN][nN][mM][aA][rR][kK]*
/nix/store/26axwvyslbxd4jvx7x4iyn1p2rm5q6gq-source/libc/versioner-dependencies/common/kernel_uapi/linux/netfilter/xt_connmark.h

The ~nix~case~hack~ comes from https://github.com/NixOS/nix/blob/7c90552879da4d1df99b50c85e94201981e60123/src/libutil/archive.cc#L259

@veprbl veprbl added this to WIP in Staging via automation May 15, 2021
@veprbl veprbl moved this from WIP to Ready in Staging May 15, 2021
Copy link
Contributor

@s1341 s1341 left a comment

Choose a reason for hiding this comment

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

LGTM

@veprbl veprbl merged commit bc6da68 into NixOS:staging May 16, 2021
Staging automation moved this from Ready to Done May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants