PythonExtension: use different bin dir on Windows (#45427)
This commit is contained in:
parent
296e5308a7
commit
1f1021a47f
@ -17,7 +17,7 @@
|
|||||||
import llnl.util.filesystem as fs
|
import llnl.util.filesystem as fs
|
||||||
import llnl.util.lang as lang
|
import llnl.util.lang as lang
|
||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
from llnl.util.filesystem import HeaderList, LibraryList
|
from llnl.util.filesystem import HeaderList, LibraryList, join_path
|
||||||
|
|
||||||
import spack.builder
|
import spack.builder
|
||||||
import spack.config
|
import spack.config
|
||||||
@ -120,6 +120,12 @@ def skip_modules(self) -> Iterable[str]:
|
|||||||
"""
|
"""
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@property
|
||||||
|
def bindir(self) -> str:
|
||||||
|
"""Path to Python package's bindir, bin on unix like OS's Scripts on Windows"""
|
||||||
|
windows = self.spec.satisfies("platform=windows")
|
||||||
|
return join_path(self.spec.prefix, "Scripts" if windows else "bin")
|
||||||
|
|
||||||
def view_file_conflicts(self, view, merge_map):
|
def view_file_conflicts(self, view, merge_map):
|
||||||
"""Report all file conflicts, excepting special cases for python.
|
"""Report all file conflicts, excepting special cases for python.
|
||||||
Specifically, this does not report errors for duplicate
|
Specifically, this does not report errors for duplicate
|
||||||
|
@ -93,6 +93,9 @@ def setup_dependent_run_environment(self, env, dependent_spec):
|
|||||||
path = os.path.join(dependent_spec.prefix, directory)
|
path = os.path.join(dependent_spec.prefix, directory)
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
env.prepend_path("PYTHONPATH", path)
|
env.prepend_path("PYTHONPATH", path)
|
||||||
|
dep_bin_dir = getattr(dependent_spec.package, "bindir", None)
|
||||||
|
if dep_bin_dir and os.path.isdir(dep_bin_dir):
|
||||||
|
env.prepend_path("PATH", dep_bin_dir)
|
||||||
|
|
||||||
def setup_dependent_package(self, module, dependent_spec):
|
def setup_dependent_package(self, module, dependent_spec):
|
||||||
"""Called before python modules' install() methods."""
|
"""Called before python modules' install() methods."""
|
||||||
|
Loading…
Reference in New Issue
Block a user