-
Notifications
You must be signed in to change notification settings - Fork 24
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
Setup user environment #381
Conversation
} | ||
} | ||
|
||
set_env_variable("PATH", &path)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have significant concern about adding some specific versions of Xtensa and RISC-V GCC to the global PATH variable. Before IDF has adopted the "export.sh" approach to managing the environment, we got many bug reports which ended up being due to the compiler version mismatch, for example because the user has been using two versions of IDF (and hence to versions of the compiler) in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, there are some scenarios where this could happen, the main scenario being, that we update GCC version.
- One possible solution to this could be storing GCC in
$HOME/.rustup/toolchains/esp/<arch>-esp-elf
instead of$HOME/.rustup/toolchains/esp/<arch>-esp-elf/<gcc_version/<arch>-esp-elf
- This would avoid having old GCC version in the user path
- Note that since the latest GCC release, Xtensa got unified GCC under
xtensa-esp-elf
Also, if we are able to use LLD as linker, which should be at some point soon, we don't need to modify user PATH, as:
- std already downloads (and uses) GCC when building the project
- no_std only uses GCC as linker, and it would be replaced by LLD
In this case, we only need to set up theLIBCLANG_PATH
as it's required by std projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick note, if we remove the <gcc_version>
from the installation path, we should check the version when installing (eg using <target>-gcc --version
)
This PR basically copies how rustup handles the user environment modification.
--no-modify-env
flag that avoids modifying the user environment..sh
and.fish
are generated$HOME/.rustup/toolchain/<esp_toolchain>
--no-modify-env
flag, he needs to source one of these files.-no-modify-env
flag is used. (we already do this).bat
and.ps1
, are generated under$HOME/.rustup/toolchain/<esp_toolchain>
--no-modify-env
flag, he needs to source one of these files.rustup
This would be the usual output of
espup install
for a Unix system: