Git Ref versions can be paired to defined versions in the spec (#30998)

The current use of git ref's as a version requires a search algorithm to pick the right matching version based on the tags in the git history of the package.

This is less than ideal for the use case where users already know the specific version they want the git ref to be associated with. This PR makes a new version syntax [package]@[ref]=[version] to allow the users to specify the exact hash they wish to use.
This commit is contained in:
psakievich
2022-08-04 14:17:34 -06:00
committed by GitHub
parent 19a8bb53f0
commit 3b1401f292
11 changed files with 180 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class DependsOnDevelop(Package):
homepage = "example.com"
url = "fake.com"
version("main", branch="main")
version("0.0.0", sha256="0123456789abcdef0123456789abcdef")
depends_on("develop-branch-version@develop")

View File

@@ -0,0 +1,17 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class DevelopBranchVersion(Package):
"""Dummy package with develop version"""
homepage = "http://www.openblas.net"
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
git = "https://github.com/dummy/repo.git"
version("develop", branch="develop")
version("0.2.15", "b1190f3d3471685f17cfd1ec1d252ac9")