this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/cueexperiment: enable embed experiment by default

As Paul announced in the embed proposal discussion on GitHub [1],
we have moved the proposal to a "likely accept" stage
and we are enabling the feature by defalut for CUE v0.12.

Enable it by default for the first alpha, v0.12.0-alpha.1,
for the sake of giving it as much testing as possible before v0.12.0.

While here, update the TODOs in the symlink embedding testscript file.
We ended up deciding to support symlinks, but the test wasn't updated.

[1]: https://cuelang.org/discussion/3264

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I499940a2dc799552963783174ed30dc0a312d925
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205861
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>

+8 -16
+2 -2
cmd/cue/cmd/help.go
··· 254 254 255 255 Note that embedding cue files is not supported at this time. 256 256 257 - Note: support for embed is experimental, and is enabled via 258 - CUE_EXPERIMENT=embed. 257 + Note: support for embed is experimental, and can be disabled via 258 + CUE_EXPERIMENT=embed=0. 259 259 260 260 For more details and discussion, see the proposal linked from 261 261 https://cuelang.org/discussion/3264.
+3 -2
cmd/cue/cmd/testdata/script/embed.txtar
··· 1 + # Embedding is enabled by default, but it can still be disabled. 2 + env CUE_EXPERIMENT=embed=0 1 3 ! exec cue eval 2 4 cmp stderr out/noembed 3 - 4 - env CUE_EXPERIMENT=embed 5 + env CUE_EXPERIMENT= 5 6 6 7 exec cue eval 7 8 cmp stdout out/eval
+2 -5
cmd/cue/cmd/testdata/script/embed_err.txtar
··· 1 - env CUE_EXPERIMENT=embed 2 - 3 1 ! exec cue eval 4 2 ! stdout . 5 3 cmp stderr out/err 6 4 7 - # On systems with symlink support, check that we don't allow embedding symlinks. 8 - # TODO(mvdan): we don't reject valid symlinks yet; see https://cuelang.org/issue/3299. 9 - # TODO: if we support symlinks in the future, add a test case for a symlink pointing to a file 5 + # On systems with symlink support, we follow symlinks when embedding files. 6 + # TODO: add a test case for a symlink pointing to a file 10 7 # outside of the current module, as that should likely be forbidden. 11 8 [!symlink] stop 12 9 cd symlink
-1
cmd/cue/cmd/testdata/script/embed_file_err.txtar
··· 1 1 # Test what happens when there is an error an embedded file. 2 2 # The error should mention the name of the file where the error is. 3 3 4 - env CUE_EXPERIMENT=embed 5 4 ! exec cue vet 6 5 cmp stderr want-stderr 7 6 ! exec cue export
-2
cmd/cue/cmd/testdata/script/embed_mod.txtar
··· 1 - env CUE_EXPERIMENT=embed 2 - 3 1 exec cue mod tidy 4 2 exec cue eval ./acme/foo 5 3 cmp stdout out/eval
-2
cmd/cue/cmd/testdata/script/embed_windows.txtar
··· 1 - env CUE_EXPERIMENT=embed 2 - 3 1 [!windows] cp reuse.json 'star/*.json' 4 2 [!windows] exec cue export --out cue 5 3 [!windows] cmp stdout out/export-unix
-1
encoding/jsonschema/internal/externaltest/tests.go
··· 88 88 } 89 89 return nil, err 90 90 } 91 - os.Setenv("CUE_EXPERIMENT", "embed") 92 91 inst := load.Instances([]string{"."}, &load.Config{ 93 92 Dir: dir, 94 93 // Just like in the cue/load tests, prevent Go tests from walking up to the root
+1 -1
internal/cueexperiment/exp.go
··· 20 20 EvalV3 bool 21 21 22 22 // Embed enables file embedding. 23 - Embed bool 23 + Embed bool `envflag:"default:true"` 24 24 25 25 // DecodeInt64 changes [cuelang.org/go/cue.Value.Decode] to choose 26 26 // `int64` rather than `int` as the default type for CUE integer values