-
Notifications
You must be signed in to change notification settings - Fork 32
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
Download Rust into $XDG_CACHE_HOME #366
Comments
Can you please submit a PR for that? The issue if that
I think if cargo is found, rustup shouldn't be required. Can you please open a separate issue describing this issue with rustup, with minimal workflow to reproduce? |
Added #367 for the local installation issue. I think the rest of Eclipse is using some Eclipse-specific API to find the right directory, isn't it? I have never done Eclipse plugin development before, so I don't know how to implement this and I have no way to test a PR anyway.
|
To be honest, I don't know. I'm not aware of such API. It's most probably that each plugin has it's own logic. For |
You can set https://rust-lang.github.io/rustup/environment-variables.html No idea where does Which https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary It says |
BTW, even outside container, it's probably not such a great idea to install dependencies like this globally. Downloaded dependencies should be somewhere in private Corrosion directory. |
Turns out this is a long-standing issue in upstream (rust-lang/rfcs#1615). Apparently some people are against it with argument that goes like "why make things easier for 3rd party tools by making our own code more complicated". The 3rd party tool is Corrosion in this case. So that's it. If this is to be done, it will have to be done on Corrosion level with some hope that someday it will be fixed upstream. |
Thanks for finding out the root issue upstream. |
There's no workaround. Flatpak does not allow path remapping. Sharing I currently don't have time to climb the learning curve of Eclipse plugin development. |
So this one is not a blocker but #367 is? |
Solving either one will unblock container use. Right now, if I want isolation, I can opt for either virtual machine with Eclipse+Corrosion or lightweight setup with Geany (or other editor) + dockerized Rust. |
In order to get rustup to install everything in custom location, Corrosion has to:
It also has to download |
Corrosion relies on rustup to install toolchains and I think that should be preserved. If the concern is Flatpak please try installing corrosion in https://github.com/flathub/org.eclipse.Java - it contains a shim which allows executing host commands so corrosion was working fine in flatpak last I tried. |
Doesn't that create a hole in the container? I have my own Eclipse flatpak build that completely isolates the container from the host. |
It does but that's not an issue for an IDE and especially when we speak about C/C++ development there is practically no way to have all tools/libraries/headers in the container. |
@akurtakov I am pretty sure I would be able to cram C/C++ toolchain in the container. Isolation is a very serious issue for IDEs. IDEs download literally thousands of components that were built on machines of thousands of developers. At least one of them is bound to be compromised. It's either containers or VMs or online IDEs (which themselves run in VMs). I personally prefer containers for their superior desktop integration. |
Actually, isolation is more often an anti-pattern for IDE. I stands for "Integrated", and on a desktop, it means integrated with other tools the developer may need. |
$HOME
is not writable in flatpak and other app containers, because allowing arbitrary writes under$HOME
would allow easy container escape by adding binaries in~/.local/bin/
for example (which Corrosion happens to be doing withrust-analyzer
, BTW). You should instead use variables defined in XDG Base Directory Specification just like the rest of Eclipse does. The most suitable location for Rust downloads would be probably$XDG_CACHE_HOME
.This would also prevent polluting user's home directory with more application-specific data directories as
$XDG_CACHE_HOME
defaults to$HOME/.cache
.BTW, I did not find a way to point Corrosion to my own installation of Rust. Normal installation includes
rustc
andcargo
binaries and it can includerust-analyzer
, but Corrosion for some reason requiresrustup
(the installer).The text was updated successfully, but these errors were encountered: