-
Notifications
You must be signed in to change notification settings - Fork 279
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
DO NOT REVIEW: some fixes still needed 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 code which adds `"user"` to the path stack when evaluating command-line-provided files has been removed as being confusing (ISTM that the name "user" is not something that is likely to make any sense to an end user in that context). The protobuf code is fixed to work in the presence of major version module suffixes. The `cue/load` code is fixed to construct import paths correctly in the presence of major version suffixes. That also addresses an existing TODO to use `module.ParseImportPath`. An upcoming `cue mod fix` command will be added to make it more straightforward to migrate. Fixes #3127. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I7c384c785eac6203966460703283ecfa2d9f0447
- Loading branch information
Showing
14 changed files
with
64 additions
and
49 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 -- | ||
|
9 changes: 5 additions & 4 deletions
9
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,4 +1,5 @@ | ||
! exec cue mod tidy | ||
cmp stderr want-stderr | ||
-- want-stderr -- | ||
modules experiment not enabled (enable with CUE_EXPERIMENT=modules) | ||
# Check that modules are enabled by default. | ||
exec cue mod tidy | ||
-- cue.mod/module.cue -- | ||
module: "test.example" | ||
language: version: "v0.9.0" |
4 changes: 2 additions & 2 deletions
4
cmd/cue/cmd/testdata/script/registry_experiment_not_set.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
cmd/cue/cmd/testdata/script/registry_no_experiment_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
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