-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
resolve the ambiguity to determine version of Cargo feature resolver. #8917
resolve the ambiguity to determine version of Cargo feature resolver. #8917
Conversation
This commit solve the ambiguity to determin the version of resolver. To get more detail, see the following two documents: - https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
Hmm, it's probably an oversight that helix-dap is still set to the 2018 edition. We should probably fix that too. |
I would prefer if the rust edition for helix-dap would be fixed instead of using this workaround |
This is not a workaround, we must specify the resolver manually otherwise it gets ignored. See https://doc.rust-lang.org/cargo/reference/workspaces.html#virtual-workspace . I got bitten by this once, i didn't understand why feature unification wasn't respected. By the way is setting the edition in the workspace Cargo.toml and then inherite it in child Cargo.toml has been envisaged? Would look like this in the child toml: [package]
edition.workspace = true |
I wouldn't mind. When these crates were crated workspace inheritance wasn't around yet. Either way I would still like to see the edition fixed in this PR because we will forget otherwise |
Now, the Rust 2021 is available in all workspaces.
To get more detail of the `workspace.package` table, see a following document: - https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
Thanks for reviewing and feedback. I fixed Rust editions in ba5001b by using the workspace inheritance. Also I hope that helps. |
This seems wrong. Because the feature resolver setting is global so it must be specified in the root's Cargo.toml only. And the feature resolver setting should be in the If a feature resolver were specified in a non-root Cargo.toml, $ cargo build
warning: resolver for the non root package will be ignored, specify resolver at the workspace root:
package: /mnt/SHPP41-2000GM-2/rustacean/helix_editor/fix/feature_resolver/helix-dap/Cargo.toml
workspace: /mnt/SHPP41-2000GM-2/rustacean/helix_editor/fix/feature_resolver/Cargo.toml |
Yeah by worspace's Cargo.toml, I meant the Cargo.toml at the root and only this one. Like you have done in your PR so this is fine. Sorry for the unclear terminology |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* fix: version of Cargo feature resolver. This commit solve the ambiguity to determin the version of resolver. To get more detail, see the following two documents: - https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html * unified: Rust edition in all workspaces. Now, the Rust 2021 is available in all workspaces. * fined up: Cargo.toml by using workspace inheritance. To get more detail of the `workspace.package` table, see a following document: - https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
* fix: version of Cargo feature resolver. This commit solve the ambiguity to determin the version of resolver. To get more detail, see the following two documents: - https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html * unified: Rust edition in all workspaces. Now, the Rust 2021 is available in all workspaces. * fined up: Cargo.toml by using workspace inheritance. To get more detail of the `workspace.package` table, see a following document: - https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
* fix: version of Cargo feature resolver. This commit solve the ambiguity to determin the version of resolver. To get more detail, see the following two documents: - https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html * unified: Rust edition in all workspaces. Now, the Rust 2021 is available in all workspaces. * fined up: Cargo.toml by using workspace inheritance. To get more detail of the `workspace.package` table, see a following document: - https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
* fix: version of Cargo feature resolver. This commit solve the ambiguity to determin the version of resolver. To get more detail, see the following two documents: - https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html * unified: Rust edition in all workspaces. Now, the Rust 2021 is available in all workspaces. * fined up: Cargo.toml by using workspace inheritance. To get more detail of the `workspace.package` table, see a following document: - https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
About This Pull Request
Summary
"2"
.Details
In helix, multiple edition designations are mixed as following:
And each edition implies a different default feature resolver version.
edition = "2018"
impliesresolver = "1"
edition = "2021"
impliesresolver = "2"
There is one problem. The setting of Cargo feature resolver is a global so only honored at the top-level one (and the others are ignored, the ignored resolver's features are not merged).
Currently, Cargo.toml at the top-level does not specify a feature resolver. This makes it hard for
cargo
to determine which is the developer's intent to use. In fact, a newer toolchain displays the following warning:This pull request solve the ambiguity by specifying the feature resolver version to "2" in the root's manifest.