-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue/load: treat stdlib-like import on command line as error
It's not currently possible to name a stdlib package on the command line, except for the edge case of when a directory of that name exists in cue.mod/{pkg,gen,usr}. Close off that edge case by making it an error to import such a package as part of the command-line arguments. In the future, we might want to explicitly allow this, but the current situation seems wrong. This also fixes stdlib-imports in modules mode, because it prevents the resolution logic from ever seeing a package with no module. Fixes #2964 Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I22bbe764bb16fb2a992189981c9bb9d28fd3e78a Dispatch-Trailer: {"type":"trybot","CL":1185363,"patchset":3,"ref":"refs/changes/63/1185363/3","targetBranch":"master"}
- Loading branch information
Showing
4 changed files
with
18 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
env CUE_EXPERIMENT=modules | ||
exec cue mod init test.example | ||
! exec cue export anypath | ||
cmp stderr want-stderr | ||
-- want-stderr -- | ||
"anypath" cannot be imported as CUE package |
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