mesonbuild / mesonbuild/meson

find_library() with dirs kwarg falls back to system lib dir

Open
#3,758 1 comment 0 reactions 0 assignees View on GitHub
compilers dependencies
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

In the documentation of `compiler.find_library()`, it states that the `dirs` kwarg should override the system lib dir. But given a `dirs` argument that refers to a non-existent directory, the function goes to the system lib dir and finds a library with the corresponding name.

For our build we need it to fail instead. If we think the library was found according to the `dirs` argument, then we will `include_directories` using a special relative path inside that `dirs` area. This of course does not work where the library was (unexpectedly) found in the system lib dir.

Contributor guide

Open the contributing guide

Research direction

Start at the implementation and documentation for compiler.find_library(), then reproduce the case with a dirs argument pointing to a non-existent directory and a library available in the system lib dir. Done means the dirs argument no longer falls back to the system lib dir and the documented override behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.