Skip to content

Mirrors cannot handle multiple files/patches with the same name #13611

@michaelkuhn

Description

@michaelkuhn

#12940 changed mirrors to fetch all patches by default. This exposed problems with mirror functionality for at least mpfr.

mpfr has multiple patches with the same name (allpatches):

    for ver, checksum in patches.items():
        patch('https://www.mpfr.org/mpfr-{0}/allpatches'.format(ver),
              when='@' + ver, sha256=checksum)

This has not caused problems in the past as long as only one version of mpfr was mirrored.

Steps to reproduce the issue

$ spack mirror create -d $PWD/mirror [email protected]
$ spack mirror add local file://$PWD/mirror

If you switch the order of the calls, create will fail because it will fetch the patch for version 4.0.2 from the mirror:

==> Warning: Error while fetching [email protected]
sha256 checksum failed for .../spack-stage-yb7f7pks/allpatches

Error Message

$ spack fetch [email protected]
==> Error: md5 checksum failed for .../spack-stage-8yao6v10/allpatches
Expected 66a5d58364113a21405fc53f4a48f4e8 but got c4b23018001234d80ee3747721011162

allpatches in the mirror directory will actually point at the patch for version 4.0.2.

cc @scheibelp

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions