Closed eugenesvk closed 3 years ago
Try adding the env variable to your default shell pro-file (~/.profile
, ~/.zprofile
, ~/.bash_profile
, or whatever your have there).
thanks for a prompt response!
- ST generally mimics your shell environment.
Yeah, it most definitely should! Unless it doesn't :(
And as far as I understood in my previous attempts to fix PATH (which Sublime wouldn't pick up) macOS is especially tricky in this regard, so I ended up using https://packagecontrol.io/packages/Fix Mac Path
to fix PATH, but that package unfortunately doesn't allow setting other env variables like RUSTUP_HOME
The shell profile files you mentioned only seem to work when bash/zsh are default login shells, but for e.g. fish shell they don't work :(
Will try to find some alternative solution, but any tips are welcome!
Pushed support for env overrides in plugin settings:
"env": {"RUSTUP_HOME": "..."}
Let me know if this helps.
The change isn't on Package Control yet. Since you have the plugin setup locally, you can pull to test this.
Thanks for such a quick fix! Can confirm that I can set the env var via settings now and it's working just fine!
I have an issue with rustfmt not getting proper env vars and as a result not working, e.g. when I'm doing the following:
executable
path torustfmt
inRustFmt.sublime-settings
RustFmt: Format Buffer
commanderror: no override and no default toolchain set
This is due to the missing path to the
rustup
folderIf I manually add the correct env var in your plugin's
RustFmt.py
file like so:everything is working fine (setting
CARGO_HOME
or addingCARGO_HOME/bin
toPATH
doesn't help)Do you know how I could pass the
RUSTUP_HOME
config to your plugin via a config or something? Don't know how to do that properly in Sublime Text in macOS, there are no global vars or anything and manually settingimport os; os.environ['RUSTUP_HOME']=os.path.expanduser('~/.dev/rustup')
in a console didn't help Thanks!macOS 10.15 Sublime Text 3 (but also 4) rustc 1.54.0 (installed via rustup) rustfmt 1.4.37-stable