-
-
Notifications
You must be signed in to change notification settings - Fork 145
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 on OpenBSD has a different API; oils-for-unix compiler error #1942
Comments
A workaround is to compile without readline and use
Needs hacks from #1943 to build/install. After that, invoke with
|
Hm do you know what version of GNU readline is on OpenBSD? I am not sure what versions we support, but we should document it It looks like the current version is 8.2 - https://tiswww.case.edu/php/chet/readline/rltop.html |
Looks like 8.2 on my system:
|
Hmm I'm surprised that a newer version is not working... I have readline 7.0 on my Ubuntu machine I wonder if this is reproducible on Linux with readline 8.2 |
Oh I wonder if you can do
That will show what your Maybe that test is broken on OpenBSD somehow? |
There still might be something wrong with feature detection, but I'm not sure what it is. OpenBSD puts the headers here:
Not on my Linux laptop. I have compiled Oils without any issues on my Void Linux machine, and it has readline 8.2 Perhaps OpenBSD patches readline. |
okay whoa I asked on libera
|
So I found some more info. The readline in base is quite old, and a lot of gnu stuff in OpenBSD base is old. However, readline 8.2 is available from the ports tree. https://github.com/openbsd/ports/blob/master/devel/readline/Makefile#L31 I installed it with
Anything not in base gets installed under /usr/local. As you can see from the ports tree's makefile for readline, they also rename the library to ereadline. So some build script updates will need to happen. Headers get installed here:
Example programs (?) here
And libraries here
And it's got the symbols output from nm
So it seems like you need to include/link against |
Here is the ports entry https://github.com/openbsd/ports/blob/9c275c5eec69b00ca423afc88f72f39a640dfb1d/devel/readline/pkg/DESCR#L12
On the other hand,
Update: currently manually hacking the readline paths in build/ninja-rules-cpp.sh to see if I can get oils to compile. That can help determine what changes the configure script needs, if any. Update 2: adding |
Oh thanks for trying it! Yes I'd be interested in the diff of what works I don't have an OpenBSD machine to test on Do you need |
Yes, according to the DESC file in the ports entry for readline:
I'm having some trouble getting it to link, though. Even though the compiled libraries are right next to the readline ones
|
Oh it has to be |
Not sure :( pkg-config .pc files
I might have to try a simplified C program to see precisely what's required to include these libraries. |
Yeah I agree the best solution here is to produce a self-contained C program on OpenBSD that links GNU readline and calls a few functions We have a similar problem on FreeBSD I would like this to work, but I don't have access to either OpenBSD or FreeBSD machines Description of how Oils works here: https://oilshell.zulipchat.com/#narrow/stream/121540-oil-discuss/topic/installing.20on.20FreeBSD So if there's a simple C program example, then it can probably ported over to our build system pretty easily |
Or I guess another solution is to use I'm unclear about this |
I'm not sure if pkg-config is standard, but some libraries drop .pc files and stuff. Regarding CI it seems like SourceHut has FreeBSD and OpenBSD images. I've been shopping around for a solution, myself, since I've become BSD-curious. I haven't had time to work this issue in particular, but I haven't forgotten. Feel free to poke me again if I don't get back to you in ... a few weeks? ❤️ |
I'm planning on getting a POC C program with readline on FreeBSD (from the Zulip thread Andy linked earlier), probably this weekend, in a Sourcehut build. I'll also give OpenBSD a try at the same time. And I'll update this issue with my results. POC program and compilation: https://oilshell.zulipchat.com/#narrow/stream/121540-oil-discuss/topic/installing.20on.20FreeBSD/near/437738525 POC program and compilation copied below: #include <stdio.h>
#include <stdlib.h>
#include "readline/readline.h"
int main() {
char *line;
line = readline("Enter your name: ");
printf("Hello, %s!\n", line);
free(line);
return 0;
} # FreeBSD compilation
$ cc -I/usr/local/include -L/usr/local/lib -l readline r.c -o r
$ ./r
Enter your name: a
Hello, a! |
System Details
Error
The compiler starts erroring due to some missing symbols related to readline.
TheOops that's Oils coderl_clear_history
function seems to be calledclear_history
in readline/readline.h.Ripgreppin' through /usr led me to this comment in OpenBSD's Bash NEWS file (a changelog)
So there seem to be a lot of differences related to signal handling, so they ought to be approached with care.
The text was updated successfully, but these errors were encountered: