-
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.
mod/modregistry: allow RegistryResolver to return ErrRegistryNotFound
When using an explicit `none` registry, we don't want the error returned by `Resolver.ResolveToRegistry` to count as a hard error and prevent resolution of other module paths, so define a new error type and make `modconfig.Resolver.ResolveToRegistry` return it. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: Ica0b210628d337118dd11de166428ada1f33b576 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193764 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
4 changed files
with
46 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Check that we can tidy a module when using a no-fallback | ||
# "none" registry. | ||
|
||
env CUE_REGISTRY=foo.com/bar=$CUE_REGISTRY1,none | ||
exec cue mod tidy | ||
exec cue eval . | ||
cmp stdout want-stdout | ||
|
||
-- want-stdout -- | ||
x: "hello" | ||
-- cue.mod/module.cue -- | ||
module: "main.org@v0" | ||
language: version: "v0.8.0" | ||
-- main.cue -- | ||
package main | ||
import "foo.com/bar/baz@v0" | ||
|
||
baz | ||
|
||
-- _registry1/foo.com_bar_v0.0.1/cue.mod/module.cue -- | ||
module: "foo.com/bar@v0" | ||
language: version: "v0.8.0" | ||
|
||
-- _registry1/foo.com_bar_v0.0.1/baz/baz.cue -- | ||
package baz | ||
x: "hello" |
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