-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Global binary links/shims #118
Comments
Please read the documentation on how to use xpm to install the toolchain for each project: |
xPacks allow, by design, to install multiple versions of a package and to lock each project to a specific version.
Installing globally was the initial method, for use by Eclipse, but it is now deprecated in favour of installing locally, for each project.
This is exactly what installing locally does, it adds links/shims from Even more, you can define separate dependencies for each build configuration, for example you can build a configuration with the Arm toolchain, and another with the RISC-V toolchain. For this to work, xpm adds links/shims to each You can see a functional example in the hello-world project template. |
I understand that you don't want to support installing globally. Do you plan on deprecating and eventually removing |
I do support installing globally, and I don't think But, since dependencies are defined per project or per build configuration, the recommended method is to install locally, which, in addition to installing in the global store, adds the links/shims. Plus that if you use I can add links/shims to a global folder, but you loose the ability to control which versions are used. Is this really what you want? Can you help me understand what are the arguments in favour of using global (un-versioned, in a folder that you must manually add to the path) vs project local (versioned, in a folder automatically added to the path) dependencies? |
One example in favor of global dependencies: if you want, as a user, to have access to the commands in windows-build-tools in your terminal. Personally, I agree that local dependencies are better. In fact you convinced me to switch to local dependencies for my own project here. But it seems weird to support explicitly installing xPacks globally, but to provide no easy way to use those global packs. Should eclipse not move towards using local xPacks? |
I initially considered this, but I have a big problem with adding these commands to a global path, since they can be picked by various build tools by accident, and result in non-reproducible builds. This can be solved by adding an optional What happens on Windows if you install a global npm package, do you get the shims? If so, in which folder? (npm was the inspiration for xpm and preferably the behaviour should be similar). BTW, the initial design also included a way to install in system locations (
Probably it should, but interest for it is declining anyway, and I'm migrating everything to Visual Studio Code, which already is able to use xPacks. |
Global modules are installed under |
Aha. So there is a precedent. In this case we'll do something similar. I have to think on the details, since each platform is slightly different. |
How about |
I think if you want to support linking multiple different versions of an xpack to different places, that would be acceptable. I'd probably call it just But a simpler and more npm-like approach would be to use a single directory like |
My main concern is how to prevent global installs interfere with other builds, in other words (unless explicitly instructed by the user), there should be no links in system locations. A path like But things are not that simple, if a safe path like On my Mac I never add anything to the user PATH, and I always install in custom folders. Then I have shell aliases which I use to temporarily extend the PATH of the current shell with the desired folders, and in this way I have total control on various build environments. I know that on Windows the PATH management is a nightmare, with lots of folders; in such environments installing multiple versions of the same tool is a gamble, depending on path order. Thus my first idea was to do not add links by default. Those who want the links should ask for them explicitly, and should take responsibility for the PATH. Another detail is that while there are a lot of general purpose npm packages, that can be installed in a system location, and they are usually not a danger for other builds, the xpm binary packages are all tools related to builds, so they present a higher risk. This will require some thinking to sort things out... |
The time has come for some more work on xpm, and I'm considering this feature too. How about |
Is your feature request related to a problem?
xpm creates a different global directory for every version of an xpack. This makes running and upgrading globally installed binaries difficult.
Describe the solution you'd like
An explicit global install (
xpm install --global abc
) should link/shim the various binaries within the xpack into the globalxPacks/.bin
Describe alternatives you've considered
One alternative is to require an additional flag to add the global link/shim.
Additional context and comments
Currently I have to change my PATH every time I upgrade arm-gcc, for instance.
I'm on Windows.
The text was updated successfully, but these errors were encountered: