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

godotenv godot list doesn't work if you run a single installation with the -stable suffix #89

Open
DarkPro1337 opened this issue Dec 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@DarkPro1337
Copy link

I tried to install Godot 4.3.0 stable via godotenv godot install 4.0.1-stable since godotenv godot list -r outputs versions with suffixes. After successful installation, godotenv godot list returns an NullReferenceException to output:

PS C:\Users\admin> godotenv godot list
ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__48_0(GodotInstallation i) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:578
  at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
  at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
  at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.GetInstallationsList() in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:578
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ListLocalVersions(ILog log, IGodotRepository godotRepo) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\GodotListCommand.cs:25
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ExecuteAsync(IConsole console) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\GodotListCommand.cs:53
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in \_\CliFx\CliApplication.cs:163
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in \_\CliFx\CliApplication.cs:204

After I tried installing 4.3.0 just without the suffix godotenv godot install 4.3.0, the godotenv godot list command worked, but started outputting two identical versions.

PS C:\Users\admin> godotenv godot list
4.3.0 dotnet *
4.3.0 dotnet *

Seems to be a bug due to the -stable suffix introduced for the version. I hope this repro will help to find the bug. This was a fresh installation of GodotEnv.

@jolexxa
Copy link
Member

jolexxa commented Dec 20, 2024

I think we need to lock down versions and make it fail to install unless you specify the version perfectly. We've had others feel that it's too forgiving and have done work to make it more accepting, but I personally feel that it shouldn't even install unless you get the version perfectly correct in the format it wants. Otherwise you end up in situations like this and there are lots of edge cases.

I tried to install Godot 4.3.0 stable via godotenv godot install 4.0.1-stable

What do you mean by you were you installing 4.3.0 with 4.0.1-stable? Those are two totally different versions.

@jolexxa jolexxa added the bug Something isn't working label Dec 20, 2024
@DarkPro1337
Copy link
Author

What do you mean by you were you installing 4.3.0 with 4.0.1-stable? Those are two totally different versions.

I'm sorry I made a mistake in my sentence. I was installing 4.3.0-stable and 4.3.0. :|

@jolexxa
Copy link
Member

jolexxa commented Dec 24, 2024

As I understand it, GodotEnv is accepting incorrect version strings. When that happens, it is still smart enough to install Godot, but then it isn't able to realize it installed that version of Godot later because the version strings aren't normalized well enough under-the-hood. This is because version strings control the directory name of the Godot installation, and GodotEnv uses the file system to recognize what installations are available. So, it's important we fully normalize versions — doing so would fix this issue.

We could also just make it error when you specify an incorrect version string, but that may not be as intuitive since the remote source for listing versions is now GitHub (as opposed to nuget), which has funkier looking versions and would mislead folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants