From 3b1401f2921d81740c2d17d96a3b25d7ecb4a299 Mon Sep 17 00:00:00 2001 From: psakievich Date: Thu, 4 Aug 2022 14:17:34 -0600 Subject: 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. --- .../builtin.mock/packages/depends-on-develop/package.py | 17 +++++++++++++++++ .../packages/develop-branch-version/package.py | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/depends-on-develop/package.py create mode 100644 var/spack/repos/builtin.mock/packages/develop-branch-version/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/depends-on-develop/package.py b/var/spack/repos/builtin.mock/packages/depends-on-develop/package.py new file mode 100644 index 0000000000..94d0c091d8 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/depends-on-develop/package.py @@ -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") diff --git a/var/spack/repos/builtin.mock/packages/develop-branch-version/package.py b/var/spack/repos/builtin.mock/packages/develop-branch-version/package.py new file mode 100644 index 0000000000..2f8c96352e --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/develop-branch-version/package.py @@ -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") -- cgit v1.2.3-60-g2f50