-
Notifications
You must be signed in to change notification settings - Fork 8
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
ErrorHandler trait not implemented errors after new major version releases of libcnb #90
Comments
Since they are major version updates (that don't get picked up automatically by the tilde dependency version ranges), both packages have to be updated simultaneously (which Dependabot can't do), due to: https://github.com/Malax/libcnb.rs/issues/90 Changes: Malax/libcnb.rs@v0.2.0...v0.3.0 heroku/libherokubuildpack@v0.2.0...v0.3.0 The buildpack's API version also had to be bumped due to: https://github.com/Malax/libcnb.rs/pull/50 Closes #162. Closes #163. GUS-W-9921906.
Since they are major version updates (that don't get picked up automatically by the tilde dependency version ranges), both packages have to be updated simultaneously (which Dependabot can't do), due to: https://github.com/Malax/libcnb.rs/issues/90 Changes: Malax/libcnb.rs@v0.2.0...v0.3.0 heroku/libherokubuildpack@v0.2.0...v0.3.0 The buildpack's API version also had to be bumped due to: https://github.com/Malax/libcnb.rs/pull/50 Closes #162. Closes #163. GUS-W-9921906.
I've filed: |
I'll close this since the |
Trying now with libcnb 0.4.0, by using heroku/buildpacks-jvm/pull/215 and then updating its libcnb = { path = "../../../libcnb.rs/libcnb", version = "0.4.0" }
libherokubuildpack = { version = "0.4.0", features = ["toml"] } ...I get:
So whilst version mismatches will still be an issue, at least the error message is better for types than it is for traits. Longer term I think we should still consider option (4). |
A new major version of libcnb was just released (0.3.0) since there had been breaking changes since the previous release.
Dependabot opened a PR against the JVM invoker buildpack
heroku/buildpacks-jvm#162
However CI failed with errors like:
(https://app.circleci.com/pipelines/github/heroku/buildpacks-jvm/599/workflows/4903b709-212d-4f3f-aa6b-a32a5d9ded63/jobs/6528)
This was puzzling, since the new version doesn't contain any changes to
ErrorHandler
:Malax/libcnb.rs@v0.2.0...v0.3.0
Inspecting the PR diff of
Cargo.lock
, I noticed there were two versions of libcnb in use -0.3.0
as a direct dependency of the JVM invoker buildpack, and then libcnb0.2.0
as a dependency oflibherokubuildpack
.The reason this fails is since there are now two versions of the
ErrorHandler
trait (even though they are technically identical), so the implemented version doesn't match the expected version.There is an upstream tracking issue for rustc to output better diagnostics in the case of differing crate versions (rust-lang/rust/issues/22750). Several fixes have landed already, including rust-lang/rust/pull/66561 which was supposed to help with the "trait not implemented" variant - however it hasn't helped here.
The immediate solution for the compile errors above is to update
libherokubuildpack
's own dependency onlibcnb
to 0.3.0, and then update the JVM invoker buildpack's to the new versions of both at the same time - so there is only one version of libcnb in use.However long term this approach is not ideal, since:
libcnb
then requires a dependency change + a new major release oflibherokubuildpack
, even though on the most partlibherokubuildpack
depends on very little oflibcnb
so won't actually have been incompatible.libcnb
+libherokubuildpack
will then have to update both simultaneously, which isn't supported by Dependabot, meaning time+effort of opening PRs manually (plus needing additional review, compared to being able to self-review Dependabot PRs).Possible options (there may be more; I couldn't find much written in the community about this):
>=0.3.0
, since crates.io doesn't allow wildcard deps) - so that it will work with any version. However this would be a lie, plus also not clear whether cargo would favour trying to find a unified version across the dependency tree vs pulling in the latest, if a buildpack was pinned to an older libcnb.libherokubuildpack
that depends onlibcnb
intolibcnb
itself. Currently that functionality is not very Heroku specific, though I suppose that might change in the future (eg when we add metrics).libcnb
vialibherokubuildpack
, and have buildpacks depend only onlibherokubuildpack
(ie: they wouldn't have a direct dependency onlibcnb
). This would meanlibherokubuildpack
is in control of thelibcnb
version.libcnb
's Traits/error handling out into another crate (kept in the libcnb repo using Cargo workspaces), which will only need a major version bump when there is a breaking Trait change (which will be very rarely).libherokubuildpack
would depend only on that new crate and notlibcnb
itself. Though what happens if/whenlibherokubuildpack
starts depending on even more oflibcnb
as we add more Heroku-specific functionality?To me it seems (4) or (5) might be best?
@Malax @hone Thoughts?
The text was updated successfully, but these errors were encountered: