-
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: obey "all packages" mode when loading files
When load.Config.Package is "*", we document the behavior where cue/load will load all files no matter what package they belong to. This was obeyed in importPkg entrypoint when dealing with package args, but not in cueFilesPackage when loading a list of CUE files directly. Be consistent between the two by setting allPackages and PkgName. Note that cueFilesPackage is different than importPkg in that it wants all files to be part of a single build.Instance, even when they have different package names. To properly obey allPackages as part of a single build.Instance, tweak fileProcessor.add to obey allPackages and not error on mismatches, and tweak Instance.AddSyntax to ignore mismatches when User is set, which it is when the package was created from individual files. Note that the above requires setting User before calling addFiles. This fixes two issues, both of which had the same root cause due to the mismatching package names causing some files to either be ignored or result in incorrect mismatch errors. While here, remove the allFiles field and parameter, neither of which was ever used. Perhaps a duplicate of allPackages. Also stop setting ignoreOther in the "cue fmt" scenario. When loading all packages, we explicitly do not want to ignore files which belong to other packages. The true boolean appeared pointless, but it still confused me for a bit, so remove it. Fixes #1938. Fixes #2523. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I3d742404711d7c91895448d827234a62427fba68 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185356 TryBot-Result: CUEcueckoo <cueckoo@gmail.com> Reviewed-by: Roger Peppe <rogpeppe@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
- Loading branch information
Showing
7 changed files
with
54 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
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