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

TLS Notary WASM client #75

Merged
merged 33 commits into from
Jul 22, 2024
Merged

TLS Notary WASM client #75

merged 33 commits into from
Jul 22, 2024

Conversation

mattes
Copy link
Contributor

@mattes mattes commented Jul 16, 2024

This branch tracks changes to make the TLS Notary WASM client work in its current form.

I commented out anything else that's not WASM related. I will try to bring this back. As discussed the WASM module most likely needs to be isolated in it's own crate.

@mattes mattes force-pushed the compile-errors2 branch from fef13f5 to 34b3812 Compare July 18, 2024 21:38
mattes added 2 commits July 18, 2024 18:24
end to end, wasm client notarizing via websocket proxy to target
@mattes
Copy link
Contributor Author

mattes commented Jul 19, 2024

to make things a bit easier, we can assume:

wasm target -> always websockets (via web-sys/js-sys)
ios target -> always regular tcp socket
native target -> for testing, enable websockets or regular tcp socket

@mattes
Copy link
Contributor Author

mattes commented Jul 19, 2024

Good news, in .cargo/config.toml we can omit the following:

[unstable]
build-std=["panic_abort", "std"]

... by running:

wasm-pack build --release --target web $PWD -- -Z build-std=panic_abort,std

Docs:

Why is this nice? This has been a blocker to build any other stuff than WASM inside the same workspace.

mattes added 2 commits July 19, 2024 13:50
use wasm-pack build --release --target web /home/matt/dev/34-web-prover/web-prover -- -Z build-std=panic_abort,std to build the WASM module
println!("cargo:rerun-if-changed=.git/HEAD");
println!("cargo:rerun-if-changed=.git/refs/heads/main");
} else {
// Set the PATH environment variable for wasm32 target
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this. The only way to abort the main rust compilation is to abort here with process exist status >0 which would indicate the compilation failed.

@mattes
Copy link
Contributor Author

mattes commented Jul 20, 2024

// The `target_headers` was previously `HashMap<String, Vec<String>>`

That is correct. Header keys can have multiple values. Subtle detail, but prob fine to leave for now.

lib.rs as lib entrypoint, introduce cfg_if, trying to make wasm compile again
@mattes
Copy link
Contributor Author

mattes commented Jul 20, 2024

tracing should always be available. I removed the feature flag. The developer will configure it by setting the right log level. this allows debugging without rebuilding and redeploying the same built.

@mattes
Copy link
Contributor Author

mattes commented Jul 20, 2024

20a7c2e might be controversial. I'm happy to discuss if we all agree this is going in the right direction or not.

@mattes mattes marked this pull request as ready for review July 22, 2024 23:33
@mattes mattes merged commit 311de53 into main Jul 22, 2024
0 of 5 checks passed
@mattes mattes deleted the compile-errors2 branch July 22, 2024 23:34
@mattes
Copy link
Contributor Author

mattes commented Jul 22, 2024

LFG

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

Successfully merging this pull request may close these issues.

1 participant