Open Geod24 opened 2 years ago
I don't think anything can be done in that regard for add-local/add-path packages. The contained "version" can change at any moment by checking out a different commit, so it needs to be re-checked on every run. There could maybe some kind of optimization where it is assumed that the same package stays in the same folder, but even that needs to be updated at some point.
The contained "version" can change at any moment by checking out a different commit, so it needs to be re-checked on every run.
But we don't. We determine the version (or get it provided explicitly) when doing add-local
and stick with that.
We even have a check that we don't add something with a different version. Full code here:
https://github.com/dlang/dub/blob/7175eadfa7a7f58522caa524e42e4419918da408/source/dub/packagemanager.d#L713-L737
Regarding add-path
, yes, we need to re-scan every time. But moving the entries to the location/repository config removes one extra file and makes things more visible.
But we don't. We determine the version (or get it provided explicitly) when doing add-local and stick with that. We even have a check that we don't add something with a different version.
Okay, that's really weird behavior, no idea why it was decided to be done that way, TBH. So it would indeed work for add-local then in that regard. However, that still doesn't cover the precedence issue.
Regarding add-path, yes, we need to re-scan every time. But moving the entries to the location/repository config removes one extra file and makes things more visible.
I just get a weird feeling when an application starts to modify user provided configuration files. So far, settings.json only contains fields set by users and local-packages.json/local-overrides.json are completely managed by dub. Is configy able to retain the existing formatting when applying changes?
I just get a weird feeling when an application starts to modify user provided configuration files. So far, settings.json only contains fields set by users and local-packages.json/local-overrides.json are completely managed by dub. Is configy able to retain the existing formatting when applying changes?
Think of it as git config
:)
And yes, D-YAML is able to retain the style, but Configy probably will need to be extended for this (it was never intended for writing).
we also need such a framework for user-friendly JSON writing for dub.selections.json (dub select
)
This has been discussed on Slack with @WebFreak001 . Posting it here if someone wants to pick up the issue.
@WebFreak001 answered: