Skip to content

checksum does not use url created in url_for #15985

@jacobmerson

Description

@jacobmerson

spack checksum does not use the url_for function to look for versions that may be located at different urls

Steps to reproduce the issue

Create test package

from spack.spec import ConflictsInSpecError


yaml_cpp_tests_libcxx_error_msg = 'yaml-cpp tests incompatible with libc++'


class TestPackage(CMakePackage):
    """A YAML parser and emitter in C++"""

    homepage = "https://github.com/jbeder/yaml-cpp"
    #url      = "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.5.3.tar.gz"
    git      = "https://github.com/jbeder/yaml-cpp.git"

    def url_for_version(self, version):
        url = "https://github.com/jbeder/yaml-cpp/archive/{0}-{1}.tar.gz"
        if version < Version('0.5.3'):
            return url.format('release',version)
        else:
            return url.format('yaml-cpp',version)
$ spack checksum test-package
Error: Could not find any versions for test-package

Error Message

$ spack --debug --stacktrace checksum test-package
lib/spack/spack/cmd/__init__.py:102 ==> [2020-04-09-21:17:37.863469, 19046] Imported checksum from built-in commands
lib/spack/spack/cmd/__init__.py:102 ==> [2020-04-09-21:17:37.864401, 19046] Imported checksum from built-in commands
lib/spack/spack/config.py:727 ==> [2020-04-09-21:17:37.866602, 19046] Reading config file /lore/mersoj/spack/spack/etc/spack/defaults/repos.yaml
lib/spack/spack/config.py:727 ==> [2020-04-09-21:17:37.868508, 19046] Reading config file /users/mersoj/.spack/linux/repos.yaml
lib/spack/spack/cmd/checksum.py:56 ==> [2020-04-09-21:17:37.961179, 19046] Error: Could not find any versions for test-package
lib/spack/spack/config.py:727 ==> [2020-04-09-21:17:37.961651, 19046] Reading config file /lore/mersoj/spack/spack/etc/spack/defaults/config.yaml
lib/spack/spack/config.py:727 ==> [2020-04-09-21:17:37.978666, 19046] Reading config file /users/mersoj/.spack/config.yaml
Traceback (most recent call last):
  File "/lore/mersoj/spack/spack/lib/spack/spack/main.py", line 763, in main
    return _invoke_command(command, parser, args, unknown)
  File "/lore/mersoj/spack/spack/lib/spack/spack/main.py", line 488, in _invoke_command
    return_val = command(parser, args)
  File "/lore/mersoj/spack/spack/lib/spack/spack/cmd/checksum.py", line 56, in checksum
    tty.die("Could not find any versions for {0}".format(pkg.name))
  File "/lore/mersoj/spack/spack/lib/spack/llnl/util/tty/__init__.py", line 227, in die
    sys.exit(1)
SystemExit: 1

Information on your system

  • Spack: 0.14.1-589-0c0c666
  • Python: 2.7.5
  • Platform: linux-rhel7-skylake

Additional information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions