From d9f5fd0c6afba3c899da6323842fc86e0e641d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Fri, 18 Mar 2022 16:47:12 +0100 Subject: [PATCH 1/3] use force on install toolkit --- .github/workflows/build.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89319318b..3874ec2d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,9 @@ +#on: +# push: +# branches: +# - main on: push: - branches: - - main name: Build xous-core @@ -11,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - task: ["hosted-ci", "renode-image"] + task: ["hosted-ci"] #, "renode-image"] steps: - name: Install Ubuntu dependencies run: | @@ -31,7 +33,7 @@ jobs: - uses: Swatinem/rust-cache@v1 - name: Install RISC-V toolkit - run: cargo xtask install-toolkit - + run: cargo xtask install-toolkit --force + - name: Build hosted-ci run: cargo xtask ${{ matrix.task }} From ccafeb21a3cca34953662d939804a0c7728a2cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Fri, 18 Mar 2022 17:05:51 +0100 Subject: [PATCH 2/3] if not tty but force install is true, keep going --- xtask/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 9196c5b3e..df200fec6 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -1123,7 +1123,7 @@ fn ensure_compiler( let toolchain_path = get_sysroot(None)?.ok_or_else(|| "default toolchain not installed".to_owned())?; // If the terminal is a tty, offer to download the latest toolchain. - if !atty::is(atty::Stream::Stdin) { + if !atty::is(atty::Stream::Stdin) && !force_install { return Err(format!("Toolchain for {} not found", target)); } From ae2762e7f563c6fefe52be16e3db59d8cb9bfdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Fri, 18 Mar 2022 17:17:34 +0100 Subject: [PATCH 3/3] fix: on non-TTY terminals if forced, proceed with toolchain download and install This is a corner case in Github CI. --- .github/workflows/build.yml | 8 +++----- xtask/src/main.rs | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3874ec2d8..b94b35111 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,7 @@ -#on: -# push: -# branches: -# - main on: push: + branches: + - main name: Build xous-core @@ -13,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - task: ["hosted-ci"] #, "renode-image"] + task: ["hosted-ci", "renode-image"] steps: - name: Install Ubuntu dependencies run: | diff --git a/xtask/src/main.rs b/xtask/src/main.rs index df200fec6..9eee9a152 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -1122,7 +1122,8 @@ fn ensure_compiler( // Since no sysroot exists, we must download a new one. let toolchain_path = get_sysroot(None)?.ok_or_else(|| "default toolchain not installed".to_owned())?; - // If the terminal is a tty, offer to download the latest toolchain. + // If the terminal is a tty, or if toolchain installation is forced, + // download the latest toolchain. if !atty::is(atty::Stream::Stdin) && !force_install { return Err(format!("Toolchain for {} not found", target)); }