Skip to content
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

[four-point-oh?] Concept for a dependency resolver on package level #1631

Closed
LDAP opened this issue Feb 16, 2023 · 2 comments
Closed

[four-point-oh?] Concept for a dependency resolver on package level #1631

LDAP opened this issue Feb 16, 2023 · 2 comments

Comments

@LDAP
Copy link

LDAP commented Feb 16, 2023

  1. There's also no concept for a dependency resolver on package level.

dependencies.json would need to be extended so it can also contain package dependency definitions. It supports libraries only, atm. The repository.json scheme would need to be extended to enable packages to define dependencies upstream in the same way as it is possible for libraries.

Much effort was taken to disable and reenable all installed/updated/removed packages in one step to avoid possible race conditions. Adding package level dependencies would require a further (massive?) refactoring of the whole "job batching" strategy.

Originally posted by @deathaxe in #1628 (comment)

If we accept that package dependencies are installed after the fact and ST needs to be restarted in some cases (LSP-helpers that depend on LSP), the repository.json scheme must not be updated as far as I can see.
This would already suit many plugins since the package dependencies are mostly optional (e.g. providing extra functionality if Terminus or Debugger are available).

I could attempt to provide a PR in this case.

@deathaxe
Copy link
Collaborator

deathaxe commented Feb 17, 2023

the repository.json scheme must not be updated

Even though barely used, plugins can provide dependency/library specification upstream via dependencies: {...} aka. libraries: {...} as an alternative for dependencies.json. With the discussion about adding support to force unmaintained packages to run on python 3.8 via upstream setting in mind it would probably just make sense to also support upstream package level dependencies, optionally.

Libraries are installed/updated during package installation. The same would need to happen for packages with the difference that those need to be disabled before installing or upgrading. As dependencies are not known before a package has been downloaded and extracted, we again end up in disabling and enabling packages nearly one by one, which is the main cause of all the trouble with packages keeping disabled after upgrade or batch install/upgrade operations being rather unreliable. This should not be the outcome of any future change again.

Note: Just try to copy a Package Control.sublime-settings with about 70 packages to a new ST setup and try to let PC 3.4 install everything. You'll need dozens of restarts with dozens of error dialogs before everything is up and running.

Hence a solution would look like:

  1. Getting a list of packages to install,
  2. download them all to a temp dir
  3. resolve dependencies
  4. download dependencies
  5. repeat step 3 and 4 until all packages are downloaded
  6. call PakageDisabler.disable_packages() for all downloaded packages
  7. perform install/update
  8. call PakageDisabler.reenable_packages() for all downloaded packages

@deathaxe
Copy link
Collaborator

see also: #1089

@deathaxe deathaxe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants