-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/cueversion: split language and module versions
This means that the CUE logic will not predicate language semantics on a relatively volatile build-info-derived version. Instead the semantics are predicated on a simple compiled-in string and the original logic is used for version information that's displayed as part of the `cue version` command and forms part of the User-Agent HTTP header. We also fix the module version logic so that it works when CUE is used as a dependency as well as a main module. Note that writing a local regression test for this is hard, as dependency modules only have versions as provided by a proxy, and deps replaced by a directory don't have module versions. Fixes #3061 Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I55bc931590974a5a50b0d82d78cba0a64efbd0f6 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194044 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
15 changed files
with
88 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# TODO we might want to deprecate or remove the ability to create | ||
# module file with an empty module directive. | ||
env CUE_VERSION_OVERRIDE=v0.8.100 | ||
exec cue mod init | ||
env-fill want-module.cue | ||
cmp cue.mod/module.cue want-module.cue | ||
exists cue.mod/usr | ||
exists cue.mod/pkg | ||
|
||
-- want-module.cue -- | ||
module: "" | ||
language: { | ||
version: "v0.8.100" | ||
version: "$CUE_LANGUAGE_VERSION" | ||
} |
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
28 changes: 0 additions & 28 deletions
28
cmd/cue/cmd/testdata/script/modinit_with_pseudoversion.txtar
This file was deleted.
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
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,14 +1,15 @@ | ||
# Version output without VCS information. | ||
exec cue version | ||
stdout -count=1 '^cue version v0.[1-9]' | ||
stdout -count=1 '^cue version .+' | ||
stdout -count=1 '^go version (devel )?go1.' | ||
|
||
# Version output with VCS information. | ||
env CUE_VERSION_TEST_CFG='[{"Key":"vcs","Value":"git"},{"Key":"vcs.revision","Value":"47b7032385cb490fab7d47b89fca36835cf13d39"},{"Key":"vcs.time","Value":"2022-05-10T04:58:46Z"},{"Key":"vcs.modified","Value":"true"}]' | ||
exec cue version | ||
stdout -count=1 '^cue version v0.[1-9]' | ||
stdout -count=1 '^cue version .+' | ||
stdout -count=1 '^go version (devel )?go1.' | ||
stdout -count=1 'vcs git' | ||
stdout -count=1 'vcs\.revision 47b7032385cb490fab7d47b89fca36835cf13d39' | ||
stdout -count=1 'vcs\.time 2022-05-10T04:58:46Z' | ||
stdout -count=1 'vcs\.modified true' | ||
stdout -count=1 'cue\.lang\.version '${CUE_LANGUAGE_VERSION@R}'$' |
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
Oops, something went wrong.