Closed ChihHao-Su closed 2 months ago
There are two perspectives on your problem:
/usr/local
iconv
and gettext
.The first point could probably be adressed with a machine file, and this is generated in vcpkg anyways. Maybe you can already configure this in your bsd triplet files. (I'm not convinced that /usr/local
should generally be added.)
The second point is whether meson does enough to find iconv and intl. TBH I don't know if vcpkg should build them or find them in the system for BSD. However, I have a PR here which chose iconv and intl as end-to-end tests for dependency detection in meson, and the result wasn't encouraging: https://github.com/microsoft/vcpkg/pull/38658 You are encouraged to check what it does for BSD.
@dg0yt Sorry, I may not have made it clear. Here I just described one problem -- Meson won't find header files and library files under BSD locations (/usr/local
is what OpenBSD uses). This problem causes packages use meson to build, cannot find anything installed with system package manager (the example I gave is glib cannot find iconv). If I execute
export LIBRARY_PATH=/usr/local/lib
export CPATH=/usr/local/include
And then run vcpkg install glib
, everything work fine.
In this issue, what I'm doing is to make a discussion about should we solve the problem on the layer of vcpkg .
@dg0yt Sorry, I may not have made it clear. Here I just described one problem -- Meson won't find header files and library files under BSD locations (
/usr/local
is what OpenBSD uses). This problem causes packages use meson to build, cannot find anything installed with system package manager (the example I gave is glib cannot find iconv). If I executeexport LIBRARY_PATH=/usr/local/lib export CPATH=/usr/local/include
And then run
vcpkg install glib
, everything work fine.In this issue, what I'm doing is to make a discussion about should we solve the problem on the layer of vcpkg .
@dg0yt is right, iconv is it's own issue. OpenBSD has BSD's implementation of iconv, but glib and friends - via gnu gettext - rely on GNU's implementation of iconv. Vcpkg actually has a port for GNU's iconv, just that it omits deployment on OpenBSD.
The line omitting the deployment of GNU iconv, rather then whitelisting Windows, MacOS and Android, probably should blacklist glibc based linux implementations which have iconv in the libc. But even if they have it in the libc, we should be able to just ship and use our own one even there.
Reproducting Github Action using ChristopherHX/github-act-runner on a vultr hosted OpenBSD-7.5: link
Notoriously, the artifact for ${VCPKG_ROOT}/installed/vcpkg/info indicates that the libiconv
package did not provision the iconv.h
file that causes glib consumes.
OpenBSD has BSD's implementation of iconv, but glib and friends - via gnu gettext - rely on GNU's implementation of iconv.
Where can this be verified w.r.t. BSD?
FTR we also to deal musl libc Linux systems which don't have gettext/libintl in the C lib.
I do know that gettext comes with detection logic built into m4 files for autotools, and I assume that's why we don't have pkg-config files. CMake has Find modules, but they need wrappers in vcpkg. Meson ... still not encouraging.
Thank you, I see. Let's divide this issue into two.
Locations for putting user libraries and include files used by BSD systems:
/usr/local
/usr/local
/usr/pkg
/usr/local
Meson doesn't find libraries and includes inside these directories (e.g. for OpenBSD, user libraries and includes are inside
/usr/local/lib
and/usr/local/include
), and this causes you cannot get an out-of-box installation for many package that uses meson to build, for example, glib. These are logs ofvcpkg install glib
, on OpenBSD: Console output:Part of
config-x64-openbsd-dbg-out.log
:There's an issues mention mentioned this problem: https://github.com/mesonbuild/meson/issues/4468, but it seems that they are still debating. I believe it might be better if we pass these BSD locations to meson (set additional include path and library path), in order to provide an out-of-box installation of the packages use meson, as a temporary solution?