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

Readline macos #1156

Merged
merged 2 commits into from
Oct 29, 2022
Merged

Readline macos #1156

merged 2 commits into from
Oct 29, 2022

Conversation

mcuee
Copy link
Collaborator

@mcuee mcuee commented Oct 24, 2022

This pull request adds the support for readline for the github action macOS Homebrew build. It will use readline keg instead of the system provided libedit.

It also updated build.sh to use readline keg (no need to use brew link readline --force.

It should not affect MacPorts users.

Sign-off by xiaofanc@gmail.com

For macOS Homebrew, readline is a keg. This change makes avrdude uses readline keg.
Update github action to use readline keg and not the default libedit under Homebrew
@mcuee mcuee added the enhancement New feature or request label Oct 24, 2022
@mcuee
Copy link
Collaborator Author

mcuee commented Oct 24, 2022

@MCUdude
Please take a look to see if the change to build.sh works for you or not, when you get a chance. Thanks. The current git main build.sh will require brew link readline --force. This PR will remove that requirement.

By the way, I will be interested to know if you encounter issues with git main, if you do not use build.sh and do not add the extra CMake option to use readline keg. In my case, it will then use system provided libedit for my Mac Mini M1 machine and the result is not good. I needed to hit return everywhere, history does not work and CTRL-D does not work either.

@dl8dtl
Please also give MacPorts a shot to see if anything bad happen or not. By right it should not cause issues. You do need to install readline but MacPorts will not have the issues with Homebrew.

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 24, 2022

BTW, if this gets merged after testing, Wiki page (https://github.com/avrdudes/avrdude/wiki/Building-AVRDUDE-for-macOS) needs to be updated.

Right now I do not have the rigths to update Wiki page.

@danapplegate
Copy link
Contributor

MacOS Big Sur 11.6.8
Homebrew 3.6.7
Homebrew/homebrew-core (git revision c2004ef08ce; last commit 2022-10-25)
Homebrew/homebrew-cask (git revision d57498b586; last commit 2022-10-25)

I can confirm that main's build.sh indeed appears to fail on MacOS using Homebrew, as it's looking for readline in the wrong place:

applegatedt@Daniels-MBP-2 avrdude % ./build.sh
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DO HAVE    libftdi
-- DON'T HAVE libftdi1
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/applegatedt/workspace/avrdude/build_darwin
[  1%] Built target conf
Consolidate compiler generated dependencies of target libavrdude
[ 90%] Built target libavrdude
Consolidate compiler generated dependencies of target avrdude
make[2]: *** No rule to make target `/usr/local/lib/libreadline.dylib', needed by `src/avrdude'.  Stop.
make[1]: *** [src/CMakeFiles/avrdude.dir/all] Error 2
make: *** [all] Error 2
Build failed.

But checking out @mcuee 's branch and running build.sh succeeds:

applegatedt@Daniels-MBP-2 avrdude % ./build.sh
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DO HAVE    libftdi
-- DON'T HAVE libftdi1
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/applegatedt/workspace/avrdude/build_darwin
[  1%] Generating avrdude.conf
[  1%] Built target conf
[  3%] [FLEX][Parser] Building scanner with flex 2.6.4
[  4%] [BISON][Parser] Building parser with bison 2.3
Consolidate compiler generated dependencies of target libavrdude
[  6%] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.o
[  7%] Building C object src/CMakeFiles/libavrdude.dir/avr.c.o
[  9%] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.o
[ 10%] Building C object src/CMakeFiles/libavrdude.dir/avrcache.c.o
[ 12%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.o
[ 13%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi_tpi.c.o
[ 15%] Building C object src/CMakeFiles/libavrdude.dir/avrpart.c.o
[ 16%] Building C object src/CMakeFiles/libavrdude.dir/bitbang.c.o
[ 18%] Building C object src/CMakeFiles/libavrdude.dir/buspirate.c.o
[ 20%] Building C object src/CMakeFiles/libavrdude.dir/butterfly.c.o
[ 21%] Building C object src/CMakeFiles/libavrdude.dir/config.c.o
[ 23%] Building C object src/CMakeFiles/libavrdude.dir/confwin.c.o
[ 24%] Building C object src/CMakeFiles/libavrdude.dir/dfu.c.o
[ 26%] Building C object src/CMakeFiles/libavrdude.dir/fileio.c.o
[ 27%] Building C object src/CMakeFiles/libavrdude.dir/flip1.c.o
[ 29%] Building C object src/CMakeFiles/libavrdude.dir/flip2.c.o
[ 30%] Building C object src/CMakeFiles/libavrdude.dir/ft245r.c.o
[ 32%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkI.c.o
[ 33%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkII.c.o
[ 35%] Building C object src/CMakeFiles/libavrdude.dir/jtag3.c.o
[ 36%] Building C object src/CMakeFiles/libavrdude.dir/linuxgpio.c.o
[ 38%] Building C object src/CMakeFiles/libavrdude.dir/linuxspi.c.o
[ 40%] Building C object src/CMakeFiles/libavrdude.dir/lists.c.o
[ 41%] Building C object src/CMakeFiles/libavrdude.dir/micronucleus.c.o
[ 43%] Building C object src/CMakeFiles/libavrdude.dir/par.c.o
[ 44%] Building C object src/CMakeFiles/libavrdude.dir/pgm.c.o
[ 46%] Building C object src/CMakeFiles/libavrdude.dir/pgm_type.c.o
[ 47%] Building C object src/CMakeFiles/libavrdude.dir/pickit2.c.o
[ 49%] Building C object src/CMakeFiles/libavrdude.dir/pindefs.c.o
[ 50%] Building C object src/CMakeFiles/libavrdude.dir/ppi.c.o
[ 52%] Building C object src/CMakeFiles/libavrdude.dir/ppiwin.c.o
[ 53%] Building C object src/CMakeFiles/libavrdude.dir/serbb_posix.c.o
[ 55%] Building C object src/CMakeFiles/libavrdude.dir/serbb_win32.c.o
[ 56%] Building C object src/CMakeFiles/libavrdude.dir/ser_avrdoper.c.o
[ 58%] Building C object src/CMakeFiles/libavrdude.dir/ser_posix.c.o
[ 60%] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.o
[ 61%] Building C object src/CMakeFiles/libavrdude.dir/serialupdi.c.o
[ 63%] Building C object src/CMakeFiles/libavrdude.dir/stk500.c.o
[ 64%] Building C object src/CMakeFiles/libavrdude.dir/stk500v2.c.o
[ 66%] Building C object src/CMakeFiles/libavrdude.dir/stk500generic.c.o
[ 67%] Building C object src/CMakeFiles/libavrdude.dir/teensy.c.o
[ 69%] Building C object src/CMakeFiles/libavrdude.dir/updi_link.c.o
[ 70%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm.c.o
[ 72%] Building C object src/CMakeFiles/libavrdude.dir/updi_readwrite.c.o
[ 73%] Building C object src/CMakeFiles/libavrdude.dir/updi_state.c.o
[ 75%] Building C object src/CMakeFiles/libavrdude.dir/usbasp.c.o
[ 76%] Building C object src/CMakeFiles/libavrdude.dir/usb_hidapi.c.o
[ 78%] Building C object src/CMakeFiles/libavrdude.dir/usb_libusb.c.o
[ 80%] Building C object src/CMakeFiles/libavrdude.dir/usbtiny.c.o
[ 81%] Building C object src/CMakeFiles/libavrdude.dir/update.c.o
[ 83%] Building C object src/CMakeFiles/libavrdude.dir/wiring.c.o
[ 84%] Building C object src/CMakeFiles/libavrdude.dir/xbee.c.o
[ 86%] Building C object src/CMakeFiles/libavrdude.dir/__/lexer.c.o
[ 87%] Building C object src/CMakeFiles/libavrdude.dir/__/config_gram.c.o
[ 89%] Linking C static library libavrdude.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(confwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppi.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppiwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(serbb_win32.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ser_win32.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(confwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppi.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppiwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(serbb_win32.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ser_win32.c.o) has no symbols
[ 90%] Built target libavrdude
Consolidate compiler generated dependencies of target avrdude
[ 92%] Building C object src/CMakeFiles/avrdude.dir/main.c.o
[ 93%] Building C object src/CMakeFiles/avrdude.dir/term.c.o
[ 95%] Building C object src/CMakeFiles/avrdude.dir/avrintel.c.o
[ 96%] Building C object src/CMakeFiles/avrdude.dir/developer_opts.c.o
[ 98%] Linking C executable avrdude
[100%] Built target avrdude

Build succeeded.

Run

sudo cmake --build build_darwin --target install

to install.

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 26, 2022

@danapplegate
Thanks a lot for the testing. Glad that it works.

@stefanrueger stefanrueger merged commit a3c04d2 into avrdudes:main Oct 29, 2022
@mcuee mcuee deleted the readline_macos branch October 30, 2022 10:59
@mcuee mcuee mentioned this pull request Nov 21, 2022
stefanrueger added a commit that referenced this pull request Nov 22, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants