arduino / arduino-cli

Arduino command line tool

Home Page:https://arduino.github.io/arduino-cli/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing Github Actions CI using install.sh - Listing more than one github download link - v0.35.0

tyeth opened this issue · comments

Describe the problem

all our CI is failing and I've traced through, and it seems like the grep is failing, but more like the newlines are not being detected by grep (or the $APPLICATION_DIST is incorrectly set - but the first arduino.cc download attempt says otherwise). Works in windows (ignoring cut), and wsl fine, but not in github actions.
CI Output: logs_9.zip https://github.com/adafruit/Adafruit_Arcada/actions/runs/7388865095/job/20100744127#step:5:84
Which leads (via our ci script) to the grep listing more than one file here: https://github.com/arduino/arduino-cli/blob/master/install.sh#L171
I have no idea really, escaping or maybe the environment variables in actions are causing problems as the arch is detected and the commands work apart from that (there was some example of migrating to return stdout in a special github actions format instead).

Installing in /home/runner/work/Adafruit_Arcada/Adafruit_Arcada/bin
ARCH=64bit
OS=Linux
Using curl as download tool
Downloading https://downloads.arduino.cc/arduino-cli/arduino-cli_v0.35.0_Linux_64bit.tar.gz
Did not find a release for your system: Linux 64bit
Trying to find a release using the GitHub API.
Downloading https://github.com/arduino/arduino-cli/releases/download/v0.35.0/0.35.0-checksums.txt
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_configuration.schema.json
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_32bit.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_64bit.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_ARM64.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_ARMv6.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_ARMv7.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_macOS_64bit.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_macOS_ARM64.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_proto.zip
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Windows_32bit.zip
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Windows_64bit.msi
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Windows_64bit.zip
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/CHANGELOG.md
Failed to install arduino-cli
Error: Process completed with exit code 3.

To reproduce

having setup paths etc run
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh

Expected behavior

Script installs Linux_x64bit release from github

Arduino CLI version

0.35.0

Operating system

Linux

Operating system version

23.04 maybe? github actions ubuntu-latest

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

At the advice of @brentru I'm tagging the people in the know... @cmaglie @facchinm @per1234 @alessio-perugini

Hi,
The problem is in my case :
$APPLICATION_DIST = arduino-cli_v0.35.0_Linux_64bit.tar.gz

but we have

https://github.com/arduino/arduino-cli/releases/download/v0.35.0/0.35.0-checksums.txt
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_configuration.schema.json
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_32bit.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_64bit.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_ARM64.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_ARMv6.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Linux_ARMv7.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_macOS_64bit.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_macOS_ARM64.tar.gz
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_proto.zip
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Windows_32bit.zip
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Windows_64bit.msi
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/arduino-cli_0.35.0_Windows_64bit.zip
https://github.com/arduino/arduino-cli/releases/download/v0.35.0/CHANGELOG.md

for echo "$BODY" | grep 'browser_' | cut -d\" -f4

So first var contains a v for arduino-cli_v0.35 but no v for second var $DOWNLOAD_URL (arduino-cli_0.35...)

According to install.sh script and wiki curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s -- 0.35.0 should be a temporary fix until the real fix

you can test with this Dockerfile under wsl2 with ubuntu updated

FROM debian:latest

RUN apt-get update \
    && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install curl git

Well deduced @ozanges, thanks, that unblocks me although I'd like to fix it ideally.
Not sure if it's okay to update the taskfile.yml to prepend v, as it seems the go routine getting the version via semver and drops the v prefix (skipping over quickly - not a go person). Alternatively the version.go file could be modified, or if undesired then the release-go-task.yml and publish-go-nightly-task.yml and publish-go-tester-task.yml could be modified instead.

Thanks @tyeth for the quick fix. I will test it when PR will be validated.

Thanks for the prompt bug report!

We have fixed the install.sh in master branch, the problem should be fixed now.
Please reopen or comment here if the issue is still present.

Tested & fixed.
Thanks for your efficiency