-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/cueexperiment: flip modules experiment flag default
This change enables the modules experiment by default. This will cause CUE code to fail if there is no language version in the module.cue file, amongst other things. The experiment can be disabled by setting CUE_EXPERIMENT=modules=0 Many of the unit tests need to be changed in order to add the now-mandatory language.version field. Some error messages have now changed. Some logic in the `cue fmt` command that relies on seeing a `load.PackageError` required the respective code inside `cue/load` to produce that error, which also changes some error messages. The `cue mod fix` command is now available to make it it more straightforward to migrate. The module path in encoding/gocode/testdata/cue.mod/module.cue has been changed to match the modules-enabled default, otherwise the generation code fails with an error about a mismatched module path. Fixes #3127. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I7c384c785eac6203966460703283ecfa2d9f0447 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194664 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
- Loading branch information
Showing
18 changed files
with
68 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
cmd/cue/cmd/testdata/script/modpublish_registry_not_enabled.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
env CUE_EXPERIMENT=modules=false | ||
! exec cue mod publish v1.0.0 | ||
cmp stderr want-stderr | ||
-- want-stderr -- | ||
|
5 changes: 5 additions & 0 deletions
5
cmd/cue/cmd/testdata/script/modtidy_default_modules_mode.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Check that modules are enabled by default. | ||
exec cue mod tidy | ||
-- cue.mod/module.cue -- | ||
module: "test.example" | ||
language: version: "v0.9.0" |
2 changes: 2 additions & 0 deletions
2
cmd/cue/cmd/testdata/script/modtidy_registry_not_enabled.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
env CUE_EXPERIMENT=modules=0 | ||
|
||
! exec cue mod tidy | ||
cmp stderr want-stderr | ||
-- want-stderr -- | ||
|
4 changes: 2 additions & 2 deletions
4
.../script/registry_experiment_not_set.txtar → ...ta/script/registry_modules_disabled.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ript/registry_no_experiment_warning.txtar → ...t/registry_modules_disabled_warning.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
module: "cuelang.org/go/encoding/gocode/testdata" | ||
module: "cuelang.org/go/encoding/gocode/testdata@v0" | ||
language: version: "v0.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters