openupm-cli icon indicating copy to clipboard operation
openupm-cli copied to clipboard

openupm cli add package will not add packages for non-up-to-date unity versions

Open maxhimmel opened this issue 3 years ago • 8 comments

I have Unity 2019.4.17f1

I'm trying to add a list of unity packages from a shell script:

I run the command openupm add com.unity.postprocessing Response: WARN editor.version requires 2019.4.19f1 but found 2019.4.17f1 notice suggest upgrade the editor to 2019.4.19f1, or run with option -f to ignore the warning

I also run the command openupm add com.unity.render-pipelines.universal Response: WARN editor.version requires 2020.2.3f1 but found 2019.4.17f1 notice suggest upgrade the editor to 2020.2.3f1, or run with option -f to ignore the warning

It seems like a bug to me that this cli tool wouldn't auto-select the most up-to-date version of the package that is valid for the current version of the unity editor. Much like how the UPM does so. At least those are my expectations.

Am I using this tool incorrectly? Am I missing an option in the CLI?

The -f option isn't working for me either because it installs the most up-to-date version of the package into the editor which isn't supported by my current version of the editor.

Also, this tool is amazing and it was great fun integrating it into my tooling for expedited project creation. I hope this is an easy fix or I'm just doing something dumb!

maxhimmel avatar Mar 06 '21 18:03 maxhimmel

Hi @maxhimmel,

Thank you for the report, I confirm it's a bug. When providing a package without a version, it shall install the most up-to-date version of the package that is valid for the current version of the unity editor.

favoyang avatar Mar 07 '21 03:03 favoyang

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 [email protected] 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 [email protected] in my package.

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

Thank you for the great service, anyway. Best

from2001 avatar Dec 28 '23 10:12 from2001

The naive fix for this is to walk back package versions from the latest until a version is found that works for the current editor-version. This could involve a lot of web-requests. I could implement it this way, but I wanted to first ask if there are alternative suggestions.

ComradeVanti avatar Jan 16 '24 12:01 ComradeVanti

The naive fix for this is to walk back package versions from the latest until a version is found that works for the current editor-version. This could involve a lot of web-requests. I could implement it this way, but I wanted to first ask if there are alternative suggestions.

For the original issue from @maxhimmel, it can be solved by going through a reverse sorted of Packument.versions, then find which entry.unity is empty or fits (<=) the current editorVersion.

image

favoyang avatar Jan 17 '24 15:01 favoyang

The following question from @from2001 is a different issue. I have converted it into https://github.com/openupm/openupm-cli/issues/133

favoyang avatar Jan 17 '24 15:01 favoyang

That's true, I did not think of that. I will look into this.

ComradeVanti avatar Jan 18 '24 14:01 ComradeVanti

@all-contributors please add @maxhimmel for bug.

favoyang avatar Jan 20 '24 05:01 favoyang

@favoyang

I've put up a pull request to add @maxhimmel! :tada:

allcontributors[bot] avatar Jan 20 '24 05:01 allcontributors[bot]