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

cargo-apk: Inherit package configuration (version) from workspace root #360

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Nov 5, 2022

Depends on rust-mobile/cargo-subcommand#23, rust-mobile/cargo-subcommand#24
Fixes #359

Starting with Rust 1.64 common [package] parameters (and dependencies) can now be specified in the workspace root manifest by setting <field>.workspace=true in a [package] and specifying its value in the workspace root manifest under [workspace.package].

Since cargo-apk reads the version field from [package] it has to support this new format and pull the value from the root manifest instead, in order to support projects utilizing this new format.

This is currently implemented ad-hoc for the version field, but could be done in a cleaner way if/when more fields are needed.

@MarijnS95 MarijnS95 force-pushed the inherit-version-from-workspace branch from bccad23 to f31c73f Compare November 6, 2022 14:05
@MarijnS95 MarijnS95 marked this pull request as ready for review November 17, 2022 15:53
@MarijnS95
Copy link
Member Author

I'll merge this in when closer to a cargo-apk release - which is basically exclusively blocking on #363 or a similar solution - at which point I'll also make a new breaking cargo-subcommand release.

Starting with [Rust 1.64] common `[package]` parameters (and
dependencies) can now be specified in the workspace root manifest by
setting `<field>.workspace=true` in a `[package]` and specifying its
value in the workspace root manifest under [`[workspace.package]`].

Since `cargo-apk` reads the `version` field from `[package]` it has to
support this new format and pull the value from the root manifest
instead, in order to support projects utilizing this new format.

This is currently implemented ad-hoc for the version field, but could
be done in a cleaner way if/when more fields are needed.

[Rust 1.64]: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
[`[workspace.package]`]: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-workspacepackage-table
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 this pull request may close these issues.

Cargo apk returns Error: Failed to parse config when Cargo version inherits from workspace
2 participants