Search code examples
pythonmacosunixmd5spack

spack expected <commit> but got <commit>


I want to install nalu with spack. My install failed with a cryptic error message:

$ spack clean nalu
==> Cleaning build stage [nalu@master%[email protected] build_type=RelWithDebInfo ~openfast arch=darwin-sierra-x86_64 /5vijzp7]

$ spack install nalu
==> pkg-config is already installed in /Users/kilojoules/spack/opt/spack/darwin-sierra-x86_64/clang-8.1.0-apple/pkg-config-0.29.2-72rz43flet5qcqtnx6zimnqy4ilk3tys
 ......
==> superlu is already installed in /Users/kilojoules/spack/opt/spack/darwin-sierra-x86_64/clang-8.1.0-apple/superlu-4.3-yveqzmkbbuutdcdj27m5cyyqlchwzvql
==> trilinos is already installed in /Users/kilojoules/spack/opt/spack/darwin-sierra-x86_64/clang-8.1.0-apple/trilinos-12.12.1-ff27cjskjbktug3ubqwdg5izvutewyjj
==> Installing yaml-cpp
==> Already downloaded /Users/kilojoules/spack/var/spack/stage/yaml-cpp-0.5.3-x7shbh5adkjvzxrjmfdlppt3ka5v6moy/yaml-cpp-0.5.3.tar.gz
==> Error: ChecksumError: md5 checksum failed for /Users/kilojoules/spack/var/spack/stage/yaml-cpp-0.5.3-x7shbh5adkjvzxrjmfdlppt3ka5v6moy/yaml-cpp-0.5.3.tar.gz
    Expected 4e47733d98266e46a1a73ae0a72954eb but got 2bba14e6a7f12c7272f87d044e4a7211
ChecksumError: ChecksumError: md5 checksum failed for /Users/kilojoules/spack/var/spack/stage/yaml-cpp-0.5.3-x7shbh5adkjvzxrjmfdlppt3ka5v6moy/yaml-cpp-0.5.3.tar.gz
    Expected 4e47733d98266e46a1a73ae0a72954eb but got 2bba14e6a7f12c7272f87d044e4a7211

/Users/kilojoules/spack/lib/spack/spack/package.py:997, in do_fetch:
     29            self._fetch_time = time.time() - start_time
     30    
     31            if spack.do_checksum and self.version in self.versions:
  >> 32                self.stage.check()
     33    
     34            self.stage.cache_local()

I tried to go to the folder in question and check out the commit it expected but I couldn't find version control specifications in /Users/kilojoules/spack/var/spack/stage/yaml-cpp-0.5.3-x7shbh5adkjvzxrjmfdlppt3ka5v6moy.

What could this mean? How can I resolve this issue?


Solution

  • This error message means that Spack downloaded the yaml-cpp-0.5.3.tar.gz tarball but the checksum for this tarball does not match the checksum listed in the package.py.

    In this case, what happened was that you downloaded yaml-cpp, then GitHub changed their automatic tarball generation algorithm, then the checksum in the package.py was updated upstream. See https://github.com/spack/spack/pull/6924 for more information.

    To resolve your problem, either manually delete the tarball or run spack clean --downloads to delete all cached tarballs.

    P.S. Spack isn't currently very active on StackOverflow. You're better off asking on GitHub or Slack.