bugfix for relative dev path

This commit is contained in:
Gregory Becker
2021-12-07 15:06:32 -08:00
parent 3d1b9e4dbc
commit 0e39c8b1b7
3 changed files with 5 additions and 4 deletions

View File

@@ -38,6 +38,7 @@
import spack.spec import spack.spec
import spack.target import spack.target
import spack.tengine import spack.tengine
import spack.util.path
import spack.variant as vt import spack.variant as vt
from spack.config import config from spack.config import config
from spack.package_prefs import PackagePrefs, is_spec_buildable, spec_externals from spack.package_prefs import PackagePrefs, is_spec_buildable, spec_externals
@@ -89,7 +90,7 @@ def concretize_develop(self, spec):
if not dev_info: if not dev_info:
return False return False
path = os.path.normpath(os.path.join(env.path, dev_info['path'])) path = spack.util.path.canonicalize_path(dev_info['path'])
if 'dev_path' in spec.variants: if 'dev_path' in spec.variants:
assert spec.variants['dev_path'].value == path assert spec.variants['dev_path'].value == path

View File

@@ -630,8 +630,7 @@ def _rewrite_relative_paths_on_relocation(self, init_file_dir):
for name, entry in self.dev_specs.items(): for name, entry in self.dev_specs.items():
dev_path = entry['path'] dev_path = entry['path']
expanded_path = os.path.normpath(os.path.join( expanded_path = spack.util.path.canonicalize_path(entry['path'])
init_file_dir, entry['path']))
# Skip if the expanded path is the same (e.g. when absolute) # Skip if the expanded path is the same (e.g. when absolute)
if dev_path == expanded_path: if dev_path == expanded_path:

View File

@@ -45,6 +45,7 @@
import spack.repo import spack.repo
import spack.spec import spack.spec
import spack.store import spack.store
import spack.util.path
import spack.util.timer import spack.util.timer
import spack.variant import spack.variant
import spack.version import spack.version
@@ -1986,7 +1987,7 @@ def _develop_specs_from_env(spec, env):
if not dev_info: if not dev_info:
return return
path = os.path.normpath(os.path.join(env.path, dev_info['path'])) path = spack.util.path.canonicalize_path(dev_info['path'])
if 'dev_path' in spec.variants: if 'dev_path' in spec.variants:
assert spec.variants['dev_path'].value == path assert spec.variants['dev_path'].value == path