-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
go.mod: Revert version bump of CEL #4587
Conversation
That's so weird. The new commits of CEL supposedly fixed that issue. Is it because plugins refer to older versions of Caddy? |
Yes, it's because plugins require an older version of Caddy, which requires an older version of CEL which requires the wrong version of antlr. The Go compiler complains because there's two different antlr (ambiguous) in the build and it explodes. I don't really understand why this issue happens, it seems like a Go module problem. But if we do bump the CEL version for v2.5.0, I don't think any plugins will build with v2.5.0 unless the plugins also update their go.mod to Caddy v2.5.0. We'll need to do more research, get help from experts on Go modules to figure out a solution that won't cause a hard line in the sand for plugins. Because that would really, really suck. |
I just saw your message in Slack. Yeah, that makes sense. This smells like MVS to me. (Minimal Version Selection). It looks like cel-go created an invalid module after v0.7.3. I don't fully understand the behavior of the Go tooling here, but I don't know if this can ever be fixed. I think if cel-go released a v2 of their module, this might be fixable. Plugins that still refer to old versions of Caddy will use the pre-v1 module, and Caddy will use the new /v2 module, so MVS might not apply (or is applied differently, I suspect, as /v2 is viewed as a separate module, given the addition of /v2 to the package path). This is just a hunch/hope, I don't know if this is actually true though. I'm not sure it's a good idea to keep using a dependency we cannot upgrade. It might be best long-term to either remove the CEL functionality or create an entirely new module with a clean history (no invalid versions) and use that instead. But in the meantime, downgrading is acceptable so we don't block the release of v2.5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunate, but apparently necessary. Thanks.
@mholt @francislavoie At some point Antlr introduced a proper |
Unfortunately, yes 😢 The problem is plugins for Caddy reference an older version of Caddy in their I'm not sure what the solution is. I think maybe both ANTLR and CEL would need a v2 or something to unbreak it. But I realize that might be too big an ask. I'm not sure what to do. |
Could you give me some more context on what's required for a v2 of the plugin? I'm happy to upgrade it if needed. I realized I missed your earlier reply to me about ways to better integrate CEL @francislavoie, so I just happened to spot this. I think there was some desire for additional functionality, so a v2 makes sense to me. Also, we just did a ton of upgrades for cel-go v0.10.0 for Kubernetes, so it's probably a good time to bump. |
In talking with the team, we're going to |
I'll be honest, I don't truly understand what considerations Go's module system makes that causes the problem, so I'm not certain what to expect as the outcome of changes to the upstream packages. Vendoring sounds like an interesting plan though, if that would avoid the ambiguity problem. If you need a reproduce case to help figure this out, I set up a branch https://github.com/caddyserver/caddy/compare/cel-upgrade which would let you use You can run this to see the error happen:
Using https://github.com/caddyserver/xcaddy which is our build tool (basically just a wrapper over |
Btw maybe we should move the discussion to #4331 which is the actual open issue for this 😅 |
@francislavoie Thanks for the pointer to the branch. I have vendoring staged locally and am curious if it addresses the upgrade issue. |
If you have a branch of cel I can put in the |
@francislavoie It looks like the vendoring works out and makes the cel dependencies hermetic. I was able to successfully run the
I could be mistaken as I'm not super familiar with the |
I updated the
|
Oh, I think the |
Trying this doesn't work either:
|
Anyways to clarify, running |
@francislavoie looks like the error is complaining about the GitHub repo being my fork. I'll put up a PR to vendor dependencies, and will try again with a pre-release candidate once someone from my team has had a look. |
@TristonianJones are you able to make a branch on the cel-go repo? Might work better to try |
I finally moved the commentary over to the issue, but I've noticed that we can probably solve the ANTLR upgrade path with a patch into |
Workaround for #4331, for now
Unfortunately, bumping CEL will cause all Caddy plugins to no longer build with the latest version of Caddy, if they have an earlier version of Caddy in their
go.mod
.I don't know what our long-term solution will be, so this will require more research before we can safely bump CEL to a newer version.