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/load: non-package CUE file causes resolution logic to fail #3244

Closed
rogpeppe opened this issue Jun 25, 2024 · 0 comments
Closed

cue/load: non-package CUE file causes resolution logic to fail #3244

rogpeppe opened this issue Jun 25, 2024 · 0 comments
Labels
modules Issues related to CUE modules and the experimental implementation NeedsFix

Comments

@rogpeppe
Copy link
Member

rogpeppe commented Jun 25, 2024

This issue was originally raised by Judson Lester (@nyarly) in this Slack thread.

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

v0.9.1

Does this issue reproduce with the latest stable release?

Yes, but it's a regression since earlier.

What did you do?

exec cue vet
-- cue.mod/gen/other.example/monitoring/register_go_gen.cue --
package monitoring

-- cue.mod/module.cue --
module: "test.example"
language: version: "v0.9.0"

-- prometheus-api.cue --
package kustomize

import "other.example/monitoring"
_z: monitoring

-- unnamed.cue --
import ()

What did you expect to see?

A passing test

What did you see instead?

> exec cue vet
[stderr]
test.example@v0: import failed: no dependency found for package "other.example/monitoring":
    ./prometheus-api.cue:3:8
[exit status 1]
FAIL: /tmp/y.txtar:1: unexpected command failure
@rogpeppe rogpeppe added NeedsInvestigation Triage Requires triage/attention NeedsFix and removed NeedsInvestigation Triage Requires triage/attention labels Jun 25, 2024
cueckoo pushed a commit that referenced this issue Jun 25, 2024
This change adds some tests that cover CUE's behavior
with respect to underscore package identifiers.
See issue #3167 for some previous discussion
on this area.

For #3167
For #3244

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ib99400373e49065be6cbe50642c771a19df571d5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196719
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
cueckoo pushed a commit that referenced this issue Jun 26, 2024
This change adds some tests that cover CUE's behavior
with respect to underscore package identifiers.
See issue #3167 for some previous discussion
on this area.

For #3167
For #3244

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ib99400373e49065be6cbe50642c771a19df571d5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196719
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
(cherry picked from commit 9295a20)
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196784
Reviewed-by: Paul Jolly <paul@myitcv.io>
cueckoo pushed a commit that referenced this issue Jun 26, 2024
…alifier

When cue/load is loading a package with an explicit qualifier
we only want to load the files declaring that package name.
However, in the edge case where the qualifier wasn't specified,
we would always consider files which did not declare any package name,
which was an unintended regression from `CUE_EXPERIMENT=modules=0`.

Fixes #3244

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I64e81bdba5c1be9b35b08af5e72e631adbae6a9d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196720
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
(cherry picked from commit 5ab2d73)
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196785
Reviewed-by: Paul Jolly <paul@myitcv.io>
@myitcv myitcv added the modules Issues related to CUE modules and the experimental implementation label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules Issues related to CUE modules and the experimental implementation NeedsFix
Projects
Status: v0.9.2
Development

No branches or pull requests

2 participants