Closed mattiasgronlund closed 6 months ago
Hi, nice work!
I run into a small problem, where cargokit fails if rustup esp toolchain is installed:
$ rustup target list --toolchain esp --installed error: toolchain 'esp' does not support components: esp is a custom toolchain
The following small hack allows cargokit to ignore the esp toolchain, and all other toolchains which fails to be queried for targets...
--- a/build_tool/lib/src/rustup.dart +++ b/build_tool/lib/src/rustup.dart @@ -78,19 +78,24 @@ class Rustup { } static List<String> _getInstalledTargets(String toolchain) { - final res = runCommand("rustup", [ - 'target', - 'list', - '--toolchain', - toolchain, - '--installed', - ]); - final lines = res.stdout - .toString() - .split('\n') - .where((e) => e.isNotEmpty) - .toList(growable: true); - return lines; + try { + final res = runCommand("rustup", [ + 'target', + 'list', + '--toolchain', + toolchain, + '--installed', + ]); + final lines = res.stdout + .toString() + .split('\n') + .where((e) => e.isNotEmpty) + .toList(growable: true); + return lines; + } catch (e) { + log.warning("Ignoring toolchain: $toolchain"); + return []; + } } bool _didInstallRustSrcForNightly = false;
I think we should probably filter out everything that does not start with "nightly", "stable" or "beta". I don't know if there is any way to convince rustup not to list custom toolchains.
Hi, nice work!
I run into a small problem, where cargokit fails if rustup esp toolchain is installed:
The following small hack allows cargokit to ignore the esp toolchain, and all other toolchains which fails to be queried for targets...