openupm/openupm-cli

Can not find com.unity.postprocessing@14.0.9 via CLI

favoyang opened this issue · 9 comments

I think this bug still remains with some packages.

It is OK for com.unity.postprocessing, but this bug still happens with com.unity.render-pipelines.universal

The latest version of com.unity.render-pipelines.universal is now 14.0.9, however,

openupm add com.unity.render-pipelines.universal@14.0.1 outputs the error, and maximum version which can be installed is 10.10.1

WARN 404 version 14.0.1 is not a valid choice of: 7.0.0, 7.0.1, 7.1.1, 7.1.2, 7.1.5, 7.1.6, 7.1.7, 7.1.8, 7.2.0, 7.2.1, 8.0.1, 7.3.1, 9.0.0-preview.14, 8.1.0, 7.4.1, 9.0.0-preview.35, 8.2.0, 10.0.0-preview.26, 7.4.2, 7.4.3, 9.0.0-preview.55, 7.5.1, 10.1.0, 9.0.0-preview.72, 10.2.0, 8.3.1, 10.2.1, 7.5.2, 10.2.2, 10.3.1, 7.5.3, 10.3.2, 10.4.0, 7.6.0, 10.5.0, 7.7.0, 10.5.1, 10.6.0, 7.7.1, 10.7.0, 10.8.0, 10.8.1, 10.9.0, 10.10.0, 10.10.1

Because of this, I cannot add dependencies which requires com.unity.render-pipelines.universal 14.0.1 such as
com.unity.polyspatial@0.7.1 in my package.

Please take a look. I will use -f option until this bug fixes.

Thank you for the great service, anyway.
Best

Originally posted by @from2001 in #19 (comment)

The CLI reports that 14.0.9 is not a valid version of com.unity.render-pipelines.universal in the Unity registry. Because the URP package became a built-in package and its publishing on the Unity registry ceased after version 10.

https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.0/manual/installing-universalrp-into-an-existing-project.html

image

For built-in, the version of it has been aligned with your Unity Editor. For example, Unity 2022.2fx assumes to work with URP 14.0.7. When installing the package, it is copied from the Editor folder instead of fetching from the Unity registry.

The Editor folder is located at,
/c/Program Files/Unity/Hub/Editor/x.y.z/Editor/Data/Resources/PackageManager/BuiltInPackages/...

My assumption: if you install com.unity.polyspatial for Unity 2022.3 (the minimal editor version polyspatial requires), though com.unity.polyspatial requires version 14.0.1 of URP, what got installed will be the same version that locates in the BuiltInPackages folder above. (I haven't tested it yet).

The solution: CLI should update the internal built-in Unity packages list (or read it from the Unity folder) and ignore them from the validation process.

@all-contributors please add @from2001 for bug.

@favoyang

I've put up a pull request to add @from2001! 🎉

Thank you @favoyang . I'll wait for the fix of the bug.