Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
9cbe358f
Commit
9cbe358f
authored
4 years ago
by
Scott Wittenburg
Committed by
Gregory Becker
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix/install missing compiler from buildcache (#17536)
Ensure compilers installed from buildcache are registered.
parent
27af499b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/installer.py
+3
-0
3 additions, 0 deletions
lib/spack/spack/installer.py
lib/spack/spack/test/cmd/install.py
+37
-0
37 additions, 0 deletions
lib/spack/spack/test/cmd/install.py
with
40 additions
and
0 deletions
lib/spack/spack/installer.py
+
3
−
0
View file @
9cbe358f
...
...
@@ -1057,6 +1057,9 @@ def _install_task(self, task, **kwargs):
if
use_cache
and
\
_install_from_cache
(
pkg
,
cache_only
,
explicit
,
unsigned
):
self
.
_update_installed
(
task
)
if
task
.
compiler
:
spack
.
compilers
.
add_compilers_to_config
(
spack
.
compilers
.
find_compilers
([
pkg
.
spec
.
prefix
]))
return
pkg
.
run_tests
=
(
tests
is
True
or
tests
and
pkg
.
name
in
tests
)
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/test/cmd/install.py
+
37
−
0
View file @
9cbe358f
...
...
@@ -29,6 +29,9 @@
install
=
SpackCommand
(
'
install
'
)
env
=
SpackCommand
(
'
env
'
)
add
=
SpackCommand
(
'
add
'
)
mirror
=
SpackCommand
(
'
mirror
'
)
uninstall
=
SpackCommand
(
'
uninstall
'
)
buildcache
=
SpackCommand
(
'
buildcache
'
)
@pytest.fixture
()
...
...
@@ -733,6 +736,40 @@ def test_compiler_bootstrap(
install
(
'
a%gcc@2.0
'
)
def
test_compiler_bootstrap_from_binary_mirror
(
install_mockery_mutable_config
,
mock_packages
,
mock_fetch
,
mock_archive
,
mutable_config
,
monkeypatch
,
tmpdir
):
"""
Make sure installing compiler from buildcache registers compiler
"""
# Create a temp mirror directory for buildcache usage
mirror_dir
=
tmpdir
.
join
(
'
mirror_dir
'
)
mirror_url
=
'
file://{0}
'
.
format
(
mirror_dir
.
strpath
)
# Install a compiler, because we want to put it in a buildcache
install
(
'
gcc@2.0
'
)
# Put installed compiler in the buildcache
buildcache
(
'
create
'
,
'
-u
'
,
'
-a
'
,
'
-f
'
,
'
-d
'
,
mirror_dir
.
strpath
,
'
gcc@2.0
'
)
# Now uninstall the compiler
uninstall
(
'
-y
'
,
'
gcc@2.0
'
)
monkeypatch
.
setattr
(
spack
.
concretize
.
Concretizer
,
'
check_for_compiler_existence
'
,
False
)
spack
.
config
.
set
(
'
config:install_missing_compilers
'
,
True
)
assert
CompilerSpec
(
'
gcc@2.0
'
)
not
in
compilers
.
all_compiler_specs
()
# Configure the mirror where we put that buildcache w/ the compiler
mirror
(
'
add
'
,
'
test-mirror
'
,
mirror_url
)
# Now make sure that when the compiler is installed from binary mirror,
# it also gets configured as a compiler. Test succeeds if it does not
# raise an error
install
(
'
--no-check-signature
'
,
'
--cache-only
'
,
'
--only
'
,
'
dependencies
'
,
'
b%gcc@2.0
'
)
install
(
'
--no-cache
'
,
'
--only
'
,
'
package
'
,
'
b%gcc@2.0
'
)
@pytest.mark.regression
(
'
16221
'
)
def
test_compiler_bootstrap_already_installed
(
install_mockery_mutable_config
,
mock_packages
,
mock_fetch
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment