@@ -1323,7 +1323,13 @@ def try_install_from_binary_cache(self, explicit):
13231323 return True
13241324
13251325 def write_spconfig (self , spack_env , spconfig_fname , dirty ):
1326- """Execute all environment setup routines (dummy virtual function).
1326+ """Dump environment variable modifications to a script that can be run
1327+ to replicate the Spack build environment for this package. This must
1328+ be supported on a per-build-system basis.
1329+
1330+ This function executes inside of the build environment that is created
1331+ by Spack for the package to install in.
1332+
13271333 spack_env: Environment
13281334 If installing into an environment, this is it
13291335 spconfig_fname:
@@ -1391,6 +1397,7 @@ def do_install(self,
13911397 is_setup = (self .name in setup )
13921398 if is_setup :
13931399 keep_prefix = True
1400+ explicit = True
13941401
13951402 # For external packages the workflow is simplified, and basically
13961403 # consists in module file generation and registration in the DB
@@ -1442,21 +1449,6 @@ def do_install(self,
14421449 setup = setup ,
14431450 ** kwargs )
14441451
1445- if is_setup :
1446- explicit = True
1447- self .stage = DIYStage (os .getcwd ()) # Force build in cwd
1448-
1449- # --- Generate spconfig.py
1450- spconfig_fname = self .name + '-setup.py'
1451- tty .msg (
1452- 'Generating config file {0} [{1}]' .format (
1453- spconfig_fname , self .spec .cshort_spec ))
1454-
1455- # Calls virtual function of subclass
1456- # (eg: CMakePackage, MakefilePackage, etc.)
1457- spconfig_fname = self .write_spconfig (
1458- spack_env , spconfig_fname , dirty )
1459-
14601452 tty .msg (colorize ('@*{Installing} @*g{%s}' % self .name ))
14611453
14621454 if kwargs .get ('use_cache' , True ):
@@ -1510,7 +1502,17 @@ def build_process():
15101502 # the directory is created.
15111503 spack .hooks .pre_install (self .spec )
15121504 if is_setup :
1513- pass # Don't write any files in the install...
1505+ self .stage = DIYStage (os .getcwd ()) # Force build in cwd
1506+
1507+ spconfig_fname = self .name + '-setup.py'
1508+ tty .msg (
1509+ 'Generating config file {0} [{1}]' .format (
1510+ spconfig_fname , self .spec .cshort_spec ))
1511+
1512+ # Calls virtual function of subclass
1513+ # (eg: CMakePackage, MakefilePackage, etc.)
1514+ spconfig_fname = self .write_spconfig (
1515+ spack_env , spconfig_fname , dirty )
15141516 elif fake :
15151517 self .do_fake_install ()
15161518 else :
0 commit comments