aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/java.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-03-25 02:23:42 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2025-04-30 00:14:44 +0300
commit8e564f16aea388834b69e784a82b248bae825c66 (patch)
tree3da6f759e928e5265ba9bb563359c144b686572c /mesonbuild/compilers/java.py
parent8909a09d2a8713c4fc0c31c2df6c9b022b840213 (diff)
downloadmeson-8e564f16aea388834b69e784a82b248bae825c66.zip
meson-8e564f16aea388834b69e784a82b248bae825c66.tar.gz
meson-8e564f16aea388834b69e784a82b248bae825c66.tar.bz2
compilers: introduce common helper for sanity checks
Avoid reinventing the wheel and instead use a single helper, taking care of logging and cross compilation. Fixes: #14373 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/compilers/java.py')
-rw-r--r--mesonbuild/compilers/java.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py
index 540e2aa..47d2ac9 100644
--- a/mesonbuild/compilers/java.py
+++ b/mesonbuild/compilers/java.py
@@ -91,10 +91,7 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler):
runner = shutil.which(self.javarunner)
if runner:
cmdlist = [runner, '-cp', '.', obj]
- pe = subprocess.Popen(cmdlist, cwd=work_dir)
- pe.wait()
- if pe.returncode != 0:
- raise EnvironmentException(f'Executables created by Java compiler {self.name_string()} are not runnable.')
+ self.run_sanity_check(environment, 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 " \