-
Notifications
You must be signed in to change notification settings - Fork 136
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
Rust Minimal Workflow Failing #449
Comments
Any objections to committing a lockfile for rclrs @esteve @jhdcs @maspe36 ? The guidance from the cargo team has shifted over the years. Originally they advised to commit lockfiles for applications and not libraries, but in recent years they've advised to probably just go ahead and always commit lockfiles. I've been doing the latter for my projects the last 1-2 years and haven't had any issues with it. |
I don't fully understand what's going on here in this issue. How are we seeing a home crate upgrade? Shouldn't that be part of the toolchain or the cargo version? I don't know where this crate gets pulled in, I just know its source code lives in cargos repo. How would a lockfile enable both minimum and stable rust version CI? |
Great questions, I'll walk us through my understanding of what's happening. First of all, where does
So rclrs depends on
Notice that We don't have direct control over what version of
and cargo will make sure that it only fetches versions of One thorny problem with semantic versioning is that it only accounts for API compatibility. It does not account for the Rust compiler version. In order for us to guarantee support for Rust version 1.75, we need stricter requirements than semantic versioning offers. If I were to commit my lockfile that specifies v0.5.9 for |
Oh but one thing that saving the lockfile does not help with... downstream crates that depend on rclrs will not have access to a lockfile that we commit to the rclrs repo. So committing our lockfile will allow CI to go green for us, but it wouldn't help a downstream user of rclrs who needs to use Rust compiler version 1.75. I'll need to do some research on whether there's a solution for that. |
Okay I've given it more thought... We only care about supporting Rust compiler version 1.75 in the context of making sure rclrs will be compatible with the ROS build farm. In that context, if/when rclrs is ever built on the ROS build farm, cargo will be restricted to only using dependencies (including transitive dependencies) that are also available on the build farm. That means So I do think committing lockfiles for all our packages will be sufficient for our needs. One additional thing to consider is that maybe the workflow for stable should include a |
An alternative way to solve this: For each crate (rclrs and the various examples) we save a known-good lockfile for 1.75 under a name like |
I've tested locally and added this as a build dependency for
it seemed to work both with Rust 1.75 and 1.83, would this be ok to commit? However, the core issue here is that the
There is, in fact, a PR for If everyone is ok with the fix I proposed, we can commit it temporarily and once |
@esteve I have a few concerns about taking that approach:
I would promote the last approach that I suggested: we keep a 1.75-compatible "known-good" lockfile in each crate directory. Maybe call it
before building and testing each crate. This will have no negative effect on the |
@mxgrey the fix I propose is a one time thing for a very specific case. The crate that's causing this issue ( |
Even for the specific case, I don't think it's good dependency hygiene to lock all users of rclrs into a specific version of a transitive dependency just so we can get green checkmarks in a CI that exists for aspirational reasons (good and noble aspirations that we should absolutely hold to, but nevertheless aspirational). rclrs users could end up in a position where they can't combine rclrs with another dependency that requires a newer version of What I'm proposing not only avoids any pitfalls for users but also is a more appropriate simulation of what rclrs will experience if it gets put on the buildfarm: It will be locked into a certain compiler-version-compatible subset of its dependencies. It will also be a one-and-done fix so no other dependencies (transitive or otherwise) will be able to do this kind of rug pull on us. |
So the idea is just to have a minimal rustc lockfile, not one for stable? If so, I'm okay with that approach. Before pulling the trigger, we should look around the ecosystem. Surely this is not a unique problem to support a minimum version and stable. |
Truthfully I suspect it's a very very small portion of the community that would want to explicitly support both a frozen compiler version and the latest stable compiler at the same time. Those who want to support a frozen compiler version will most likely want all their dependencies to be frozen, so they'll just use a lockfile and/or their own crate registry for all their dependencies. I just tested out my lockfile idea with #450 but it failed. It looks like colcon-cargo might not give any regard to the lockfile in the source code, but I'd need to do more local experimentation to figure out if that's the actual problem. I also attempted a different solution where we would use There must be something that I don't understand about how It's very late for me now, so I'll try revisiting this tomorrow. |
I've figured out why none of my attempts were working. It wasn't the fault of Instead of building the source directory that the GitHub workflows starts you out with,
where the copy of I'm still looking through |
|
@Xaeroxe thanks for your feedback, we've instead opted to bump the version of |
Our latest Rust Minimal workflow failed with the following.
Changelog for home can be found here
The text was updated successfully, but these errors were encountered: