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

bundler: hash mismatch of source #6326

Closed
rzetterberg opened this issue Feb 13, 2015 · 9 comments
Closed

bundler: hash mismatch of source #6326

rzetterberg opened this issue Feb 13, 2015 · 9 comments
Labels
0.kind: bug Something is broken

Comments

@rzetterberg
Copy link
Member

When activating the gitlab service and rebuilding:

    services.gitlab = { 
      enable = true;
      databasePassword = "removed-for-issue-report";
    }; 
[zed@nixos-workstation:~]$ sudo nix-channel --update
[zed@nixos-workstation:~]$ sudo nixos-rebuild switch --upgrade --verbose

Fails with:

trying https://rubygems.org/downloads/mysql2-0.3.16.gem
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   154  100   154    0     0    131      0  0:00:01  0:00:01 --:--:--   131Receiving objects:  77% (84150/109285), 16.73 MiB | 494.00 KiB/s   
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0scanning for references inside ‘/nix/store/p65pkq14sdjb6vq7clpwyv3qqj7x9718-bundler-a2343c9’
output path ‘/nix/store/p65pkq14sdjb6vq7clpwyv3qqj7x9718-bundler-a2343c9’ should have r:sha256 hash ‘1l4r55n1wzr817l225l6pm97li1mxg9icd8s51cpfihh91nkdz68’, instead has ‘0l9ghs6xg0pv3ssik807jcvai3f0w83cskx7ymq6kr8f1h8lqbp0’
building path(s) ‘/nix/store/34n6wbchzi8fvskxarsj8wd979j902zk-mysql2-pre-install’
cannot build derivation ‘/nix/store/l248881kizq0wm296syb0g0ck0rpfppg-ruby-2.1.3-p0-bundler-HEAD.drv’: 1 dependencies couldn't be built

System specs

[zed@nixos-workstation:~]$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
[zed@nixos-workstation:~]$ uname -a
Linux nixos-workstation 3.14.29 #1-NixOS SMP Thu Jan 1 00:00:01 UTC 1970 x86_64 GNU/Linux

Misc

For convenience here is the link to the latest commit to ruby-bundler: 7d8b2f0#diff-7cde46455d84d468d1a1b9c57fc96287

I does not seem like that commit introduced the problem. The hash was changed from 1f0isjrn4rwak3q6sbs6v6gqhwln32gv2dbd98r902nkg9i7y5i0 to 1l4r55n1wzr817l225l6pm97li1mxg9icd8s51cpfihh91nkdz68, but the actual output on my machine was 0l9ghs6xg0pv3ssik807jcvai3f0w83cskx7ymq6kr8f1h8lqbp0.

cc @cstrahan

I can provide more information on request. I'm still pretty new to NixOS so I'm not sure what kind of information is relevant for creating issues.

@rzetterberg rzetterberg changed the title gitlab: fails due to hash mismatch in ruby gem when building bundler gitlab: fails due to hash mismatch when building bundler Feb 13, 2015
benley added a commit to benley/nixpkgs that referenced this issue Feb 17, 2015
Hopefully fixes NixOS#6326

I worry that fetchgit's current implementation isn't quite fully
deterministic when leaveDotGit is enabled.

Change-Id: Ieece4b6305da759aff3f284f41c0959c5d6375cf
benley added a commit to benley/nixpkgs that referenced this issue Feb 19, 2015
Hopefully fixes NixOS#6326

I worry that fetchgit's current implementation isn't quite fully
deterministic when leaveDotGit is enabled.

Change-Id: Ieece4b6305da759aff3f284f41c0959c5d6375cf
(cherry picked from commit 37d8100)
@rzetterberg
Copy link
Member Author

An update on this issue, I just reproduced the bug on my machine. This time the output hash was different from the first time I tried:

output path ‘/nix/store/p65pkq14sdjb6vq7clpwyv3qqj7x9718-bundler-a2343c9’ should have r:sha256 hash ‘1l4r55n1wzr817l225l6pm97li1mxg9icd8s51cpfihh91nkdz68’, instead has ‘1fywz0m3bb0fmcikhqbw9iaw67k29srwi8dllq6ni1cbm1xfyj46’
building path(s) ‘/nix/store/04h4awa2x6v697kfpdzbbzkr3q2r45ga-gon-5.0.1.gem’
cannot build derivation ‘/nix/store/l248881kizq0wm296syb0g0ck0rpfppg-ruby-2.1.3-p0-bundler-HEAD.drv’: 1 dependencies couldn't be built

@cstrahan
Copy link
Contributor

@rzetterberg Are you on Linux or Darwin?

EDIT: Oops! Just saw your "System specs" you posted earlier. I'll give this some thought...

@cstrahan
Copy link
Contributor

@rzetterberg Do you have chroot builds enabled? (nix.useChroot = true; in /etc/nixos/configuration.nix)

I forget just how impure non-chroot builds are... but a hunch is that custom git hooks could be polluting the checkout. (I think that $HOME is set either way, so I sorta doubt this hunch of mine.)

@rzetterberg
Copy link
Member Author

@cstrahan I have not set useChroot, so it's using the default value. Should I set it to true and try again?

I checked the bundler repo to see whether there are any git hooks used, and it seems there are no hooks (only samples) in the .git/hooks directory:

zed@shinji:~/tmp/bundler/.git/hooks$ ls -la
total 48
drwxr-xr-x 2 zed zed 4096 Feb 21 11:56 .
drwxr-xr-x 8 zed zed 4096 Feb 21 11:57 ..
-rwxr-xr-x 1 zed zed  452 Feb 21 11:55 applypatch-msg.sample
-rwxr-xr-x 1 zed zed  896 Feb 21 11:55 commit-msg.sample
-rwxr-xr-x 1 zed zed  189 Feb 21 11:55 post-update.sample
-rwxr-xr-x 1 zed zed  398 Feb 21 11:55 pre-applypatch.sample
-rwxr-xr-x 1 zed zed 1642 Feb 21 11:55 pre-commit.sample
-rwxr-xr-x 1 zed zed 1239 Feb 21 11:55 prepare-commit-msg.sample
-rwxr-xr-x 1 zed zed 1352 Feb 21 11:55 pre-push.sample
-rwxr-xr-x 1 zed zed 4898 Feb 21 11:55 pre-rebase.sample
-rwxr-xr-x 1 zed zed 3611 Feb 21 11:55 update.sample

@vcunat vcunat changed the title gitlab: fails due to hash mismatch when building bundler bundler: hash mismatch of source Feb 21, 2015
@vcunat
Copy link
Member

vcunat commented Feb 21, 2015

Chrooting is irrelevant, as AFAIK fixed-output derivations are never chrooted, and they have network access, etc. Better discuss this just on #6409, as there are some more relevant discussions about leaveDotGit.

@vcunat vcunat added the 0.kind: bug Something is broken label Feb 21, 2015
@rzetterberg
Copy link
Member Author

After c00d36f this is problem was resolved for me. Can I close this issue? @vcunat

@vcunat
Copy link
Member

vcunat commented Mar 6, 2015

That commit probably wasn't affecting this. Anyway, if it works now...

@vcunat vcunat closed this as completed Mar 6, 2015
@anderspapitto
Copy link
Contributor

I'm seeing this same issue today, on the latest unstable

@vcunat
Copy link
Member

vcunat commented Aug 3, 2015

That's what fetchgit with leaveDotGit currently does: #8567.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants