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

u3d/installer: support custom install paths through U3D_EXTRA_PATHS #373

Conversation

niezbop
Copy link
Member

@niezbop niezbop commented Nov 4, 2019

Pull Request Checklist

  • My pull request has been rebased on master
  • I ran bundle exec rspec to make sure that my PR didn't break any test
  • I ran bundle exec rubocop to make sure that my PR is inline with our code style
  • I have read the code of conduct

Pull Request Description

u3d install supports custom installation paths, but does not list them correctly in the rest of the application.
This means that u3d run, package installs and such commands will not detect properly the version installed in a custom path.

This fixes this behaviour by adding an environment variable U3D_EXTRA_PATHS which is a list of additional paths to look for installed Unity versions.

Fixes #370
Fixes #371

@niezbop niezbop added the bug label Nov 4, 2019
@niezbop niezbop requested a review from lacostej November 4, 2019 17:05
@niezbop niezbop self-assigned this Nov 4, 2019
Copy link
Member

@lacostej lacostej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpicks on the code.

More generally I am just wondering about the ease of use of the feature. We pass arguments to install but use a variable here. Maybe a more usable way would be for u3d to keep track of those locations somewhere?

Finally after we agree on the feature, we need to update the doc.

lib/u3d/installer.rb Outdated Show resolved Hide resolved
lib/u3d/installer.rb Outdated Show resolved Hide resolved
lib/u3d/installer.rb Outdated Show resolved Hide resolved
@niezbop
Copy link
Member Author

niezbop commented Nov 6, 2019

Understood. I did think about having some sort of ~/.u3d/installation_paths config file, which could be expanded when using --installation_path, but I find that a bit less robust, since it introduces some "magic" that would get broken if the installation was to be moved.

My rationale is that with the introduction of the Unity Hub and its CLI, u3d may be more and more a CI tool than a Unity developer tool. In this perspective, I think an environment variable works best since it is more easily accessible through CI platforms and easier to automate as well.

And from a user perspective, one could only have to specify the env in the .bashrc or something. Maybe we could a comment about this when installing Unity at an usual location. Something like:

You specified --installation_path LOCATION. You will need to add LOCATION to U3D_EXTRA_PATHS to make sure that the other commands can find your installation.

@bdovaz
Copy link

bdovaz commented Nov 6, 2019

I'll explain our case which is very simple.

Until now we had a 256GB SSD disk for the operating system and the different versions of Unity. As you can imagine, it is very short because we work with many projects in parallel in different versions of Unity and different platforms. This makes the disk fill very fast.

Recently we have installed in two Jenkins nodes two 1TB SSD disks and that's when I found the problem of not being able to automate what I had until now in non-standard directories.

For our case, which is CI, it is good that they are environment variables because they are very easy to configure.

@niezbop niezbop force-pushed the feature/installer/find_custom_installation_path_with_env branch from 557fb40 to 295d30c Compare November 7, 2019 11:15
@niezbop niezbop merged commit aa6b6be into DragonBox:master Nov 7, 2019
@niezbop niezbop deleted the feature/installer/find_custom_installation_path_with_env branch November 7, 2019 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

installation_path parameter problems u3d list command does not work in non-standard path
3 participants