Skip to content

Darwin/amd64 installs wrong tools (darwin/amd64) #751

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

Closed
3 tasks done
umbynos opened this issue Dec 22, 2022 · 0 comments · Fixed by #753
Closed
3 tasks done

Darwin/amd64 installs wrong tools (darwin/amd64) #751

umbynos opened this issue Dec 22, 2022 · 0 comments · Fixed by #753
Assignees
Labels
architecture: arm Specific to ARM host architecture os: macos Specific to macOS operating system priority: high Resolution is a high priority type: imperfection Perceived defect in any part of project

Comments

@umbynos
Copy link
Contributor

umbynos commented Dec 22, 2022

Describe the problem

Running the getting started on MacOS with Amd64 architecture causes the agent to download the wrong tool system (when multiple macOS systems are available for a tool) an example of this is the arduino-fwuploader which is available both for amd64 and arm64.

To reproduce

Connect a board with an old fw (for example Nina 1.4.3) to the PC and add a new device in Arduino IoT Cloud. Perform the getting started. It should fail trying to run the arduino-fwuploader with an error similar to Bad CPU type in executable.

(The problem is that the agent has downloaded the arm64 binary instead of the amd64 one)

Expected behavior

The agent should download the correct binary

Arduino Create Agent version

1.2.7

Operating system

macOS

Operating system version

N/A

Browser

N/A

Browser version

N/A

Additional context

The problem should be fixed in

var systems = map[string]string{
"linuxamd64": "x86_64-linux-gnu",
"linux386": "i686-linux-gnu",
"darwinamd64": "apple-darwin",
"windows386": "i686-mingw32",
"windowsamd64": "i686-mingw32",
"linuxarm": "arm-linux-gnueabihf",
}

Even better would be to use the Arduino CLI way of detecting and downloading a tool: https://github.com/arduino/arduino-cli/blob/08d746dd9c31ce75b94a2c3caced3e34b6687f6a/arduino/cores/tools.go#L126-L213

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@umbynos umbynos added priority: high Resolution is a high priority os: macos Specific to macOS operating system architecture: arm Specific to ARM host architecture type: imperfection Perceived defect in any part of project labels Dec 22, 2022
@umbynos umbynos self-assigned this Dec 22, 2022
umbynos added a commit that referenced this issue Dec 22, 2022
umbynos added a commit that referenced this issue Dec 22, 2022
umbynos added a commit that referenced this issue Dec 22, 2022
umbynos added a commit that referenced this issue Dec 23, 2022
umbynos added a commit that referenced this issue Jan 9, 2023
* add go-paths-helper lib

* make GOOS and GOARCH global vars to allow testing

* add test to replicate #751

* use and old version of the lib, (in the new version the algorithm was changed 🤷‍♂️)

* add tool download for m1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture: arm Specific to ARM host architecture os: macos Specific to macOS operating system priority: high Resolution is a high priority type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant