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

wrong hash for google-protobuf-3.23.3 #109

Open
brianmay opened this issue Jul 4, 2023 · 5 comments
Open

wrong hash for google-protobuf-3.23.3 #109

brianmay opened this issue Jul 4, 2023 · 5 comments

Comments

@brianmay
Copy link

brianmay commented Jul 4, 2023

Gemfile:

source 'https://rubygems.org'

gem 'jekyll'

gem "html-proofer"

group :jekyll_plugins do
      gem 'RbST'
      gem 'jekyll-paginate'
      gem 'jekyll-environment-variables'
end

flake.nix:

{
  description = "Brian's website";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};

        # Generate a user-friendly version number.
        version = builtins.substring 0 8 self.lastModifiedDate;

        gems = pkgs.bundlerEnv {
          name = "gems";
          ruby = pkgs.ruby;
          # gemfile = ./Gemfile;
          # lockfile = ./Gemfile.lock;
          # gemset = ./gemset.nix;
          gemdir = ./.;
        };

      in {
        packages.default = pkgs.stdenv.mkDerivation {
          name = "penguin_brian-${version}";
          src = ./.;
          buildInputs = [ gems ];
          buildPhase = ''
            export VCS_REF="${self.rev}"
            export BUILD_DATE="${version}"
            ${gems}/bin/jekyll build --destination _site
          '';
          installPhase = ''
            mkdir -p $out
            cp -r _site $out/_site
          '';
        };
        devShells.default =
          pkgs.mkShell { buildInputs = [ gems pkgs.bundix ]; };
      });
}

Script for testing:

#!/bin/sh
set -ex
rm gemset.nix Gemfile.lock
nix-shell -p bundler --command "bundle install"
nix-shell -p bundix --command "bundix -l"
nix shell

Gives:

+ nix shell
error: hash mismatch in fixed-output derivation '/nix/store/xjgf6kmjnv7ir3nc9b3vgyd6bihnprf3-google-protobuf-3.23.3.gem.drv':
         specified: sha256-ooB3Xmsyd7So4evckfK7eDe881Xj1VCFUUgpoHZfBAs=
            got:    sha256-TbwKKNuVnNN8y7BA2lxUt71nLvO5I9DdCpnqJsvfn6k=
error: 1 dependencies of derivation '/nix/store/pdn8sdpq1js03r1y74gb25wdm1pyypkz-ruby3.1.4-google-protobuf-3.23.3.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7nq9b2f87w7xzh9ax0zrybb69971zkyr-gems.drv' failed to build
error: 1 dependencies of derivation '/nix/store/aj87kspn9jrlrm2yzmaa1m7lsijgp549-penguin_brian-20230704.drv' failed to build
@rsoeldner
Copy link

I actually run into this too.

@brianmay
Copy link
Author

Work around is:

BUNDLE_FORCE_RUBY_PLATFORM=true nix run 'nixpkgs#bundix' -- --lock

I believe these issues are the same (although there are very different symptoms):

@brianmay
Copy link
Author

Correction: appeared to work initially, but got the nokogiri build error back again.

brianmay added a commit to brianmay/penguin_brian that referenced this issue Jul 18, 2023
@fzakaria
Copy link

fzakaria commented Jul 2, 2024

I am hitting this too; just upgraded from an old version.

Very unfortunate.

@trya2l
Copy link

trya2l commented Aug 8, 2024

I face the same issue with the sqlite3 gem included in the vanilla Gemfile from the rails new <project-name> command

error: hash mismatch in fixed-output derivation '/nix/store/wnx60m5zmhq2gnzwgd1nrr83nkrjf8wi-sqlite3-1.7.3.gem.drv':

specified: sha256-UioyhWYN7IJTRliAyXmA6HPbDXkGCQC+jRQZQhej7nM=
got:       sha256-+nf2PHCVSPRtTptrtFzaUqo4gaoSzIWZETJ1jolocBw=

edit: considering the state of the project, I'd suggest using devbox instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants