Use a stub compiler wrapper on windows
This commit is contained in:
parent
95115d4290
commit
4bd9ff2ef0
File diff suppressed because one or more lines are too long
@ -1506,7 +1506,7 @@ def __init__(self, tests: bool = False):
|
|||||||
set
|
set
|
||||||
)
|
)
|
||||||
|
|
||||||
self.possible_compilers: List[KnownCompiler] = []
|
self.possible_compilers: List[spack.spec.Spec] = []
|
||||||
self.possible_oses: Set = set()
|
self.possible_oses: Set = set()
|
||||||
self.variant_values_from_specs: Set = set()
|
self.variant_values_from_specs: Set = set()
|
||||||
self.version_constraints: Set = set()
|
self.version_constraints: Set = set()
|
||||||
@ -3151,13 +3151,12 @@ def define_runtime_constraints(self):
|
|||||||
|
|
||||||
# FIXME (compiler as nodes): think of using isinstance(compiler_cls, WrappedCompiler)
|
# FIXME (compiler as nodes): think of using isinstance(compiler_cls, WrappedCompiler)
|
||||||
# Add a dependency on the compiler wrapper
|
# Add a dependency on the compiler wrapper
|
||||||
if sys.platform != "win32":
|
recorder("*").depends_on(
|
||||||
recorder("*").depends_on(
|
"compiler-wrapper",
|
||||||
"compiler-wrapper",
|
when=f"%{compiler.name}@{compiler.versions}",
|
||||||
when=f"%{compiler.name}@{compiler.versions}",
|
type="build",
|
||||||
type="build",
|
description=f"Add the compiler wrapper when using {compiler}",
|
||||||
description=f"Add the compiler wrapper when using {compiler}",
|
)
|
||||||
)
|
|
||||||
|
|
||||||
if not using_libc_compatibility():
|
if not using_libc_compatibility():
|
||||||
continue
|
continue
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import archspec.cpu
|
import archspec.cpu
|
||||||
@ -39,13 +40,15 @@ class CompilerWrapper(Package):
|
|||||||
|
|
||||||
license("Apache-2.0 OR MIT")
|
license("Apache-2.0 OR MIT")
|
||||||
|
|
||||||
version(
|
if sys.platform != "win32":
|
||||||
"1.0",
|
version(
|
||||||
sha256="92924570efbc0f388bbbeb87188e05537008bc25069529f7b519b4e48d7ddfb6",
|
"1.0",
|
||||||
expand=False,
|
sha256="84a26f8f37329bcdfb41d23a8a4f4c46efbede983eb73737135c95a4c126b5b7",
|
||||||
)
|
expand=False,
|
||||||
|
)
|
||||||
conflicts("platform=windows")
|
else:
|
||||||
|
version("1.0")
|
||||||
|
has_code = False
|
||||||
|
|
||||||
def bin_dir(self) -> pathlib.Path:
|
def bin_dir(self) -> pathlib.Path:
|
||||||
# This adds an extra "spack" subdir, so that the script and symlinks don't get
|
# This adds an extra "spack" subdir, so that the script and symlinks don't get
|
||||||
@ -53,6 +56,14 @@ def bin_dir(self) -> pathlib.Path:
|
|||||||
return pathlib.Path(str(self.prefix)) / "spack" / "bin"
|
return pathlib.Path(str(self.prefix)) / "spack" / "bin"
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
if sys.platform == "win32":
|
||||||
|
placeholder = self.bin_dir() / "placeholder-wrapper"
|
||||||
|
placeholder.parent.mkdir(parents=True)
|
||||||
|
placeholder.write_text(
|
||||||
|
"This file is a placeholder for the compiler wrapper on Windows."
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
cc_script = pathlib.Path(self.stage.source_path) / "cc.sh"
|
cc_script = pathlib.Path(self.stage.source_path) / "cc.sh"
|
||||||
bin_dir = self.bin_dir()
|
bin_dir = self.bin_dir()
|
||||||
|
|
||||||
@ -125,6 +136,9 @@ def install(self, spec, prefix):
|
|||||||
(bin_dir / subdir / name).symlink_to(installed_script)
|
(bin_dir / subdir / name).symlink_to(installed_script)
|
||||||
|
|
||||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||||
|
if sys.platform == "win32":
|
||||||
|
return
|
||||||
|
|
||||||
_var_list = []
|
_var_list = []
|
||||||
if dependent_spec.dependencies(virtuals=("c",)):
|
if dependent_spec.dependencies(virtuals=("c",)):
|
||||||
_var_list.append(("c", "cc", "CC", "SPACK_CC"))
|
_var_list.append(("c", "cc", "CC", "SPACK_CC"))
|
||||||
|
Loading…
Reference in New Issue
Block a user