-
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
Fix RiscV installation/uninstallation #107
Fix RiscV installation/uninstallation #107
Conversation
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.
Looks good overall, but left a few comments. Feel free to ignore them 😁
@@ -189,7 +190,7 @@ fn install(args: InstallOpts) -> Result<()> { | |||
|
|||
exports.extend(llvm.install()?); | |||
|
|||
if targets.contains(&Target::ESP32C3) { | |||
if targets.contains(&Target::ESP32C3) || targets.contains(&Target::ESP32C2) { |
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.
Maybe a nicer way of handling this (which could be done in a separate PR) would be to implement some helpers on Target
to determine the architecture. As we continue to add support for addition devices we're going to keep needing to chain expressions with ||
here.
Maybe if we do something like this:
impl Target {
pub fn riscv(&self) -> bool {
!self.xtensa()
}
pub fn xtensa(&self) -> bool {
matches!(self, Target::Esp32 | Target::Esp32s2 | Target::Esp32s3)
}
}
We can then change this line (and the others like it) to something like this:
if targets.iter().any(|t| t.riscv()) {
//
}
Just a thought, doesn't really matter right now but will likely clean things up in the future. If you don't like this idea then that is fine of course too 😁
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.
Thanks for the idea! It would definitely things scale better! I will address this on a different PR though. I also plan to install RISC-V GCC toolchain (riscv32-esp-elf
) for ESP32-S2 and ESP32-S3 for the ULP coprocessor.
ESP32C3
. Now its also installed withESP32C2
espup uninstall
when several RiscV targets were installed. Seeuninstall
command fails when using multiple RiscV targets #106 for more details