Skip to content

Install Arduino CLI build dependencies in all dependent workflows #1348

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

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Install Arduino CLI build dependencies in all dependent workflows #1348

merged 1 commit into from
Aug 24, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 24, 2022

Motivation

Arduino CLI is a tool dependency of Arduino IDE. For this reason, the necessary Arduino CLI build is acquired whenever running the yarn command in the repository.

The way the Arduino CLI build is acquired depends on the type of version specified as dependency in the arduino.cli.version field of the arduino-ide-extension package metadata:

This means that, in the latter case, all build dependencies of Arduino CLI must be present. While the Go module dependencies are automatically installed during the build, the build tool dependencies must be installed in advance:

Arduino IDE's infrastructure was recently changed to use the Task tool to build Arduino CLI in the standard manner (#1315). A step to install Task was not added to some of the workflows that run yarn, which caused them to fail when a non-release version of Arduino CLI was used as a dependency:

https://github.com/arduino/arduino-ide/runs/7985963886?check_suite_focus=true#step:4:52

arduino-ide-extension: >>> Building the CLI...
arduino-ide-extension: /bin/sh: 1: task: not found
arduino-ide-extension: error Command failed with exit code 1.

Change description

Add a step for the missing tool dependency to those workflows.

The lack of an explicit installation of the other dependency, Go did not result in an error because Go is pre-installed on the GitHub Actions runner. However, the installed version may not match the version Arduino CLI is intended to be built with and validated for, and the version provided by the runner may change at any time. For this reason, it will be safest to explicitly set up the appropriate version of Go in the workflows.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

Arduino CLI is a tool dependency of Arduino IDE. For this reason, the necessary Arduino CLI build is acquired whenever
running the `yarn` command in the repository.

The way the Arduino CLI build is acquired depends on the type of version specified as dependency in the
`arduino.cli.version` field of the arduino-ide-extension package metadata:

- Release/nightly: download pre-built standard distribution
- Git ref: build from source

This means that, in the latter case, all build dependencies of Arduino CLI must be present. While the Go module
dependencies are automatically installed during the build, the build tool dependencies must be installed in advance:

- Go programming language
- Task task runner

Arduino IDE's infrastructure was recently changed to use the Task tool to build Arduino CLI in the supported manner. A
step to install Task was not added to some of the workflows that run `yarn`, which caused them to fail when a
non-release version of Arduino CLI was used as a dependency:

arduino-ide-extension: >>> Building the CLI...
arduino-ide-extension: /bin/sh: 1: task: not found
arduino-ide-extension: error Command failed with exit code 1.

A step for the missing tool dependency is hereby added to those workflows.

The lack of an explicit installation of the other dependency, Go did not result in an error because Go is pre-installed
on the GitHub Actions runner. However, the installed version may not match the version Arduino CLI is intended to be
built with and validated for, and the version provided by the runner may change at any time. For this reason, it will be
safest to explicitly set up the appropriate version of Go in the workflows.
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Aug 24, 2022
@per1234 per1234 self-assigned this Aug 24, 2022
Comment on lines +25 to +35
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn run i18n:push:

Installing the entire IDE2 dependencies to push the translations makes no sense. Hence adding Golang and Task is also unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same for the nightly and weekly translation pushes and for the theme.

Instead of adding unnecessary workflow dependencies, we should clean up these tasks and make them IDE2/Theia independent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the should be no reason to pull in the Arduino CLI dependency. I didn't set up this infrastructure and I don't know anything about it other than that it is failing right now.

My proposal gets them back to a working state, even if just as inefficient as before.

If someone wants to clean the system up, great, but I don't have time to figure that all out.

@kittaakos kittaakos self-requested a review August 24, 2022 08:03
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge these changes, to fix the builds. Thank you!

We can do the task refactorings later. Here is the follow-up.

@per1234 per1234 merged commit 125bd64 into arduino:main Aug 24, 2022
@per1234 per1234 deleted the install-cli-build-deps branch August 24, 2022 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants