-
-
Notifications
You must be signed in to change notification settings - Fork 231
PackageManager: Support directly loading a sub-package via path-based getOrLoadPackage()
#2977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ PR OK, no changes in deprecations or warnings Total deprecations: 0 Total warnings: 0 Build statistics: statistics (-before, +after)
-executable size=5105200 bin/dub
+executable size=5109296 bin/dub
rough build time=60s Full build output
|
@@ -271,7 +271,8 @@ class PackageManager { | |||
foreach (ovr; repo.overrides) | |||
if (ovr.package_ == name.toString() && ovr.source.matches(ver)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the overrides should only apply to base packages as a whole, not on a sub-package basis. I.e., ovr.package_ == name.main.toString()
.
c6c8a6b
to
8aec744
Compare
mode = Whether to issue errors, warning, or ignore unknown keys in dub.json | ||
|
||
Returns: The packages loaded from the given path | ||
Throws: Throws an exception if no package can be loaded | ||
*/ | ||
Package getOrLoadPackage(NativePath path, NativePath recipe_path = NativePath.init, | ||
bool allow_sub_packages = false, StrictMode mode = StrictMode.Ignore) | ||
PackageName name = PackageName.init, StrictMode mode = StrictMode.Ignore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breaking API change is in a separate 2nd commit, in case we cannot/don't want to break it.
LGTM. Feel free to rebase + merge. I've been wanting to have a much more in-depth change to the PackageManager since forever (storing packages hierarchically in memory) but never finished it. I think that's a pretty good improvement, sorry for forgetting to review it for so long. |
… getOrLoadPackage() To avoid a costly full packages scan to resolve the sub-package later.
2cc1e07
to
07a6a5f
Compare
To avoid a costly full packages scan to resolve the sub-package later.