diff options
| author | Kacper Michajłow <kasper93@gmail.com> | 2025-03-17 00:32:59 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-04-03 11:49:37 +0300 |
| commit | 5d9b9739ddc34a9db966a0034ab5ffb652ec4f56 (patch) | |
| tree | 0dcef1c633ea9b7fc3a4139a6d58ec7b62a9be18 /mesonbuild/compilers | |
| parent | 95d7fac30a9955fd1f846a650f2bfe0db4b261f8 (diff) | |
| download | meson-5d9b9739ddc34a9db966a0034ab5ffb652ec4f56.tar.gz | |
compilers/rust: fix sanity_check for Windows targets
Windows toolchains append `.exe` to executables. When cross-compiling on
Linux, attempting to run `./rusttest` will not execute the generated
`rusttest.exe`.
Fix this by always appending `.exe`, which is a valid filename on all
supported platforms. This is what the `CLikeCompiler` class does too.
While reviewing `rust.py`, there are opportunities for improvements and
better unification with the rest of the Meson code. However, this commit
focuses on fixing cross-compilation with minimal changes.
Fixes: #14374
Diffstat (limited to 'mesonbuild/compilers')
| -rw-r--r-- | mesonbuild/compilers/rust.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index bfc83a57a..e35c10231 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -109,7 +109,7 @@ class RustCompiler(Compiler): def sanity_check(self, work_dir: str, environment: Environment) -> None: source_name = os.path.join(work_dir, 'sanity.rs') - output_name = os.path.join(work_dir, 'rusttest') + output_name = os.path.join(work_dir, 'rusttest.exe') cmdlist = self.exelist.copy() with open(source_name, 'w', encoding='utf-8') as ofile: |
