Linux and macOS releases are missing -- static linking version preferred #1433
Replies: 57 comments 4 replies
-
The current github action build of avrdude may not be suitable as a Linux release, lower/older version of Linux [eg: Ubuntu 18.04 or Debian 8) may be better. And different Linux distro may have different dependancies. So I am not sure how practical this is. For example, we only provide Windows binary for libusb projects. |
Beta Was this translation helpful? Give feedback.
-
I just managed to build avrdude on a virtual machine running Debian Jessie. It did require a recent version of cmake (3.21.4) that I had to install from source as well.
For distribution, I checked the dependencies using
For maximum compatibility with different Linux distros, I am tempted to link these libraries statically:
Would you suggest any other libraries for static linking? For example, libudev or libreadline? |
Beta Was this translation helpful? Give feedback.
-
OTOH, if you have an old reference system already available, could you just give the nightly builds a try? If they work even on your relatively old system, I'd just pick those. I don't think the APIs of the libraries you mentioned have been changed much lately. The bigger issue is probably that the "modern" build might require a certain LIBC_foo version symbol, for whatever reason. |
Beta Was this translation helpful? Give feedback.
-
@ygramoel
|
Beta Was this translation helpful? Give feedback.
-
Linking the four libraries mentioned above statically works for me. The others, including libudev, are linked dynamically:
This is the link command I used:
I had to It is most probably not a good idea to link libdl or libc statically. I am less certain about the others. |
Beta Was this translation helpful? Give feedback.
-
I just tried it on an elderly Ubuntu 16.04LTS:
As you can see, it's not the libusb or libftdi stuff that is causing any trouble. It's that "minimum version" symbol in libc, and libreadline. |
Beta Was this translation helpful? Give feedback.
-
I just tried the nightly build on this old Debian Virtual Machine - johan@debian:~/avrdude_nightly$ ./avrdude
./avrdude: error while loading shared libraries: libftdi1.so.2: cannot open shared object file: No such file or directory johan@debian:~/avrdude_nightly$ ldd avrdude
./avrdude: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./avrdude)
linux-vdso.so.1 (0x00007ffdfcef8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbe8139f000)
libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007fbe81189000)
libusb-0.1.so.4 => /lib/x86_64-linux-gnu/libusb-0.1.so.4 (0x00007fbe80f80000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007fbe80d68000)
libhidapi-libusb.so.0 => /usr/lib/x86_64-linux-gnu/libhidapi-libusb.so.0 (0x00007fbe80b61000)
libftdi1.so.2 => not found
libreadline.so.8 => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbe807b6000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbe816a0000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007fbe805a7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbe8038a000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fbe80182000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbe7ff7e000) |
Beta Was this translation helpful? Give feedback.
-
OK, so your system's libftdi1 is even older than Ubuntu 16, it seems. ;-) The biggest issue is libc. Everything else, you can just ship the .so that has been used to build along with the binary, and set |
Beta Was this translation helpful? Give feedback.
-
Try adding librreadline to your above list of static libraries, and see whether the result will run on a current Linux distribution. |
Beta Was this translation helpful? Give feedback.
-
Linking readline statically works; I had to add -ltinfo to the link command.
It runs on my Linux Mint 19 Tara, but not on a more recent Ubuntu 21.10. The problem is libtinfo:
|
Beta Was this translation helpful? Give feedback.
-
The original version, with both libreadline and libtinfo linked dynamically, doesn't work on a recent Ubuntu either. However, linking both libreadline and libtinfo statically works. |
Beta Was this translation helpful? Give feedback.
-
I'm Johan's (@ygramoel) colleague. Here is the binary he just made: https://new.embeetle.com/downloads/beetle_tools/linux/avrdude_7.0.0_feaa1c6_64b.7z It's a 7z compressed folder containing two files:
Can you please give it a try on your Linux machine(s)? |
Beta Was this translation helpful? Give feedback.
-
Works here, customized Ubuntu 20.04. |
Beta Was this translation helpful? Give feedback.
-
@kristofmulier Just to add some history and reasoning to this discussion, even if it may be redundant: The current CMake setup and Github Actions do not support building Linux binaries that are suitable for download, which is why they do not show up in the release artifacts. You can tell from the discussion that your requirement is not just a matter of including the build artifacts in the release, but actually quite a bit of work to get it right. Technically speaking, the whole build pipeline consists of three things: a) the CMake build system b) the GitHub build actions c) the GitHub release actions Regarding a) The current CMake setup is designed to support the two most common scenarios: 1) Building Un*x binaries on a defined target system using dynamic linking, suitable for package managers etc., and 2) Building Windows binaries suitable for download using static linking, supporting Windows 7 and up. See also: #960 (comment) Regarding b) The GitHub build action for Linux is merely a build check, with the intention that the build works on a current Linux system and toolset, throwing no errors and warnings, etc, for the scenario outlined in a). With that reasoning in mind, I picked the latest Debian distro (i.e. the VM 'ubuntu-latest') with the latest GCC toolset and the latest libraries. Regarding c) As the Linux binaries are not meant for downloading, only the Windows release artifacts (the MSVC builds with the custom libraries) are included in the release. Now, we have a few new requirements here, such as the Arduino team wishing for statically linked binaries that they can ship with the Arduino IDE (#946 (reply in thread)), which is probably what you expect from a Linux binary offered on the release page, or others finding value in building dynamically linked binaries for Windows (#954). All these requests are related, because they all require changes in a), b), and c). You are welcome to submit a PR that addresses your needs, however, I would like to point out that the requirements for building Linux binaries suitable for download conflict with the requirements that I outlined above (because you want static linking, support for older distros, etc.). So when you submit a PR, please keep the existing build and CI actions intact, and add a extra jobs that builds the required outputs. |
Beta Was this translation helpful? Give feedback.
-
Works on Ubuntu 16.04 as well. |
Beta Was this translation helpful? Give feedback.
-
On the other hand, I think it is good to test static link version for Linux and macOS in the github action. Right now MinGW and MSVC use static linking (we should keep that) and Linux and macOS use dynamic linking (we should keep that as well but add static linking testing as well). |
Beta Was this translation helpful? Give feedback.
-
For those who want to build their own Linux static linking binary, Arduino cross-build container and the Arduino-packing project build script are a good one to use. I have no issues to build 32bit Linux and macOS binary with avrdude git main using the container. You can see you do not need to use very complicated script. And only one patch is needed for Linux and macOS. I have some issues under mingw32 but hopefully @umbynos can help out (he is able to build under mingw32). @kristofmulier @MCUdude and @SpenceKonde, |
Beta Was this translation helpful? Give feedback.
-
I will close this issue as #1162 will fix this issue and it is more generic (Linux, Windows and macOS static link binaries). |
Beta Was this translation helpful? Give feedback.
-
Similar discussion here. |
Beta Was this translation helpful? Give feedback.
-
As of now, avrdude project will only release Windows binary for avrdude and not Linux/macOS binary. If you need Linux (or macOS) static link avrdude binary for production purpose, it is good to use the release For testing purpose, you can try my snapshot release here. |
Beta Was this translation helpful? Give feedback.
-
Re-open the issue but I make it more generic. |
Beta Was this translation helpful? Give feedback.
-
Potential solutions but need more work on CMake.
Related discussions: |
Beta Was this translation helpful? Give feedback.
-
Even though #1162 can be a potential solution, right now at least two patches used by @umbynos are not really acceptable for the avrdude project. Patch 06 may need some work. Patch 07 is just a hack. https://github.com/arduino/avrdude-packing/tree/main/patches (Patch 08 is just Arduino branding) |
Beta Was this translation helpful? Give feedback.
-
After some thoughts, I have closed #1162. I think we should get #1159 done first and then this one. This is not a high priority either since there is the Arduino avrdude-packing project out there which provides the infrastructrure to build the static link version for Linux/macOS and Windows. Majority of the Linux users will still get avrdude through the Linux distro or build from source (typically with dynamic linking to dependacies). Majority of the macOS users will get avrdude through Homebrew or macPorts. |
Beta Was this translation helpful? Give feedback.
-
You can use this one from Arduino avrdude-packing project. |
Beta Was this translation helpful? Give feedback.
-
I will close this as not planned as the project has no intention to publish official Linux and macOS binaries. |
Beta Was this translation helpful? Give feedback.
-
Converted this to conversation so that people can still discuss this issue. |
Beta Was this translation helpful? Give feedback.
-
Arduino avrdude-packing project has released their version of Arduino 7.2, which should be suitable for the usage here. |
Beta Was this translation helpful? Give feedback.
-
For those who want to try git main, I have some snapshot release build here. Latest version is here: |
Beta Was this translation helpful? Give feedback.
-
PR #1540 has been merged. I think this can be closed. |
Beta Was this translation helpful? Give feedback.
-
I've very happy to find the latest releases here:
https://github.com/avrdudes/avrdude/releases
Thanks a lot @mariusgreuel and @dl8dtl for your awesome work! Unfortunately, I can't see any Linux releases. The Linux releases are available in the nightly builds though:
https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE
It would be great if they would also be available on the release page. I know that usually the Linux distros package their own binaries to fit into their package systems (RPM, dpkg, ...). But some people prefer to get the builds directly from GitHub. It would also be helpful for our usecase: we'd like to download
AVRDUDE
directly to the computer of our users (the users of Embeetle IDE, a new microcontroller IDE) without going through a package manager.Thanks a lot ^_^
Beta Was this translation helpful? Give feedback.
All reactions