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: evaluation of build attributes is order-dependent #3228

Closed
jpluscplusm opened this issue Jun 13, 2024 · 0 comments
Closed

cmd/cue: evaluation of build attributes is order-dependent #3228

jpluscplusm opened this issue Jun 13, 2024 · 0 comments
Labels
NeedsInvestigation Triage Requires triage/attention

Comments

@jpluscplusm
Copy link
Collaborator

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

$ cue version
cue version v0.9.0

go version go1.22.4
      -buildmode exe
       -compiler gc
       -trimpath true
     CGO_ENABLED 0
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
cue.lang.version v0.9.0

Does this issue reproduce with the latest stable release?

Yes, 0.9.0

What did you do?

! exec cue export
cmp stderr error

exec cue export -t C
cmp stdout out

exec cue export -t A -t B
cmp stdout out

exec cue export -t A -t C
cmp stdout out

# This fails.
exec cue export -t B -t C
cmp stdout out

# This fails.
exec cue export -t A -t B -t C
cmp stdout out
-- example.cue --
@if( A && B || C )
package example

x: 1
-- out --
{
    "x": 1
}
-- error --
build constraints exclude all CUE files in .:
    example.cue: @if( A && B || C ) did not match

What did you expect to see?

A passing test.

What did you see instead?

# This fails. (0.053s)
> exec cue export -t B -t C
[stderr]
tag "B" not used in any file
[exit status 1]
FAIL: /tmp/testscript275180635/build.attributes.areOrderDependent.txtar/script.txtar:14: unexpected command failure
@jpluscplusm jpluscplusm added NeedsInvestigation Triage Requires triage/attention labels Jun 13, 2024
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jun 13, 2024
This guide demonstrates how to include (and exclude) CUE files from
evaluations using build attributes.

Only single-attribute build conditions are demonstrated, in light of the
discovery that build attributes have order-dependent behaviours that
(even if worked around on the page with careful tag selection) present a
potential trip wire for the user - hence we shouldn't yet present more
complex examples of combining tags. cue-lang/cue#3228 tracks this.

Preview-Path: /docs/howto/conditionally-include-cue-files-using-build-attributes/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I8a88cb9e5e03d0cadb4287f69b70beddbf78a40d
Dispatch-Trailer: {"type":"trybot","CL":1196270,"patchset":1,"ref":"refs/changes/70/1196270/1","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jun 17, 2024
This guide demonstrates how to include (and exclude) CUE files from
evaluations using build attributes.

Only single-attribute build conditions are demonstrated, in light of the
discovery that build attributes have order-dependent behaviours that
(even if worked around on the page with careful tag selection) present a
potential trip wire for the user - hence we shouldn't yet present more
complex examples of combining tags. cue-lang/cue#3228 tracks this.

Preview-Path: /docs/howto/conditionally-include-cue-files-using-build-attributes/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I8a88cb9e5e03d0cadb4287f69b70beddbf78a40d
Dispatch-Trailer: {"type":"trybot","CL":1196270,"patchset":2,"ref":"refs/changes/70/1196270/2","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jun 17, 2024
This guide demonstrates how to include (and exclude) CUE files from
evaluations using build attributes.

Only single-attribute build conditions are demonstrated, in light of the
discovery that build attributes have order-dependent behaviours that
(even if worked around on the page with careful tag selection) present a
potential trip wire for the user - hence we shouldn't yet present more
complex examples of combining tags. cue-lang/cue#3228 tracks this.

Preview-Path: /docs/howto/conditionally-include-cue-files-using-build-attributes/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I8a88cb9e5e03d0cadb4287f69b70beddbf78a40d
Dispatch-Trailer: {"type":"trybot","CL":1196270,"patchset":3,"ref":"refs/changes/70/1196270/3","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Jun 22, 2024
This guide demonstrates how to include (and exclude) CUE files from
evaluations using build attributes.

Only single-attribute build conditions are demonstrated, in light of the
discovery that build attributes have order-dependent behaviours that
(even if worked around on the page with careful tag selection) present a
potential trip wire for the user - hence we shouldn't yet present more
complex examples of combining tags. cue-lang/cue#3228 tracks this.

Preview-Path: /docs/howto/conditionally-include-cue-files-using-build-attributes/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I8a88cb9e5e03d0cadb4287f69b70beddbf78a40d
Dispatch-Trailer: {"type":"trybot","CL":1196270,"patchset":4,"ref":"refs/changes/70/1196270/4","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue Jun 22, 2024
This guide demonstrates how to include (and exclude) CUE files from
evaluations using build attributes.

Only single-attribute build conditions are demonstrated, in light of the
discovery that build attributes have order-dependent behaviours that
(even if worked around on the page with careful tag selection) present a
potential trip wire for the user - hence we shouldn't yet present more
complex examples of combining tags. cue-lang/cue#3228 tracks this.

Preview-Path: /docs/howto/conditionally-include-cue-files-using-build-attributes/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I8a88cb9e5e03d0cadb4287f69b70beddbf78a40d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1196270
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
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

1 participant