Skip to content

CI: ensure actions use the same version of Makepad as the top-level Cargo.toml #653

@kevinaboos

Description

@kevinaboos

Problem

Today a minor build failure occurred in the upstream dev branch of Makepad, which caused cargo-makepad to not build correctly. This itself caused our CI actions to fail because the step where we install cargo makepad (for cross-compiling mobile builds of Robrix) failed to build and install.

Temporary Solution

In #652, I changed the invocations of cargo install ... cargo makepad to use the same git repo and branch as the makepad-widgets dependency defined in the top-level Cargo.toml.

Here is one of those CI steps:

# The git repo and branch MUST MATCH the `makepad-widgets` dependency defined in `Cargo.toml`.
run: |
cargo install --force --git https://github.com/kevinaboos/makepad.git --branch serde_optional cargo-makepad

and here is the note in Cargo.toml:

robrix/Cargo.toml

Lines 19 to 22 in 5972032

## !NOTE! When updating the makepad dependency, be sure to also change the repo and branch
## !!!!!! that are used in `builds.yml` for installing cargo makepad from git.
## !!!!!! The version (git repo + branch) installed in CI actions should the one defined here.
makepad-widgets = { git = "https://github.com/kevinaboos/makepad", branch = "serde_optional", features = ["serde"] }

Proper Solution

The above solution works, but requires manual fixing up any time we update makepad. It is also not truly correct because it defines a github repo and branch, but not a specific commit/revision.

Instead, we should have a CI step that looks at the Cargo.lock file, not the Cargo.toml file, to see which specific revision of makepad was actually selected by cargo. It should then install the same specific revision of cargo makepad in all of the builds.yml steps, and wherever else we need to choose a particular version of makepad or cargo-makepad.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedLooking for help from anyone!

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions