Skip to content

Bump Cargo dependencies declared under an alias - #438

Open
johncarmack1984 wants to merge 1 commit into
jbolda:mainfrom
johncarmack1984:rust-renamed-deps
Open

johncarmack1984 wants to merge 1 commit into
jbolda:mainfrom
johncarmack1984:rust-renamed-deps

Conversation

@johncarmack1984

Copy link
Copy Markdown
Contributor

Came out of tauri-apps/javascriptcore-rs#90, where the release PR failed to build. covector bumped javascriptcore-rs-sys to 2.0.0, but the crate depending on it declares it as

[dependencies.ffi]
package = "javascriptcore-rs-sys"
path = "./sys"
version = "1.1"

and the requirement stayed at 1.1. getDepBumpVersion matched dependencies by their table key only, so an alias never matched and the requirement was never bumped.

The alias is now resolved through package (resolveDepKey in @covector/files), and the reads and writes in getPackageFileVersion / setPackageFileVersion go through it, so [dependencies], [dev-dependencies], [build-dependencies], [target.*.dependencies] and an aliased root [workspace.dependencies] entry all bump under the alias. A dependency declared under its own name resolves to itself, so the existing fixtures are unchanged.

Two fixtures: the sub-table form above plus an inline alias in a [target] table, and an aliased root entry consumed as { workspace = true }. Four tests, all red before the change. 184 passing, typecheck clean.

A dependency renamed with `package`, e.g. `ffi = { package = "javascriptcore-rs-sys", version = "1.1" }`, keeps its requirement under the alias. Dependencies were matched by their table key only, so the aliased requirement never bumped and the release commit could not resolve.

`resolveDepKey` finds the alias through `package`, and the dependency reads and writes go through it in `[dependencies]`, `[dev-dependencies]`, `[build-dependencies]`, `[target.*.dependencies]` and a root `[workspace.dependencies]` table.
@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through 1885b42

There are 2 changes which include @covector/files with patch, @covector/apply with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
covector 0.13.2 0.13.3
@covector/apply 0.11.2 0.11.3
@covector/assemble 0.13.2 0.13.3
@covector/changelog 0.13.2 0.13.3
@covector/files 0.9.1 0.9.2
action 0.13.2 0.13.3

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

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.

1 participant