aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-08-24 09:49:23 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-08-25 16:49:40 +0300
commit79f17fa86352f3fc041081c783a63d51543eadf4 (patch)
treee8535e8bfa77f5a026e79fbd87b93d5da04ff47d
parent0528ef93e57faa0ad9889b4575af4c00ced7bd7e (diff)
downloadmeson-79f17fa86352f3fc041081c783a63d51543eadf4.zip
meson-79f17fa86352f3fc041081c783a63d51543eadf4.tar.gz
meson-79f17fa86352f3fc041081c783a63d51543eadf4.tar.bz2
fix transient failure on rust/12 bindgen
The test has a custom .h target that has the same name as the input in the test's source directory. Sometimes a compiler could build a target that intends to use the file in the source tree, but finds an incomplete output of the custom_target, causing the test to fail. To fix this, move the generated headers in a subdirectory of the build tree. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--test cases/rust/12 bindgen/dependencies/internal_dep.h2
-rw-r--r--test cases/rust/12 bindgen/gen/gen_header.py (renamed from test cases/rust/12 bindgen/src/gen_header.py)0
-rw-r--r--test cases/rust/12 bindgen/gen/meson.build13
-rw-r--r--test cases/rust/12 bindgen/meson.build15
4 files changed, 15 insertions, 15 deletions
diff --git a/test cases/rust/12 bindgen/dependencies/internal_dep.h b/test cases/rust/12 bindgen/dependencies/internal_dep.h
index b0629de..f44e278 100644
--- a/test cases/rust/12 bindgen/dependencies/internal_dep.h
+++ b/test cases/rust/12 bindgen/dependencies/internal_dep.h
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright © 2022 Intel Corporation
-#include "gen.h"
+#include "gen/gen.h"
int64_t add64(const int64_t, const int64_t);
diff --git a/test cases/rust/12 bindgen/src/gen_header.py b/test cases/rust/12 bindgen/gen/gen_header.py
index 07b699b..07b699b 100644
--- a/test cases/rust/12 bindgen/src/gen_header.py
+++ b/test cases/rust/12 bindgen/gen/gen_header.py
diff --git a/test cases/rust/12 bindgen/gen/meson.build b/test cases/rust/12 bindgen/gen/meson.build
new file mode 100644
index 0000000..ff5fd84
--- /dev/null
+++ b/test cases/rust/12 bindgen/gen/meson.build
@@ -0,0 +1,13 @@
+gen_h = custom_target(
+ 'gen.h',
+ command : [find_program('gen_header.py'), '@INPUT@', '@OUTPUT@'],
+ output : 'gen.h',
+ input : meson.project_source_root() / 'src/header.h'
+)
+
+gen2_h = custom_target(
+ 'other.h',
+ command : [find_program('gen_header.py'), '@INPUT@', '@OUTPUT@'],
+ output : 'other.h',
+ input : meson.project_source_root() / 'include/other.h'
+)
diff --git a/test cases/rust/12 bindgen/meson.build b/test cases/rust/12 bindgen/meson.build
index 57e44a0..a0a5263 100644
--- a/test cases/rust/12 bindgen/meson.build
+++ b/test cases/rust/12 bindgen/meson.build
@@ -66,20 +66,7 @@ rust_bin = executable(
test('main', rust_bin)
# Test a generated header
-gen_h = custom_target(
- 'gen.h',
- command : [find_program('src/gen_header.py'), '@INPUT@', '@OUTPUT@'],
- output : 'gen.h',
- input : 'src/header.h'
-)
-
-gen2_h = custom_target(
- 'other.h',
- command : [find_program('src/gen_header.py'), '@INPUT@', '@OUTPUT@'],
- output : 'other.h',
- input : 'include/other.h'
-)
-
+subdir('gen')
gen_rs = rust.bindgen(
input : [gen_h, gen2_h],
output : 'gen.rs',