Possibility to depend on the tarball generated by `ninja dist`
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
I am trying to build RPMs for the current project with a custom target roughly looking like this:
```
spec = configure_file(input: 'foo.spec.in', output: 'foo.spec', configuration: ...)
custom_target('rpm',
input: [spec, tar],
output: 'foo.src.rpm', # there might be other RPMs generated...
command: [
find_program('rpmbuild'),
'--define', '_sourcedir ' + meson.current_build_dir(),
'--define', '_builddir ' + meson.current_build_dir(),
'--define', '_srcrpmdir ' + meson.current_build_dir(),
'--define', '_rpmdir ' + meson.current_build_dir(),
'--clean',
'--ba', '@INPUT0@',
]
console: true,
)
```
However, the problem is the `tar` input. I could try to come up with my own custom target to create the tarfile, but this is cumbersome, and meson already has a means of generating a dist tarfile. Would it be possible to expose this somehow so it can be used as input/dependencies for targets like the one above?
Contributor guide
Research direction
Start by tracing how `ninja dist` produces its tarball and how `custom_target` handles inputs and dependencies. Determine an interface that exposes the generated archive to another target, then validate it with the RPM example using `rpmbuild` and confirm the tarball is built before the RPM target runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100