-
Notifications
You must be signed in to change notification settings - Fork 722
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
[BUG] Tests failing on OpenBSD #5173
Comments
I'm working on reproducing; did you not see this build error?
|
I needed this change to make it compile indeed
|
On Sat, May 11, 2024 at 05:28:52AM -0700, Solène Rapenne wrote:
-CPPFLAGS-os-OpenBSD = -DKAK_BIN_PATH="$(bindir)/kak" -I/usr/local/include
+CPPFLAGS-os-OpenBSD = -DKAK_BIN_PATH='"$(bindir)/kak"' -I/usr/local/include
LDFLAGS-os-OpenBSD = -L/usr/local/lib
mandir-os-OpenBSD = $(DESTDIR)$(PREFIX)/man/man1
```
Yeah the problem is that `%val{runtime}` is derived from `KAK_BIN_PATH`.
As a workaround either install kak before running `make test`,
or use `KAKOUNE_RUNTIME=$PWD/share/kak make test`.
Not sure what's a proper fix; how can kak detect whether it's installed or not?
On a sourcehut system there are some more failures, related to multi-byte chars.
Not yet sure what's going on.
|
On Linux, Kakoune doesn't need to be installed; I think it looks at the path in |
On OpenBSD it is not possible to know the path of a running binary. (explanations) |
It turns out this is very wrong, it uses Linux Hacks to figure out the "real" binary path (where "real" is in quotes for all the reasons OpenBSD doesn't support this feature), and other platform-specific APIs on various other platforms. I think guessing based on |
I guess one option is to hardcode the path to Not sure what's wrong with the remaining test failures, AIUI OpenBSD doesn't support anything other than UTF-8 |
I don't think |
diff --git a/Makefile b/Makefile
index 362153ea6..f61eab84e 100644
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,7 @@ LDFLAGS-os-FreeBSD = -L/usr/local/lib
LIBS-os-Haiku = -lnetwork -lbe
-CPPFLAGS-os-OpenBSD = -DKAK_BIN_PATH="$(bindir)/kak" -I/usr/local/include
+CPPFLAGS-os-OpenBSD = -DKAK_BIN_PATH=\"$(bindir)/kak\" -I/usr/local/include
LDFLAGS-os-OpenBSD = -L/usr/local/lib
mandir-os-OpenBSD = $(DESTDIR)$(PREFIX)/man/man1
@@ -136,6 +136,9 @@ doc/kak.1.gz: doc/kak.1
check: test
test: src/kak
+ if [ $(os) = OpenBSD ]; then \
+ export KAKOUNE_RUNTIME=$$PWD/share/kak; \
+ fi && \
cd test && ./run
TAGS: tags
diff --git a/src/file.cc b/src/file.cc
index 056319b67..a293fd4c7 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -672,6 +672,7 @@ String get_kak_binary_path()
buffer[res] = '\0';
return buffer;
#elif defined(__OpenBSD__)
+ (void)buffer;
return KAK_BIN_PATH;
#elif defined(__sun__)
ssize_t res = readlink("/proc/self/path/a.out", buffer, 2048);
|
with that diff, kakoune tests all pass, including the git one I had to disable because they were hanging. |
Version of Kakoune
v2024.05.09
Reproducer
make test
Outcome
The text was updated successfully, but these errors were encountered: