summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers/compilers.py6
-rw-r--r--mesonbuild/compilers/cs.py2
-rw-r--r--mesonbuild/compilers/cuda.py2
-rw-r--r--mesonbuild/compilers/d.py2
-rw-r--r--mesonbuild/compilers/java.py2
-rw-r--r--mesonbuild/compilers/mixins/clike.py2
-rw-r--r--mesonbuild/compilers/rust.py2
-rw-r--r--mesonbuild/compilers/swift.py2
8 files changed, 10 insertions, 10 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 45504e15e..73a623c9a 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1223,13 +1223,13 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
is good enough here.
"""
- def run_sanity_check(self, environment: Environment, cmdlist: T.List[str], work_dir: str, use_exe_wrapper_for_cross: bool = True) -> T.Tuple[str, str]:
+ def run_sanity_check(self, cmdlist: T.List[str], work_dir: str, use_exe_wrapper_for_cross: bool = True) -> T.Tuple[str, str]:
# Run sanity check
if self.is_cross and use_exe_wrapper_for_cross:
- if not environment.has_exe_wrapper():
+ if not self.environment.has_exe_wrapper():
# Can't check if the binaries run so we have to assume they do
return ('', '')
- cmdlist = environment.exe_wrapper.get_command() + cmdlist
+ cmdlist = self.environment.exe_wrapper.get_command() + cmdlist
mlog.debug('Running test binary command: ', mesonlib.join_args(cmdlist))
try:
pe, stdo, stde = Popen_safe_logged(cmdlist, 'Sanity check', cwd=work_dir)
diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py
index 37aa0f98b..ef3dd62cf 100644
--- a/mesonbuild/compilers/cs.py
+++ b/mesonbuild/compilers/cs.py
@@ -101,7 +101,7 @@ class CsCompiler(BasicLinkerIsCompilerMixin, Compiler):
cmdlist = [self.runner, obj]
else:
cmdlist = [os.path.join(work_dir, obj)]
- self.run_sanity_check(environment, cmdlist, work_dir, use_exe_wrapper_for_cross=False)
+ self.run_sanity_check(cmdlist, work_dir, use_exe_wrapper_for_cross=False)
def needs_static_linker(self) -> bool:
return False
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 4bf847c60..68df39bc3 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -580,7 +580,7 @@ class CudaCompiler(Compiler):
cmdlist = self.exelist + ['--run', f'"{binary_name}"']
try:
- stdo, stde = self.run_sanity_check(env, cmdlist, work_dir)
+ stdo, stde = self.run_sanity_check(cmdlist, work_dir)
except EnvironmentException:
raise EnvironmentException(f'Executables created by {self.language} compiler {self.name_string()} are not runnable.')
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 7d30bfb19..761ed5fc3 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -454,7 +454,7 @@ class DCompiler(Compiler):
if pc.returncode != 0:
raise EnvironmentException('D compiler %s cannot compile programs.' % self.name_string())
- stdo, stde = self.run_sanity_check(environment, [output_name], work_dir)
+ stdo, stde = self.run_sanity_check([output_name], work_dir)
def needs_static_linker(self) -> bool:
return True
diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py
index 7db9af86a..f1b84cd85 100644
--- a/mesonbuild/compilers/java.py
+++ b/mesonbuild/compilers/java.py
@@ -90,7 +90,7 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler):
runner = shutil.which(self.javarunner)
if runner:
cmdlist = [runner, '-cp', '.', obj]
- self.run_sanity_check(environment, cmdlist, work_dir, use_exe_wrapper_for_cross=False)
+ self.run_sanity_check(cmdlist, work_dir, use_exe_wrapper_for_cross=False)
else:
m = "Java Virtual Machine wasn't found, but it's needed by Meson. " \
"Please install a JRE.\nIf you have specific needs where this " \
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 5940ebdde..b70ba8324 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -307,7 +307,7 @@ class CLikeCompiler(Compiler):
mlog.debug('-----')
if pc.returncode != 0:
raise mesonlib.EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
- self.run_sanity_check(environment, [binary_name], work_dir)
+ self.run_sanity_check([binary_name], work_dir)
def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
code = 'int main(void) { int class=0; return class; }\n'
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index 8133555c6..8068865e2 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -149,7 +149,7 @@ class RustCompiler(Compiler):
if pc.returncode != 0:
raise EnvironmentException(f'Rust compiler {self.name_string()} cannot compile programs.')
self._native_static_libs(work_dir, source_name)
- self.run_sanity_check(environment, [output_name], work_dir)
+ self.run_sanity_check([output_name], work_dir)
# Check if we are allowed to use nightly features.
# This is done here because it's the only place we have access to
# environment object, and sanity_check() is called after the compiler
diff --git a/mesonbuild/compilers/swift.py b/mesonbuild/compilers/swift.py
index 3952a5fa2..26e2daf19 100644
--- a/mesonbuild/compilers/swift.py
+++ b/mesonbuild/compilers/swift.py
@@ -190,7 +190,7 @@ class SwiftCompiler(Compiler):
''')
pc = subprocess.Popen(self.exelist + extra_flags + ['-emit-executable', '-o', output_name, src], cwd=work_dir)
pc.wait()
- self.run_sanity_check(environment, [output_name], work_dir)
+ self.run_sanity_check([output_name], work_dir)
def get_debug_args(self, is_debug: bool) -> T.List[str]:
return clike_debug_args[is_debug]