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

CUE modules that have a gen directory can't be used #3233

Open
vikstrous2 opened this issue Jun 14, 2024 · 4 comments
Open

CUE modules that have a gen directory can't be used #3233

vikstrous2 opened this issue Jun 14, 2024 · 4 comments
Labels
NeedsInvestigation Triage Requires triage/attention

Comments

@vikstrous2
Copy link

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

cue version v0.9.0-rc.1

go version go1.22.1
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
cue.lang.version v0.9.0

Does this issue reproduce with the latest stable release?

yes

What did you do?

In a new directory, create a module and add a dependency:

cue mod init github.com/vikstrous/cuek8stest
cue mod get github.com/vikstrous/cuek8s

Create a file: test.cue

package cuek8stest

import "github.com/vikstrous/cuek8s"

hello: cuek8s.#Hello

service: cuek8s.#Service

Then run cue eval

What did you expect to see?

it shouldn't error

What did you see instead?

github.com/vikstrous/[email protected]/vikstrous/cuek8s: import failed: import failed: cannot find package "k8s.io/api/core/v1": cannot find module providing package k8s.io/api/core/v1:
    ./test.cue:3:8
    ../.cache/cue/mod/extract/github.com/vikstrous/[email protected]/hello.cue:3:8
@vikstrous2 vikstrous2 added NeedsInvestigation Triage Requires triage/attention labels Jun 14, 2024
@nyarly
Copy link

nyarly commented Jun 18, 2024

I'm seeing something similar as well

@ckazimie
Copy link

Same here.

@vikstrous2
Copy link
Author

I'm planning to start trying to work around this by rewriting package paths and moving the gen packages out of the gen directory. To reproduce this issue, use version v0.0.8 of https://github.com/vikstrous/cuek8s

@vikstrous2
Copy link
Author

This is the workaround: https://github.com/vikstrous/cuek8s/blob/master/generate.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Triage Requires triage/attention
Projects
None yet
Development

No branches or pull requests

3 participants