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: help embed still says that file embedding is experimental #3769

Open
jpluscplusm opened this issue Feb 18, 2025 · 0 comments
Open

Comments

@jpluscplusm
Copy link
Collaborator

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

$ cue version
cue version v0.12.0

go version go1.23.5
      -buildmode exe
       -compiler gc
  DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
cue.lang.version v0.12.0

Does this issue reproduce with the latest stable release?

v0.12.0 is latest.

What did you do?

exec cue help embed
! stdout xperiment
! stdout proposal
! stdout disable

What did you expect to see?

A passing test, indicating that the help text didn't:

  • didn't mention anything being experimental
  • didn't link to a proposal, now that the feature has been released
  • didn't mention that the feature can be disabled (if indeed it cannot)

What did you see instead?

> exec cue help embed
[stdout]
The @embed attribute can be used to load files as part of CUE evaluation.
Embedding must be enabled by a file-level @extern(embed) attribute.

Embed a single file as follows, which must exist when evaluating:

        @extern(embed)

        package foo

        a: _ @embed(file=foo.json)

Embed many files of the same type with a glob pattern,
which inserts one field per file matched:

        b: _ @embed(glob=images/*.*, type=binary)
        b: [string]: bytes

Note that "**" glob patterns are not supported at this time.

If the file extension in "file" or "glob" does not imply a file type,
it must be specified with the "type" encoding as shown above.
See the "filetypes" help topic for more.

Files containing multiple documents cannot be embedded directly.
For NDJSON or multi-document YAML files, embed as type=text
and use APIs like yaml.Extract to decode as a list.

Note that embedding cue files is not supported at this time.

Note: support for embed is experimental, and can be disabled via
CUE_EXPERIMENT=embed=0.

For more details and discussion, see the proposal linked from
https://cuelang.org/discussion/3264.

> ! stdout xperiment
FAIL: cue.help.embed.mentionsExperimentalFeature.txtar:2: unexpected match for `xperiment` found in stdout: xperiment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant