Skip to content

error building on FreeBSD #1854

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
duncan-bayne opened this issue Aug 29, 2022 · 5 comments
Closed
3 tasks done

error building on FreeBSD #1854

duncan-bayne opened this issue Aug 29, 2022 · 5 comments
Assignees
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@duncan-bayne
Copy link

Describe the problem

When I try to build arduino-cli with task build, I receive the following error:

$ task build
task: [go:build] go build -v -ldflags ' -X github.com/arduino/arduino-cli/version.versionString=git-snapshot -X github.com/arduino/arduino-cli/version.commit=aa41d72e -X github.com/arduino/arduino-cli/version.date=2022-08-29T12:47:49Z '
github.com/arduino/arduino-cli/i18n
# github.com/arduino/arduino-cli/i18n
i18n/detect.go:24:9: undefined: getLocaleIdentifier
task: Failed to run task "go:build": exit status 2

To reproduce

  1. git clone https://github.com/arduino/arduino-cli/
  2. cd arduino-cli
  3. task build

Expected behavior

I'd expect arduino-cli to compile without errors.

Arduino CLI version

aa41d72

Operating system

N/A

Operating system version

FreeBSD 13.1-RELEASE GENERIC amd64

Additional context

  • FreeBSD 13.1-RELEASE GENERIC amd64
  • Task version: v3.14.1 (h1:myTmEIbMbQx2D+g5lJvnbSqX531HmxiaQuefAqz8ISA=)
  • go version go1.18.5 freebsd/amd64

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
@duncan-bayne duncan-bayne added the type: imperfection Perceived defect in any part of project label Aug 29, 2022
@per1234
Copy link
Contributor

per1234 commented Aug 30, 2022

Hi @duncan-bayne. Thanks for your report.

The github.com/arduino/arduino-cli/i18n.getLocaleIdentifier function is defined in files which have build constraints via the file name suffix for the following operating systems:

The file with the suffix matching the GOOS environment variable value will be built. If no file suffix matches GOOS, build fails with the error you encountered.

@per1234 per1234 added the topic: code Related to content of the project itself label Aug 30, 2022
@duncan-bayne
Copy link
Author

duncan-bayne commented Aug 30, 2022

Okay thanks - that makes sense. Would you be interested in a pull request with the necessary implementation for FreeBSD? I'd be happy to contribute one in order to enable support on my OS of choice :)

@duncan-bayne
Copy link
Author

Looking into this a bit further, there is a good range of Arduino related ports available in FreeBSD already, including all of the dependencies of arduino-cli and the IDE. I've tested those, and I can program my Lilypad through the IDE perfectly well.

A naive approach to get arduino-cli building fails because the dependencies aren't available for download:

./arduino-cli upgrade
Downloading missing tool builtin:[email protected]...
Downloading missing tool builtin:[email protected]...
Downloading missing tool builtin:[email protected]...
Downloading missing tool builtin:[email protected]...
Error initializing instance: downloading builtin:[email protected] tool: Error downloading tool builtin:[email protected]: no versions available for the current OS
Error initializing instance: downloading builtin:[email protected] tool: Error downloading tool builtin:[email protected]: no versions available for the current OS
Error initializing instance: downloading builtin:[email protected] tool: Error downloading tool builtin:[email protected]: no versions available for the current OS
Error initializing instance: downloading builtin:[email protected] tool: Error downloading tool builtin:[email protected]: no versions available for the current OS
Error initializing instance: Error loading hardware platform: reading directory packages/builtin/tools: open packages/builtin/tools: no such file or directory
Error initializing instance: Error loading hardware platform: discovery builtin:serial-discovery not installed
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not installed
[duncan@duncan-x250 ~/code/arduino-cli]$ 

So it looks like maybe the answer is for me to create a port of arduino-cli that in turn depends upon the existing ports? Possibly after adding FreeBSD support to this library to make the resultant patch smaller.

(Note that this may also address #1815).

@umbynos
Copy link
Contributor

umbynos commented Sep 5, 2022

Hello @duncan-bayne! Thanks for your interest in this project!
Unfortunately, as you may already know by now, your operative system is not supported at the moment.
The Arduino CLI is not the only piece of software that needs fixing in order to add the support.
As you can see from the output:

Needs a proper release for FreeBSD.
Unfortunately, I don't think we have the bandwidth at the moment...
But of course we are open to contributors.

@umbynos umbynos changed the title task build failing with i18n/detect.go:24:9: undefined: getLocaleIdentifier error building on FreeBSD Sep 5, 2022
@per1234 per1234 assigned per1234 and unassigned umbynos Mar 28, 2023
@per1234
Copy link
Contributor

per1234 commented Mar 28, 2023

Closing as fixed by #2116

The other issue of official builds of the tool dependencies not being available for this host type remains, but that should be tracked in the repositories of those projects instead of here.

There is a related request for official builds of Arduino CLI for FreeBSD here: #1815

@per1234 per1234 closed this as completed Mar 28, 2023
@per1234 per1234 added os: linux Specific to Linux operating system conclusion: resolved Issue was resolved labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants