forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix patched dependencies across repositories (spack#42463)
Currently, if a package has a dependency from another repository and patches it, generation of the patch cache will fail. Concretization succeeds if a fixed patch cache is in place. - [x] don't assume that patched dependencies are in the same repo when indexing - [x] add some test fixtures to support multi-repo tests. --------- Signed-off-by: Todd Gamblin <tgamblin@llnl.gov> Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
- Loading branch information
Showing
11 changed files
with
80 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# `builtin.mock` | ||
|
||
This repository and the secondary mock repo `builtin.mock2` contain mock packages used | ||
by Spack tests. | ||
|
||
Most tests are in `builtin.mock`, but `builtin.mock2` is used for scenarios where we | ||
need multiple repos for testing. |
11 changes: 11 additions & 0 deletions
11
var/spack/repos/builtin.mock/packages/patch-a-foreign-dependency/mock2-package.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- patch-a-dependency/configure 2018-08-13 23:13:51.000000000 -0700 | ||
+++ patch-a-dependency/configure.patched 2018-08-13 23:14:15.000000000 -0700 | ||
@@ -2,7 +2,7 @@ | ||
prefix=$(echo $1 | sed 's/--prefix=//') | ||
cat > Makefile <<EOF | ||
all: | ||
- echo Building... | ||
+ echo Patched! | ||
|
||
install: | ||
mkdir -p $prefix |
17 changes: 17 additions & 0 deletions
17
var/spack/repos/builtin.mock/packages/patch-a-foreign-dependency/package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2013-2024 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 PatchAForeignDependency(Package): | ||
"""Package that requries a patched version of a dependency.""" | ||
|
||
homepage = "http://www.example.com" | ||
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz" | ||
|
||
version("1.0", md5="0123456789abcdef0123456789abcdef") | ||
|
||
depends_on("mock2-patched-dependency", patches=patch("mock2-package.patch")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# `builtin.mock2` | ||
|
||
This is the secondary mock repo for testing Spack, along with `builtin.mock`. | ||
|
||
Most tests are in `builtin.mock`, but this repository is used for scenarios where we | ||
need multiple repos for testing. |
15 changes: 15 additions & 0 deletions
15
var/spack/repos/builtin.mock2/packages/mock2-patched-dependency/package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2013-2024 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 Mock2PatchedDependency(Package): | ||
"""Package patched by patch-a-foreign-dependency in builtin.mock.""" | ||
|
||
homepage = "http://www.example.com" | ||
url = "http://www.example.com/mock2-patch-dependency-1.0.tar.gz" | ||
|
||
version("1.0", md5="0123456789abcdef0123456789abcdef") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
repo: | ||
namespace: 'builtin.mock2' |