Skip to content
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

cmd/cue: cue get go doesn't support uintptr type #1305

Closed
vikstrous2 opened this issue Oct 18, 2021 · 4 comments
Closed

cmd/cue: cue get go doesn't support uintptr type #1305

vikstrous2 opened this issue Oct 18, 2021 · 4 comments
Labels
get go issues related to cue get go NeedsFix

Comments

@vikstrous2
Copy link

What version of CUE are you using (cue version)?

cue version v0.4.0 linux/amd64

Does this issue reproduce with the latest release?

yes, on master

What did you do?

go mod init tmp.com
go get istio.io/api/networking/v1alpha3
cue get go istio.io/api/networking/v1alpha3
cue eval ./...

What did you expect to see?

success

What did you see instead?

_#field: reference "uintptr" not found:
    ./cue.mod/gen/github.com/gogo/protobuf/proto/pointer_unsafe_go_gen.cue:11:10
package "reflect" not found:
    ./cue.mod/gen/github.com/gogo/protobuf/proto/properties_go_gen.cue:7:8
@vikstrous2 vikstrous2 added NeedsInvestigation Triage Requires triage/attention labels Oct 18, 2021
@mpvl mpvl added the get go issues related to cue get go label Oct 26, 2021
@derekcrovo
Copy link

derekcrovo commented Nov 8, 2021

I'm seeing this too, with the v1beta version (cue get go istio.io/api/networking/v1beta1).
I get the same error message from cue eval.

@dave08
Copy link

dave08 commented Feb 21, 2022

I just had this with 0.4.2 also.

@marcellanz
Copy link

marcellanz commented Feb 21, 2022

Hi 👋– I have this "issue" with github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2 too and I found this issue here. I use cue 0.4.2 and used:

go get github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2
cue get go github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2

to validate instances of #CiliumNetworkPolicy

@rogpeppe rogpeppe changed the title errors in cue get go for istio.io/api/networking/v1alpha3 cmd/cue: cue get go doesn't support uintptr type Apr 13, 2022
@rogpeppe
Copy link
Member

It seems like this is a simple omission of the uintptr type from the Go import logic.
Here's a simple reproducer:

exec cue get go example.com/m
exec cue vet example.com/m

-- cue.mod/module.cue --
module: "example.com/c"
-- go.mod --
module example.com/m

go 1.18
-- m.go --
package m

type Foo struct {
	X uintptr
}

This fails currently:

> exec cue get go example.com/m
> exec cue vet example.com/m
[stderr]
#Foo.X: reference "uintptr" not found:
    ./cue.mod/gen/example.com/m/m_go_gen.cue:7:10
[exit status 1]
FAIL: /tmp/testscript362736862/x.txt/script.txt:2: unexpected command failure
error running /tmp/x.txt in /tmp/testscript362736862/x.txt

@rogpeppe rogpeppe added NeedsFix and removed NeedsInvestigation Triage Requires triage/attention labels Apr 13, 2022
cueckoo pushed a commit that referenced this issue Apr 19, 2022
Fixes #1305

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ib78066542f0f54bb13f507be48a9bd0ce6285741
cueckoo pushed a commit that referenced this issue Apr 19, 2022
Fixes #1305

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ib78066542f0f54bb13f507be48a9bd0ce6285741
qequ pushed a commit to qequ/cue that referenced this issue May 20, 2022
Fixes cue-lang#1305

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ib78066542f0f54bb13f507be48a9bd0ce6285741
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/536712
Unity-Result: CUEcueckoo <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Marcel van Lohuizen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
get go issues related to cue get go NeedsFix
Projects
None yet
Development

No branches or pull requests

6 participants