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

Error: failed to parse manifest when using the workspace inheritance feature from Rust 1.64 #1180

Closed
printfn opened this issue Sep 22, 2022 · 5 comments · Fixed by #1185
Closed

Comments

@printfn
Copy link
Contributor

printfn commented Sep 22, 2022

🐛 Bug description

I set up the my Cargo.toml files to use the workspace inheritance feature from Rust 1.64, which resulted in this error:

$ wasm-pack build --target no-modules --out-dir ../web/pkg
Error: failed to parse manifest: /Users/printfn/Code/fend/wasm/Cargo.toml
Caused by: invalid type: map, expected a string for key `package.description`

Compiling the same project with cargo build works fine, so this error must be specific to wasm-pack.

🤔 Expected Behavior

I would've expected the Cargo.toml file to be parsed correctly.

👟 Steps to reproduce

Workspace Cargo.toml:

[workspace]
members = ["cli", "core", "wasm"]

[workspace.package]
version = "1.1.0"
description = "Arbitrary-precision unit-aware calculator"
# ...

Wasm Cargo.toml:

[package]
name = "fend-wasm"
version.workspace = true
description.workspace = true
# ...

This commit shows the diff between the Cargo.toml files.

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.10.3
rustc version: 1.64

$ cargo -vV
cargo 1.64.0 (387270bc7 2022-09-16)
release: 1.64.0
commit-hash: 387270bc7f446d17869c7f208207c73231d6a252
commit-date: 2022-09-16
host: aarch64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.6.0 [64-bit]
@Firstyear
Copy link

I can reproduce with a similar environment setup.

@martinfrances107
Copy link

I can confirm this bug

cargo -vV

cargo 1.64.0 (387270bc7 2022-09-16)
release: 1.64.0
commit-hash: 387270bc7f446d17869c7f208207c73231d6a252
commit-date: 2022-09-16
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Ubuntu 22.04 (jammy) [64-bit]

@martinfrances107
Copy link

martinfrances107 commented Oct 25, 2022

The original issue identified problems with name, version, description

[package]
name = "fend-wasm"
version.workspace = true
description.workspace = true

I want to extent this list to "license" and "repository"

@martinfrances107
Copy link

Sorry for the distraction my commented above need to be corrected

after reading, the doc more carfully

"license" and "repository" are not on the list....

https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table

authors categories
description documentation
edition exclude
homepage include
keywords license
license-file publish
readme repository
rust-version version

@printfn
Copy link
Contributor Author

printfn commented Oct 25, 2022

@martinfrances107: Yes they are in the list, in the second column.

This is the full list of attributes that can be referenced from a workspace as of Rust 1.64: authors, categories, description, documentation, edition, exclude, homepage, include, keywords, license, license-file, publish, readme, repository, rust-version and version.

Of those, only description, license, license-file, repository and homepage seem to result in this bug, while setting the other attributes in the workspace root works fine.

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 a pull request may close this issue.

3 participants