Skip to content

spack checksum and spack fetch use different URLs on GitHub #14129

@phxyz12

Description

@phxyz12

Hi

I tried to install the minimap2 package and to get the latest version, I first ran

spack checksum minimap2

to get the checksum of the latest version. I added this version to the minimap2 package.py file and tried to install:

spack install minimap2 target=x86_64

The install fails due to an incorrect checksum.

Steps to reproduce the issue

$ spack checksum minimap2

I select 1 version to checksum and it checksums:

==> Fetching https://github.com/lh3/minimap2/releases/download/v2.17/minimap2-2.17_x64-linux.tar.bz2
######################################################################## 100.0%
==> Checksummed 1 version of minimap2

    version('2.17', sha256='fe97310cf9abc165de2e17d41b68ee5a1003be3ff742179edef38fcf8a089a47')

Ì add obtained new checksum to package.py

$ spack install minimap2 target=x86_64

Error Message

==> [2019-12-12-11:53:03.609691] ChildError: ChecksumError: sha256 checksum failed for /tmp/swadm/spack-stage/spack-stage-minimap2-2.17-7yspvebtasklxkzbh6nxlneem47yyamp/minimap2-2.17.tar.bz2
    Expected fe97310cf9abc165de2e17d41b68ee5a1003be3ff742179edef38fcf8a089a47 but got b68ac8882d33cc63e9e3246775062aeb159b6990ff7f38099172c3fe6f8a2742
/data/swadm/spack/v0.13/spack/lib/spack/spack/package.py:1083, in do_fetch:
       1080        self.stage.fetch(mirror_only)
       1081        self._fetch_time = time.time() - start_time
       1082
  >>   1083        if checksum and self.version in self.versions:
       1084            self.stage.check()
       1085
       1086        self.stage.cache_local()

Traceback (most recent call last):
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/build_environment.py", line 815, in child_process
    return_value = function()
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/package.py", line 1662, in build_process
    self.do_patch()
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/package.py", line 1119, in do_patch
    self.do_stage()
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/package.py", line 1104, in do_stage
    self.do_fetch(mirror_only)
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/package.py", line 1084, in do_fetch
    self.stage.check()
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/util/pattern.py", line 68, in getter
    getattr(item, self.name)(*args, **kwargs)
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/stage.py", line 487, in check
    self.fetcher.check()
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/fetch_strategy.py", line 76, in wrapper
    return fun(self, *args, **kwargs)
  File "/data/swadm/spack/v0.13/spack/lib/spack/spack/fetch_strategy.py", line 490, in check
    "Expected %s but got %s" % (self.digest, checker.sum))
ChecksumError: sha256 checksum failed for /tmp/swadm/spack-stage/spack-stage-minimap2-2.17-7yspvebtasklxkzbh6nxlneem47yyamp/minimap2-2.17.tar.bz2
    Expected fe97310cf9abc165de2e17d41b68ee5a1003be3ff742179edef38fcf8a089a47 but got b68ac8882d33cc63e9e3246775062aeb159b6990ff7f38099172c3fe6f8a2742

As you can see, the files on github, that spack uses during checksum and install are not the same:

During checksum: minimap2/releases/download/v2.17/minimap2-2.17_x64-linux.tar.bz2

During install: minimap2/releases/download/v2.17/minimap2-2.17.tar.bz2

The latter file would be the correct one since the file minimap2-2.17_x64-linux.tar.bz2 contains binaries.

Information on your system

Platform: CentOS 7.7
Spack: 0.13.2
Uname -a: Linux build02.hpc.zhaw.ch 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchecksumTarball checksum mismatches.fetching

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions