rewiring of spliced specs (#26873)

* tests for rewiring pure specs to spliced specs

* relocate text, binaries, and links

* using llnl.util.symlink for windows compat.

Note: This does not include CLI hooks for relocation.

Co-authored-by: Nathan Hanford <hanford1@llnl.gov>
This commit is contained in:
Nathan Hanford
2022-04-04 14:45:35 -07:00
committed by GitHub
parent 8ddaa08ed2
commit 88d8ca9b65
5 changed files with 288 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
from spack import *
class SpliceH(AutotoolsPackage):
class SpliceH(Package):
"""Simple package with one optional dependency"""
homepage = "http://www.example.com"
@@ -20,3 +20,8 @@ class SpliceH(AutotoolsPackage):
depends_on('splice-z')
depends_on('splice-z+foo', when='+foo')
def install(self, spec, prefix):
with open(prefix.join('splice-h'), 'w') as f:
f.write('splice-h: {0}'.format(prefix))
f.write('splice-z: {0}'.format(spec['splice-z'].prefix))

View File

@@ -6,7 +6,7 @@
from spack import *
class SpliceT(AutotoolsPackage):
class SpliceT(Package):
"""Simple package with one optional dependency"""
homepage = "http://www.example.com"
@@ -16,3 +16,9 @@ class SpliceT(AutotoolsPackage):
depends_on('splice-h')
depends_on('splice-z')
def install(self, spec, prefix):
with open(prefix.join('splice-t'), 'w') as f:
f.write('splice-t: {0}'.format(prefix))
f.write('splice-h: {0}'.format(spec['splice-h'].prefix))
f.write('splice-z: {0}'.format(spec['splice-z'].prefix))

View File

@@ -6,7 +6,7 @@
from spack import *
class SpliceZ(AutotoolsPackage):
class SpliceZ(Package):
"""Simple package with one optional dependency"""
homepage = "http://www.example.com"
@@ -16,3 +16,7 @@ class SpliceZ(AutotoolsPackage):
variant('foo', default=False, description='nope')
variant('bar', default=False, description='nope')
def install(self, spec, prefix):
with open(prefix.join('splice-z'), 'w') as f:
f.write('splice-z: {0}'.format(prefix))