Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does ring support the new WASI triples? #2160

Open
nanai10a opened this issue Nov 16, 2024 · 2 comments
Open

Does ring support the new WASI triples? #2160

nanai10a opened this issue Nov 16, 2024 · 2 comments

Comments

@nanai10a
Copy link

I read #1921, but the current WASI triples are mainly wasm32-wasip1 and wasm32-wasip2, not wasm32-wasi. These triples cause compilation failures (as shown below).

   Compiling ring v0.17.8
warning: [email protected]: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-wasip2"'
warning: [email protected]: 1 error generated.
error: failed to run custom build command for `ring v0.17.8`

Caused by:
process didn't exit successfully: /private/tmp/ex/example/target/release/build/ring-9263422c07f84357/build-script-build (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
OPT_LEVEL = Some(3)
OUT_DIR = Some(/private/tmp/ex/example/target/wasm32-wasip2/release/build/ring-6ad973c36bee25aa/out)
TARGET = Some(wasm32-wasip2)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_wasm32-wasip2
CC_wasm32-wasip2 = None
cargo:rerun-if-env-changed=CC_wasm32_wasip2
CC_wasm32_wasip2 = None
cargo:rerun-if-env-changed=TARGET_CC
TARGET_CC = None
cargo:rerun-if-env-changed=CC
CC = None
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
RUSTC_WRAPPER = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
cargo:rerun-if-env-changed=WASI_SYSROOT
WASI_SYSROOT = None
DEBUG = Some(false)
cargo:rerun-if-env-changed=CFLAGS_wasm32-wasip2
CFLAGS_wasm32-wasip2 = None
cargo:rerun-if-env-changed=CFLAGS_wasm32_wasip2
CFLAGS_wasm32_wasip2 = None
cargo:rerun-if-env-changed=TARGET_CFLAGS
TARGET_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-wasip2"'
cargo:warning=1 error generated.

--- stderr

error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fno-exceptions" "--target=wasm32-wasip2" "-I" "include" "-I" "/private/tmp/ex/example/target/wasm32-wasip2/release/build/ring-6ad973c36bee25aa/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-nostdlibinc" "-DNDEBUG" "-DRING_CORE_NOSTDLIBINC=1" "-o" "/private/tmp/ex/example/target/wasm32-wasip2/release/build/ring-6ad973c36bee25aa/out/fad98b632b8ce3cc-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args clang did not execute successfully (status code exit status: 1).

What could be wrong?

@briansmith
Copy link
Owner

error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fno-exceptions" "--target=wasm32-wasip2" "-I" "include" "-I" "/private/tmp/ex/example/target/wasm32-wasip2/release/build/ring-6ad973c36bee25aa/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-nostdlibinc" "-DNDEBUG" "-DRING_CORE_NOSTDLIBINC=1" "-o" "/private/tmp/ex/example/target/wasm32-wasip2/release/build/ring-6ad973c36bee25aa/out/fad98b632b8ce3cc-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args clang did not execute successfully (status code exit status: 1).

It looks like you need to upgrade to a version of clang that supports wasm32-wasip2?

@briansmith
Copy link
Owner

Does ring support the new WASI triples?

AFAICT the new WASI triples are the same as the old ones, as far as ring is concerned, because we only use one API. It would be good to have this tested/verified in CI, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants