-
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.
cue/load: evaluate only those packages which are needed
DO NOT REVIEW This change changes the cue/load logic to expand package wildcards before invoking the `modpkgload.LoadPackages` resolution logic. This involves moving the wildcard expansion code into a new place, independent of the `cue/load.loader` which is created after doing that. We use the `modimports.AllModuleFiles` logic to enumerate the packages matched by a wildcard. All tests pass apart from the ones involving `cue import`, which expose a significant flaw in the above approach: `modimports.AllModuleFiles` only looks for CUE files, but `cue import` relies on the fact that package patterns will currently match directories that do not contain any CUE files. Fixes #3155 Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I9f4b210eb0588e21ae942a97d7cf34c9887363dc
- Loading branch information
Showing
28 changed files
with
652 additions
and
243 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
! exec cue export ./issue174 | ||
cmp stderr expect-stderr | ||
-- expect-stderr -- | ||
cannot enumerate all module imports: invalid import path "'foo'" in issue174/issue174.cue | ||
cannot find package "mod.test/issue174@v0": cannot get imports: invalid import path "'foo'" in issue174/issue174.cue | ||
-- cue.mod/module.cue -- | ||
module: "mod.test" | ||
language: version: "v0.9.0" | ||
-- issue174/issue174.cue -- | ||
package issue174 | ||
|
||
import 'foo' | ||
|
||
a: 1 |
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
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.