Skip to content
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

Doesn't work on non-FHS systems #87

Open
balsoft opened this issue Dec 14, 2019 · 6 comments
Open

Doesn't work on non-FHS systems #87

balsoft opened this issue Dec 14, 2019 · 6 comments

Comments

@balsoft
Copy link

balsoft commented Dec 14, 2019

Bug Report

Current behavior

$ arduino-cli compile --fqbn arduino:avr:nano AnalogSensors/AnalogSensors.ino 
Error during build: build failed: fork/exec /home/balsoft/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++: no such file or directory

The build fails because the toolchain (downloaded to ~/.arduino15/packages) has /lib/ld-linux-x86-64.so.2 set as interpreter. While it might work on FHS systems, it doesn't work on mine. I can solve this by patching the executables (for i in $(find /home/balsoft/.arduino15 -t file); do patchelf --set-interpreter /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/ld-linux-x86-64.so.2 $i; done) but it is a flimsy solution and won't work long-term (it'll break after the next glibc update and garbage collection).

Expected behavior

It works out of the box, independent of the location of ld-linux-x86-64.so.2. This can be achieved by building the toolchain statically.

Environment

Additional context

I'm not sure this should be reported here. If it isn't, please close the issue and redirect me to the correct place.

@facchinm
Copy link
Member

Mmmh the toolchain is being built as statically as possible (for glibc), we could try compiling against musl in the future to solve this but it's not very high priority 🙂

@balsoft
Copy link
Author

balsoft commented Dec 16, 2019

To fix my problem, we need to link the toolchain with --no-dynamic-linker which should work on all platforms that support binfmt (so all of them).

@ericonr
Copy link

ericonr commented Jun 6, 2020

Hi there! Do you think it would be possible instead to build musl variants and have arduino-cli auto detect the platform? Void Linux ships arduino-cli in its musl variant, but has to resort to gcompat in order to run the AVR compiler, and quite a few more hacks to run the SAM one. I recently dealt with this here void-linux/void-packages#22616 (comment)

Where can I find the build configuration, if I were to try and help with it?

@balsoft
Copy link
Author

balsoft commented Jun 6, 2020

@ericonr https://github.com/balsoft/nur-packages/blob/master/pkgs/arduino-cli/default.nix is the package description. deps.nix is generated from go.sum or go.mod, don't remember which one.

@per1234 per1234 reopened this Mar 30, 2021
@per1234
Copy link

per1234 commented Mar 31, 2022

Someone with write permission in the arduino/toolchain-avr repo (@facchinm, @cmaglie, ...), please transfer the issue over there. The issue doesn't seem to be anything that can be resolved by changing the Arduino CLI code base.

@cmaglie cmaglie transferred this issue from arduino/arduino-cli Apr 7, 2022
@SpenceKonde
Copy link
Contributor

I saw this in my email, a growing sense of terror and dread,. as I saw owrds I firast assumed weretypos having never seen them before were repeated by multiple peop[le.

It was such a relief to find that it's not my problem yet. Whatever this problem is, may the technology gods have mercy on their soul.

@arduino arduino deleted a comment from SpenceKonde Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants