paths method
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
Meson 0.45 has a files() and and include_dirs() to deal with relative paths and current_source_dir() and project source root for absolute paths, and join_paths to join paths.
But meson does not have a paths() method that can construct a relative path similar to files which do not accept directory names.
If a parent meson.build wants to set some_base = '.' and a sub directory two levels down wants to use some_base/some_dir/mysource.c then it must know its exact location in the tree and either use ../../some_base/some_dir/mysource.c, or use some_base = join_paths(some_base, '../..') but the latter pollutes the namespace and breaks other build files.
The parent build file cannot set the path because it must be a relative path, and it doesn't want to know all details, just tell where the base is located.
A paths() function would solve this similar to how files and include_dirs work:
in parent:
some_base = paths('.')
in two levels down
my_src = join_paths(some_base, 'some_dir/my_source')
The sub build file does not need to know where it is located, it just needs the relative path to some base.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Meson's existing files(), include_dirs(), current_source_dir(), and join_paths() handling. Determine how a paths() API could preserve a parent-provided base for subdirectories without requiring callers to know their tree depth. Done means the behavior is specified, implemented, and covered for the parent and two-levels-down example described here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100