Remove the "cdylib" crate-type from all proc-blocks #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of #19 we added
crate-type = ["cdylib", "rlib"]
to the[lib]
section of each proc-block'sCargo.toml
file, letting us compile the crate directly to a*.wasm
file that can be loaded at runtime.This works well when you build a proc-block normally (e.g.
cd normalize && cargo build
) or when generating a*.wasm
file for the purpose of extracting metadata (cargo build --target=wasm32-unknown-unknown --features=metadata
). However, when the crate is used as a dependency without themetadata
feature (i.e. as part ofrune build
), we try to generate thecdylib
and fail because it expects certain language items.This PR removes the
crate-type
declarations and modifiescargo xtask dist
to build each crate usingcargo rustc --crate-type=cdylib
. It should be good to merge, I'm just waiting for rust-lang/cargo#10388 (fixed 14 hours ago) to hit nightly so we get the fix for rust-lang/cargo#10356.This also moves the
cargo xtask dist
step in CI to its own job because the--crate-type
argument requires nightly Rust and the normal tests are compiled/run on the host whilecargo xtask dist
cross-compiles to WebAssembly.