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

Fix GNU readline detection on OpenBSD, and make the configure test for it more robust #3428

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

dimpase
Copy link
Member

@dimpase dimpase commented Apr 29, 2019

Description

this fixes #3426.

Text for release notes

Better handling of incompatible with GAP readline libraries.
Enable building of GAP on OpenBSD (with ereadline fixed as in
https://marc.info/?l=openbsd-ports&m=155646111509306&w=2)

Further details

Do not forget to run ./autogen + ./configure before testing this.

@dimpase dimpase requested a review from fingolfin April 29, 2019 08:47
configure.ac Outdated Show resolved Hide resolved
configure.ac Show resolved Hide resolved
configure.ac Outdated Show resolved Hide resolved
configure.ac Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 30, 2019

Codecov Report

Merging #3428 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3428      +/-   ##
==========================================
+ Coverage   85.17%   85.19%   +0.01%     
==========================================
  Files         699      697       -2     
  Lines      346081   343975    -2106     
==========================================
- Hits       294784   293037    -1747     
+ Misses      51297    50938     -359
Impacted Files Coverage Δ
src/modules.h 33.33% <0%> (-66.67%) ⬇️
src/cyclotom.h 50% <0%> (-50%) ⬇️
src/records.h 50% <0%> (-50%) ⬇️
src/gapstate.h 42.85% <0%> (-42.86%) ⬇️
src/vec8bit.h 51.78% <0%> (-42.86%) ⬇️
src/macfloat.h 57.14% <0%> (-42.86%) ⬇️
src/code.h 57.14% <0%> (-40.16%) ⬇️
src/gvars.h 66.66% <0%> (-33.34%) ⬇️
src/hookintrprtr.h 66.66% <0%> (-33.34%) ⬇️
src/fibhash.h 66.66% <0%> (-33.34%) ⬇️
... and 104 more

@coveralls
Copy link

coveralls commented Apr 30, 2019

Coverage Status

Coverage remained the same at 84.675% when pulling 9b1c61f on dimpase:master into 10a05b2 on gap-system:master.

@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels May 3, 2019
@fingolfin fingolfin changed the title better readline treatment on OpenBSD and OSX better readline treatment on OpenBSD May 3, 2019
@fingolfin fingolfin changed the title better readline treatment on OpenBSD Link against correct readline implementation on OpenBSD May 3, 2019
@fingolfin
Copy link
Member

I adjusted the title of this PR to be more suitable for release notes; please re-edit if you disagree; you may also want to change the commit message of your first commit, as it still reference OSX; and squash the second commit into the first.

@DominikBernhardt
Copy link
Contributor

@dimpase Ping.

@dimpase
Copy link
Member Author

dimpase commented Nov 20, 2019

yep, I should get back to this.

@dimpase
Copy link
Member Author

dimpase commented Nov 25, 2019

Ready for review

@fingolfin
Copy link
Member

@dimpase thanks for the update, I'll take a look. But the commit message still is odd; it says "also, do not wrongly accuse OSX of wrongdoing" but the only other reference to OSX is in the first line of the commit message? So maybe just remove both mentions -- or does OSX have any relevance for this PR after all?

@dimpase
Copy link
Member Author

dimpase commented Nov 26, 2019

commit message still is odd

It probably referred to some already removed comment in configure.ac. I'll edit the commit message, no problem. Needless to say, this change works on OSX if --with-readline=/foo/bar is provided, and readline installed in /foo/bar.

It also should be mentioned that this fixes a bug: testing for rl_ding did not identify the needed readline version, so now the test for a newer rl_... finction.

@dimpase
Copy link
Member Author

dimpase commented Nov 26, 2019

imroved commit message, no other changes

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks pretty good, but autoconf's horrible syntax with too many braces, brackets, parens and no keywords makes it rather hard to see what is nested where, so I want to check the code out locally now. In the meantime, a few comments/questions. And thanks for working on this!

configure.ac Outdated Show resolved Hide resolved
configure.ac Show resolved Hide resolved
configure.ac Outdated Show resolved Hide resolved
configure.ac Outdated Show resolved Hide resolved
@fingolfin fingolfin changed the title Link against correct readline implementation on OpenBSD Fix GNU readline support on OpenBSD, and make the configure test for it more robust Nov 26, 2019
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now up to some very minor nitpicks, thanks!

@dimpase
Copy link
Member Author

dimpase commented Nov 27, 2019

@kaashif - perhaps this is now ready for making an OpenBSD GAP package.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that LGTM. Would you mind squashing the second commit?

rl_ding test does not correctly identify the needed readline version,
so this is changed to rl_bind_keyseq.

OpenBSD installs modern readline as libereadline in
/usr/local, and its headers in /usr/local/include/ereadline/
Thus we provide custom -I in CFLAGS and
custom -L in LDFLAGS even if we use --with-readline=yes
without an explicit path in case of libereadline
detected.

Address PR 3428 reviewer comments
@dimpase
Copy link
Member Author

dimpase commented Nov 27, 2019

squashed. Thanks for taking care of this.

@fingolfin fingolfin merged commit 9378325 into gap-system:master Nov 27, 2019
@fingolfin
Copy link
Member

@ChrisJefferson @alex-konovalov I'd like to backport to this to stable-4.11, OK?

@ChrisJefferson
Copy link
Contributor

That's fine with me

@kaashif
Copy link

kaashif commented Nov 27, 2019

@dimpase Maybe. I'll make another pass on the weekend at making a package and submitting it.

@fingolfin
Copy link
Member

For packaging, I recommend talking with/to us -- we can often provide hints how to overcome certain problems. Even if you get stuck and decide to abandon the effort, we are grateful for any constructive feedback, to help improve things (In the end, lack of time/resources/contributors sadly is always a limiting factor)

@dimpase
Copy link
Member Author

dimpase commented Nov 27, 2019

@kaashif so to build on OpenBSD, one needs to pkg_add gmp and ereadline and run

./autogen.sh
CC=clang CXX=clang++ ./configure --with-readline=/usr/local --with-gmp=/usr/local
gmake

installation should be tested with LC_CTYPE=en_US.UTF-8 - otherwise there are weird UTF-8 problems - see #2194

@fingolfin
Copy link
Member

Backported to stable-4.11 as f67d98a

@fingolfin fingolfin changed the title Fix GNU readline support on OpenBSD, and make the configure test for it more robust Fix GNU readline detection on OpenBSD, and make the configure test for it more robust Nov 28, 2019
@fingolfin fingolfin added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Dec 5, 2019
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.11.0 milestone Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-4.11-DONE kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: added PRs introducing changes that have since been mentioned in the release notes topic: build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openbsd support: readline treatment
7 participants