-
Notifications
You must be signed in to change notification settings - Fork 294
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
cue get go does not work consistently #621
Comments
Original reply by @NicolasRouquette in cuelang/cue#621 (comment) After trying a few variations, I came to the conclusion that for reproducible behavior, |
Original reply by @verdverm in cuelang/cue#621 (comment) I have a fix here: https://cue-review.googlesource.com/c/cue/+/8021 Not pretty or ideal... ended up embedding and temp writing the files to disk... Maybe some of the other Go compiler API could remove this requirement? Not sure |
Original reply by @mpvl in cuelang/cue#621 (comment) Interesting. Thanks for identifying the issue! |
Original reply by @myitcv in cuelang/cue#621 (comment) @verdverm - just so that I'm clear, can you explain from the repro above what you believe to be not working? What version of Go are you using? |
Original reply by @NicolasRouquette in cuelang/cue#621 (comment) With go 1.13, following the instructions above, you get the correct behavior; that is,
Use go > 1.13, e.g., 1.15.6, then we get instead:
This happens with cue 0.3.0-alpha6, 0.3.0-beta1 and 0.3.0-beta2 |
Original reply by @myitcv in cuelang/cue#621 (comment) @NicolasRouquette - and just to confirm, the Edit: critical edit |
Original reply by @myitcv in cuelang/cue#621 (comment)
We probably need to state clearly somewhere what versions of Go are supported. Is there a reason you are using Go 1.13? (asking in the context of https://golang.org/doc/devel/release.html#policy) |
Original reply by @myitcv in cuelang/cue#621 (comment) Ok, here's my now complete analysis. Example 1For completeness, here is a
Note this test does not include a Analysis based on the above:
Example 2Now consider:
i.e. we add a
Conclusion
|
Original reply by @myitcv in cuelang/cue#621 (comment) Noting an offline conversation with @mpvl. Next steps:
|
Original reply by @myitcv in cuelang/cue#621 (comment) One further aspect we will need to consider, that isn't purely a function of the changes in Go 1.16 but is exacerbated by it. Consider the following:
With Go That is to say, the side effects of Go There is a precedent however for keeping track of such dependencies: tools. The current best practice for keeping track of tool dependencies is as follows (per golang/go#25922 (comment)): create a build-ignored
This advice works for all Go versions, and should probably have been the advice from the beginning (otherwise you have an unstable This is a point to consider for the docs/Go 1.16 docs for the |
Original reply by @NicolasRouquette in cuelang/cue#621 (comment) @myitcv Thanks for improving our earlier analysis; LGTM. I also want to note that during my analysis, I found a potentially confounding problem.
|
Original reply by @myitcv in cuelang/cue#621 (comment) Thanks, @NicolasRouquette - yes, that point is covered in cuelang/cue#621 (comment):
With the loading of the embedded With the loading of the arguments to |
Original reply by @NicolasRouquette in cuelang/cue#621 (comment) FYI: This bug is still present in cue-0.3.0-beta3. |
Original reply by @myitcv in cuelang/cue#621 (comment) That's expected - the CL that fixes this is in progress. This issue will close automatically when the CL is merged. |
Originally opened by @verdverm in cuelang/cue#621
ceu get go
does not load its own interfaces when a go vendor directory is present and CUE is not in the dependencies.The error is in
initInterfaces()
(https://github.com/cuelang/cue/blob/master/cmd/cue/cmd/get_go.go#L287)packages.Load does not return an error, but there are errors in
p[0].Errors
We should be checking for these errors where this function is used.
repro:
possible resolutions:
toTop
andtoText
interfaces(1) I'd generally prefer to have a solution that does not require the user to have Cue as a dependency. This seems like unpleasant DX, essentially telling them they need to have an artificial dependency via overly complex instructions.
(2) could be an easy solution. However, I'm leery of modifying the Config so that Cue code is fetched automatically. This might make some SecOps people unhappy / break in corp intranets.
(3) Config has an
Overlay
we could use to embed these files as strings. This seems like the best way to go.We will also want to catch the errors in the other locations and provide an error message there.
What do others think?
The text was updated successfully, but these errors were encountered: