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

Wasm crate fails to build #18

Closed
adomasven opened this issue Nov 15, 2019 · 3 comments
Closed

Wasm crate fails to build #18

adomasven opened this issue Nov 15, 2019 · 3 comments
Labels
A-crates/citeproc Area: citeproc crate I-build Issue: building the code

Comments

@adomasven
Copy link
Member

Attached is the build log:

adomas@paprika-laptop:~/zotero/citeproc-rs/crates/wasm
$ wasm-pack build
[...]
   Compiling datatest-derive v0.5.3-alpha.0 (https://github.com/cormacrelf/datatest?branch=test_type#e267a78d)
   Compiling ctor v0.1.10
   Compiling html5ever v0.24.0
   Compiling v_escape_derive v0.5.5
   Compiling strum_macros v0.15.0
   Compiling js-sys v0.3.30
   Compiling salsa v0.13.0
   Compiling v_escape v0.7.4
error[E0432]: unresolved import `crate::rustc_test::TestType`
   --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/lib.rs:204:5
    |
204 | use crate::rustc_test::TestType;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TestType` in the root

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/lib.rs:1:1
  |
1 | #![feature(test)]
  | ^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/lib.rs:2:1
  |
2 | #![feature(specialization)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/lib.rs:3:1
  |
3 | #![feature(termination_trait_lib)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0560]: struct `rustc_test::TestDesc` has no field named `test_type`
   --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/runner.rs:179:21
    |
179 |                     test_type: crate::test_type(desc.source_file),
    |                     ^^^^^^^^^ `rustc_test::TestDesc` does not have this field
    |
    = note: available fields are: `name`, `ignore`, `should_panic`, `allow_fail`

error[E0560]: struct `rustc_test::TestDesc` has no field named `test_type`
   --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/runner.rs:224:17
    |
224 |                 test_type: crate::test_type(desc.source_file),
    |                 ^^^^^^^^^ `rustc_test::TestDesc` does not have this field
    |
    = note: available fields are: `name`, `ignore`, `should_panic`, `allow_fail`

error[E0560]: struct `rustc_test::TestDesc` has no field named `test_type`
   --> /home/adomas/.cargo/git/checkouts/datatest-8f1d8ca908a37906/e267a78/src/runner.rs:392:21
    |
392 |                     test_type: crate::test_type(desc.source_file),
    |                     ^^^^^^^^^ `rustc_test::TestDesc` does not have this field
    |
    = note: available fields are: `name`, `ignore`, `should_panic`, `allow_fail`

error: aborting due to 7 previous errors

Some errors have detailed explanations: E0432, E0554, E0560.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `datatest`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit code: 101
@cormacrelf
Copy link
Collaborator

You need a newer nightly Rust, so rustup update nightly. datatest lives on the edge with the pretty unstable libtest API, which changed about a month ago. I'm running citeproc-rs off my PR branch from commure/datatest#19 which accommodates that change. I really need to update the readme, sorry!

@cormacrelf
Copy link
Collaborator

Also it strikes me that it shouldn't be built at all in that configuration, apparently I made it a dependency instead of a dev-dependency.

@cormacrelf
Copy link
Collaborator

cormacrelf commented Nov 15, 2019

Actually, once that's fixed, you can even wasm-pack build on stable! As of stable 1.39.0, which was released earlier this month, the async/await syntax and Vec::new being a const fn are stable, so it really does go.

At the moment the demo's webpack config uses the nightly-only -Z config-profile to change opt-level for debug builds without affecting the whole workspace. But if you're only building a package with wasm-pack in release mode, opt-level is already correct and you don't need that. This is great news for reliable CI builds, which I'm looking into with #7 at the moment. However for development you still want datatest and hence nightly.

(Quick note: wasm-pack defies convention and builds in release mode by default. Mostly this is what you want, but it can be confusing.)

@cormacrelf cormacrelf added A-crates/citeproc Area: citeproc crate I-bug Something isn't working I-build Issue: building the code and removed I-bug Something isn't working labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-crates/citeproc Area: citeproc crate I-build Issue: building the code
Development

No branches or pull requests

2 participants