-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/mod/modpkgload: support packages without major versions
When there's no major version in a package import path, try to find one from the requirements. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Iceee9a0589d5b23748c07ef64c2815a853ae0041 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1173323 Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
4 changed files
with
55 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
main.test@v0 | ||
-- test0/root-packages -- | ||
main.test@v0 | ||
-- test0/default-major-versions -- | ||
-- test0/want -- | ||
main.test@v0 | ||
flags: inAll,isRoot,fromRoot,importsLoaded | ||
|
@@ -18,6 +19,7 @@ main.test@v0 | |
[email protected] | ||
-- test1/root-packages -- | ||
main.test@v0 | ||
-- test1/default-major-versions -- | ||
-- test1/want -- | ||
main.test@v0 | ||
flags: inAll,isRoot,fromRoot,importsLoaded | ||
|
37 changes: 37 additions & 0 deletions
37
internal/mod/modpkgload/testdata/withdefaultmajorversions.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,37 @@ | ||
-- test0/initial-requirements -- | ||
main.test@v0 [email protected] | ||
-- test0/root-packages -- | ||
main.test@v0 | ||
example.com/blah | ||
-- test0/default-major-versions -- | ||
example.com@v0 | ||
-- test0/want -- | ||
main.test@v0 | ||
flags: inAll,isRoot,fromRoot,importsLoaded | ||
mod: main.test@v0 | ||
location: . | ||
imports: | ||
example.com/blah | ||
example.com/blah | ||
flags: inAll,isRoot,fromRoot,importsLoaded | ||
mod: [email protected] | ||
location: _registry/example.com_v0.0.1/blah | ||
imports: | ||
foo.com/bar/hello/goodbye@v0 | ||
foo.com/bar/hello/goodbye@v0 | ||
flags: inAll,isRoot,fromRoot | ||
error: cannot fetch foo.com/bar/[email protected]: module foo.com/bar/[email protected] not found at _registry/foo.com_bar_hello_v0.2.3 | ||
missing: false | ||
-- main.cue -- | ||
package main | ||
import "example.com/blah" | ||
|
||
-- _registry/example.com_v0.0.1/cue.mod/module.cue -- | ||
module: "example.com@v0" | ||
deps: { | ||
"foo.com/bar/hello@v0": v: "v0.2.3" | ||
"bar.com@v0": v: "v0.5.0" | ||
} | ||
-- _registry/example.com_v0.0.1/blah/blah.cue -- | ||
package blah | ||
import _ "foo.com/bar/hello/goodbye@v0" |