Removing Package doesn't remove dependency package.
needs more information
anatawa12
I'm trying adding & removing User Package with some small test packages to know how VCC resolves dependencies, these days.
When I added and removed a package with the following
package.json
, "com.anatawa12.custom-localization-for-editor-extension"
will still exist in dependencies.I'm sorry if this will be fixed with unimplemented planned feature of VCC.
Steps to reproduce
- Create empty folder & create `package.json` with the following json
- Add the created folder as user packages to Creator Companion.
- Select a project in CreatorCompanion
- Add 'UPM VPM Test' on User Packages tab
- Remove 'UPM VPM Test' on User Packages tab
Expected behavior
"com.anatawa12.custom-localization-for-editor-extension" does not exist in dependencies of project (
manifest.json
).Actual behavior
"com.anatawa12.custom-localization-for-editor-extension" still exist in dependencies of project (
manifest.json
).**The
package.json
file**{
"name": "com.anatawa12.upm-vpm-test",
"displayName": "UPM VPM Test",
"version": "0.1.0",
"gitDependencies": {
"com.anatawa12.custom-localization-for-editor-extension": "https://github.com/anatawa12/CustomLocalization4EditorExtension.git#0.1.2"
}
}
Log In
Momo the Monster
needs more information
Now that VPM dependencies are manage separately from regular Unity Project dependencies, is this still an issue?
anatawa12
Momo the Monster: It looks VPM still keep unnecessary packages.
Of course, unnecessary dependency package is listed on VCC so It's possible to uninstall manually.
In my test, UdonSharp, a library that will be used in world project so keeping can be useful for users.
However, we may make some package only for editor plugin (tools), not for world project.
(e.g. CustomLocalization4EditorExtension is only for tools but not for world/avatar project.)
I think Megacrafter127's suggestion to have flag in the package.json can be good.
If you're worried about tool authors, I think people who make tools have as enough knowledge as errors by automatic uninstalling dependency package can be resolved.
package.json I used to test:
{
"name": "com.anatawa12.vpm-test.vpm-resolver“,
"displayName": "VPM Test",
"version": "0.1.0",
“vpmDependencies": {
"com.vrchat.udonsharp”: "1.1.0"
}
}
Momo the Monster
tracked
anatawa12
@Megacrafter127 I think VPM should remove B and A as UPM and other managers such as Gradle does.
Megacrafter127
anatawa12: I see two other solutions:
- have a flag in the package.json that tells VPM whether or not the package provides user functionality on its own. If it does not, VPM can safely remove it if no package depends on it.
- behave similar to apt in that VPM remembers if it was asked to install a package or if a package was installed as a dependency. And only the latter can be removed automatically.
Megacrafter127
A big issue here is differentiating between a package that was only installed as a dependency vs a package that the user actually wants to keep installed.
E.g. suppose packages A, B, C and D are installed, with each package being dependent on the previous package [A<-B<-C<-D].
Packages A and C aren't directly useful to the user, but are requirements for packages B and D respectively.
After some time and consideration, the user concludes that package D is no longer needed, and moves to uninstall it.
The user still wishes to keep B installed though. How is VPM supposed to know to remove C, but to keep B?