mesonbuild / mesonbuild/meson

Default libprefix on Debian like distribution seems not good.

Open
#1,972 15 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

By default, on 64 bits Debian like distribution, meson will install library in `/usr/local/lib/x86_64-linux-gnu`.
However, this directory is not in the library searched path by default (`/usr/local/lib` is), and so, the library cannot be linked.

Here a small reproducer using this small test project [test_meson.tar.gz](https://github.com/mesonbuild/meson/files/1090937/test_meson.tar.gz) :

```
$ cd test_meson
$ meson src build
$ cd build
$ sudo ninja install
$ mytestprogram
mytestprogram: error while loading shared libraries: libmytestlib.so: cannot open shared object file: No such file or directory
```

To be honest, I'm not sure it is a `meson` bug. On Fedora, `/usr/local/lib` is even not in the default search paths. Searching a bit about this issue, it seems that it is not a easy case, different distributions will set different multiarch libprefix and default library search paths. (and `lib/x86_64-linux-gnu` is the good libprefix if installing in `/usr`)

However, it seems really surprising, that using the default options, meson is installing something "not working".

Contributor guide

Open the contributing guide

Research direction

Start with the attached test_meson.tar.gz reproducer and run the shown Meson and ninja install commands on a 64-bit Debian-like system. Inspect the default library installation path and the resulting dynamic-library lookup behavior; done means the expected default installation behavior is established and the issue's outcome is covered by an appropriate regression or documented as distribution-specific.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.