spack / spack/spack

Issue with patch cache when branch is used as a version

Open
#32,044 2 comments 0 reactions 1 assignee View on GitHub

@becker33 is already working on this.

Since Aug 10, 2022.

bug triage
Dominant language
Python
Stars
5.1k
Forks
2.5k
Avg merge
3d 4h
Merged PRs (30d)
82

Description

Steps to reproduce

I tried to install a development branch of the ESMF package but it did not work. I just add following code to ESMF package.py to make available all branches and tags in the package.

   import subprocess
...
...
...
   # list refs/heads and refs/tags and add them as version
    git_exe = which('git', required=True)
    cmd = '{} ls-remote --refs {}'.format(git_exe, git)
    git_lst = subprocess.run(cmd, shell=True, text=True, stdout=subprocess.PIPE).stdout.splitlines()

    # loop over list and define them as version
    for item in git_lst:
        # split item as hash, branch/tag name
        item_lst = list(item.split('\t'))

        # replace / with _ in version name since spack does not good with / in the version string
        _name = item_lst[1]
        refs_name = _name.replace('refs/heads/', '')
        refs_name = refs_name.replace('refs/tags/', '')
        version_name = refs_name.replace('/', '_')

        # skip some common branches
        if 'gh-pages' in _name:
            continue

        # add tags and branches to the version
        if 'refs/tags' in _name:
            version(version_name, tag=refs_name)
        elif 'refs/heads' in _name:
            version(version_name, branch=refs_name)

and then I tried to install esmf@io_multitile.

Error message

spack_debug.txt

Information on your system
  • Spack: 0.18.0 (b071aa6bdec725a2912b9fb34d579cfa07da6c2d)
  • Python: 3.10.4
  • Platform: linux-ubuntu22.04-haswell
  • Concretizer: clingo
General 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.