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

Tutorial not working #451

Open
mawis opened this issue Oct 12, 2024 · 1 comment
Open

Tutorial not working #451

mawis opened this issue Oct 12, 2024 · 1 comment

Comments

@mawis
Copy link

mawis commented Oct 12, 2024

I did this

I tried to run the tutorial in the tutorial folder of the repository. I first tried to run it with make tide, but it complained about Error: No such file or directory (os error 2). Checking the code I thought this has to do with the missing wasm package. So I tried to build the wasm part first.
For that I went to the folder tutorial/wasm and ran ./build.sh.

I expected the following

I expected the build to succeed and the wasm package to be generated.

What actually happened

Compiling failed within webauthn-rs-proto which seems to be part of this repository as well:
grafik

The compiler seems to complain about missing documentation within code generated by the wasm_bindgen macro.

   Compiling webauthn-rs-proto v0.5.0 (/home/matthias/source/webauthn-rs/webauthn-rs-proto)
error: missing documentation for an associated function
 --> webauthn-rs-proto/src/wasm.rs:4:1
  |
4 | #[wasm_bindgen]
  | ^^^^^^^^^^^^^^^
  |
note: the lint level is defined here
 --> webauthn-rs-proto/src/lib.rs:6:9
  |
6 | #![deny(warnings)]
  |         ^^^^^^^^
  = note: `#[deny(missing_docs)]` implied by `#[deny(warnings)]`
  = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `webauthn-rs-proto` (lib) due to 1 previous error
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: cd "/home/matthias/source/webauthn-rs/tutorial/wasm" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

Version (and git commit)

rust: rustc 1.81.0 (eeb90cda1 2024-09-04) on NixOS
rust: rustc 1.76.0 (07dca489a 2024-02-04) on MacOS
wasm-pack: wasm-pack 0.12.1 on NixOS
wasm-pack wasm-pack 0.13.0 on MacOS
webauthn-rs: cloned from this repository, commit 6f4688d on the master branch.

Operating System / Version

I tried this on two different operating systems:

  • NixOS 24.05 (Linux tejo 6.6.50 # 1-NixOS SMP PREEMPT_DYNAMIC Sun Sep 8 05:54:49 UTC 2024 x86_64 GNU/Linux)
  • MacOS (Dawin sulm.fritz.box 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 x86_64)
@mawis
Copy link
Author

mawis commented Oct 12, 2024

I could build the wasm package by editing webauth-rs-proto/src/wasm.rs to have some arbitrary documentation comment on is_conditional_mediation_available() and is_external_ctap2_securitykey_supported():

//! Extensions for wasm types that are not part of web-sys
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern "C" {
    /// Public Key Credential Extension
    pub type PublicKeyCredentialExt;

    /// some dummy documentation
    #[wasm_bindgen(static_method_of = PublicKeyCredentialExt, js_class = "PublicKeyCredential", js_name = isConditionalMediationAvailable, catch)]
    pub fn is_conditional_mediation_available() -> Result<::js_sys::Promise, JsValue>;

    /// some dummy documentation
    #[wasm_bindgen(static_method_of = PublicKeyCredentialExt, js_class = "PublicKeyCredential", js_name = isExternalCTAP2SecurityKeySupported, catch)]
    pub fn is_external_ctap2_securitykey_supported() -> Result<::js_sys::Promise, JsValue>;
}

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

1 participant