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

To add arduino avrdude-packing github action to create binary for Linux, macOS and Windows #1162

Closed
mcuee opened this issue Oct 30, 2022 · 15 comments
Labels
enhancement New feature or request

Comments

@mcuee
Copy link
Collaborator

mcuee commented Oct 30, 2022

I think @umbynos has done a good job in avrdude-packing project to be able to build static linking version for Linux, macOS and Windows (mingw32). It may be a good idea to adopt it as an addition to the current github actions.

@mcuee mcuee added the enhancement New feature or request label Oct 30, 2022
@mcuee
Copy link
Collaborator Author

mcuee commented Oct 30, 2022

I have done a simplified version here (not yet for Windows) and only one patch is needed.
https://github.com/mcuee/avrdude-packing

It is running okay against current avrdude git main.
https://github.com/mcuee/avrdude-packing/actions/runs/3353462193

For MSYS2 MinGW, there is one more patch needed. But I have not figured out how to get Windows MinGW build working.
https://github.com/mcuee/avrdude-packing/actions/runs/3354148352/jobs/5557501650

[ 96%] Linking C executable avrdude
cd /__w/avrdude-packing/avrdude-packing/avrdude/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/avrdude.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc -I/opt/lib/i686-w64-mingw32/include/libusb-1.0/ -I/opt/lib/i686-w64-mingw32/include -pthread  -static-libgcc -static-libstdc++ CMakeFiles/avrdude.dir/main.c.o CMakeFiles/avrdude.dir/term.c.o CMakeFiles/avrdude.dir/avrintel.c.o CMakeFiles/avrdude.dir/developer_opts.c.o CMakeFiles/avrdude.dir/whereami.c.o  -o avrdude  libavrdude.a -lm /opt/lib/i686-w64-mingw32/lib/libelf.a /opt/lib/i686-w64-mingw32/lib/libusb.a /opt/lib/i686-w64-mingw32/lib/libusb-1.0.a /opt/lib/i686-w64-mingw32/lib/libhidapi.a /opt/lib/i686-w64-mingw32/lib/libftdi1.a /opt/lib/i686-w64-mingw32/lib/libreadline.a /opt/lib/i686-w64-mingw32/lib/libncurses.a /opt/lib/i686-w64-mingw32/lib/libtinfo.a -lsetupapi -lws2_32 
/usr/bin/i686-w64-mingw32-ld: /opt/lib/i686-w64-mingw32/lib/libtinfo.a(lib_ttyflags.o):lib_ttyflags.c:(.text+0x6b): undefined reference to `_nc_mingw_ioctl'
/usr/bin/i686-w64-mingw32-ld: /opt/lib/i686-w64-mingw32/lib/libtinfo.a(lib_ttyflags.o):lib_ttyflags.c:(.text+0xeb): undefined reference to `_nc_mingw_ioctl'
collect2: error: ld returned 1 exit status

The error is rather strange and point out potential issue with the way ncurses package is built in the container.
Ref: https://stackoverflow.com/questions/8956455/undefined-reference-building-ncurses-on-cygwin

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 30, 2022

For Linux and macOS, only one patch is needed. The only question is whether it is acceptable for avrdude project or not.
https://github.com/arduino/avrdude-packing/blob/main/patches/0006-Cmake-add-libtinfo-and-libncurses-as-dependencies.patch

I think as it is it can not be accepted because it will not work with MSVC build.

@mariusgreuel or other CMake experts may be able to figure out a way to modify it to be suitable to be adopted.

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 30, 2022

For MinGW, there is one more patch required, which is also not acceptable as it is. But again @mariusgreuel or other CMake experts may be able to figure out a way to modify it to be suitable to be adopted.
https://github.com/mcuee/avrdude-packing/blob/main/patches/0007-Cmake-fix-build-not-working-with-mingw-toolchain.patch

It seems to me the issuse is that the current CMake file do not work well with MinGW cross build (WIN32 not defined?)
https://github.com/avrdudes/avrdude/blob/main/src/CMakeLists.txt

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 30, 2022

The error is rather strange and point out potential issue with the way ncurses package is built in the container. Ref: https://stackoverflow.com/questions/8956455/undefined-reference-building-ncurses-on-cygwin

Indeed @umbynos has figured out the issue and find the solution to bump up ncurses version.

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 30, 2022

Take note the Arduino Cross-build container is here and uses GNU Affero General Public License v3.0. So it should be acceptable to use.
https://github.com/arduino/crossbuild

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 30, 2022

Snapshot release here, up to latest git commit b569966.
https://github.com/mcuee/avrdude-packing/releases/tag/snapshot_30Oct2022

Two patches are applied on top of avrdude git main.
https://github.com/mcuee/avrdude-packing/tree/main/patches

@mcuee
Copy link
Collaborator Author

mcuee commented Nov 2, 2022

Snapshot release here, up to latest git commit 4c92030.
https://github.com/mcuee/avrdude-packing/releases/tag/snapshot_2Nov2022

Two patches are applied on top of avrdude git main.
https://github.com/mcuee/avrdude-packing/tree/main/patches

@mcuee mcuee changed the title To add arduino-packing github action To add arduino-packing github action to create binary for Linux, macOS and Windows Nov 3, 2022
This was referenced Nov 21, 2022
@mcuee
Copy link
Collaborator Author

mcuee commented Nov 22, 2022

New snapshot here on 22-Nov-2022
https://github.com/mcuee/avrdude-packing/releases/tag/snapshot_22Nov2022

@mcuee
Copy link
Collaborator Author

mcuee commented Nov 26, 2022

@umbynos has released a new snapshot of the arduino-packing project.

You can download the binary here.
https://github.com/arduino/avrdude-packing/releases/tag/7.0-arduino.4-rc1

Built with crossbuild v0.2.2:

remove libusb-win32 dep in favor of libusb-compat
bump libncurses from 5.9 to 6.3
The base commit is 4c92030

@mcuee
Copy link
Collaborator Author

mcuee commented Nov 27, 2022

New snapshot release for latest git main:
https://github.com/mcuee/avrdude-packing/releases/tag/snapshot_28Nov2022

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 14, 2022

New snapshot release for latest git main.
https://github.com/mcuee/avrdude-packing/releases/tag/snapshot_14Dec2022

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 23, 2022

New snapshot release for latest git main:
https://github.com/mcuee/avrdude-packing/releases/tag/snapshot_22Dec2022

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2023

My avrdude 7.1 release with unofficial binaries here.
https://github.com/mcuee/avrdude/releases/tag/v7.1

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2023

@dioannidis

Please take note the official v7.1 Windows binary will still have Issue #968.

You can point the user to my alternative 7.1 mingw64 binary.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 9, 2023

I will close this one as it is a bit out of scope for avrdude project. It is probably left to the Arduino avrdude-packing project.

@mcuee mcuee closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
@mcuee mcuee changed the title To add arduino-packing github action to create binary for Linux, macOS and Windows To add arduino avrdude-packing github action to create binary for Linux, macOS and Windows Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant