diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2023-08-26 02:17:15 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2023-08-26 02:44:54 +0100 |
commit | 1e045a5d5ca2e3e28119343970b2ccff13a64c65 (patch) | |
tree | 2764abaac62b5e338976ff42c2ff77db7fc1912a /src | |
parent | c78e268845e980e9e7ed1583c0581615d52580d5 (diff) | |
download | unit-wasm-1e045a5d5ca2e3e28119343970b2ccff13a64c65.tar.gz unit-wasm-1e045a5d5ca2e3e28119343970b2ccff13a64c65.tar.bz2 |
Rust/unit-wasm-sys: Don't require the wasi-sysroot
When I added the luw_http_hdr_get_value() function I needed to include
strings.h, unfortunately I added it to unit-wasm.h instead of
libunit-wasm.c
This then meant that we needed to point bindgen/clang, for generating
the bindings, to the wasi-sysroot for the strings.h file. I guess this
is a system dependant include or something and when we use the
wasm32-wasi target in clang it uses a paired down include search path
list, none of which have strings.h
This then had the knock on effect of requiring to inform cargo build of
the wasi-sysroot path.
Now that we put strings.h in the right place, we don't need the
wasi-sysroot when building the rust stuff.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/rust/unit-wasm-sys/build.rs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/rust/unit-wasm-sys/build.rs b/src/rust/unit-wasm-sys/build.rs index bd8d3a5..3d3ff0e 100644 --- a/src/rust/unit-wasm-sys/build.rs +++ b/src/rust/unit-wasm-sys/build.rs @@ -30,15 +30,12 @@ fn main() { } fn generate_bindings() { - let wasi_sysroot = - "--sysroot=".to_owned() + &env::var("WASI_SYSROOT").unwrap(); let bindings = bindgen::Builder::default() // The input header file. .header("libunit-wasm/include/unit/unit-wasm.h") .allowlist_function("^luw_.*") .allowlist_var("^luw_.*") .allowlist_type("^luw_.*") - .clang_args(vec![wasi_sysroot]) // Needed for strings.h .generate() .expect("Unable to generate bindings"); |