Open FFY00 opened 8 months ago
You need to use py.get_install_dir(pure: true)
not py.get_path('purelib')
.
I am running into this issue again.
project('example', 'c', version: '1.0.0')
lib = library('example', 'lib.c', install: true)
py = import('python').find_installation()
py.install_sources('example/__init__.py', subdir: 'example')
py.install_sources('example/pkgconf/__init__.py', subdir: 'example/pkgconf')
pkg = import('pkgconfig')
pkg.generate(lib, install_dir: py.get_install_dir(pure: true) / 'example' / 'pkgconf')
It seems some targets, like configure_file
work, but import('pkgconfig').generate(...)
doesn't seem to.
I think it's worth going through all the more advanced/niche Meson target types and checking how they land in intro-install_plan.json
. I think it is going to happen again in the future that something either isn't mapped at all, or isn't mapped correctly. Right now I know of:
import('pkgconfig').generate(...)
(this example) ending up with an absolute pathinstall_symlink
isn't mapped at allI bet if we look at other things that aren't normally included in wheels (e.g., jar
) they won't be handled correctly by default. In most cases explicitly setting install_path
should provide a reasonable workaround.
So: not really a bug, more a missing feature.
install_symlink
isn't mapped at all
Wheels cannot contain symlinks AFAIK.
import('pkgconfig').generate(...)
(this example) ending up with an absolute path
This would be a bug in Meson.
Wheels cannot contain symlinks AFAIK.
Yet:) Being heavily discussed right now. Either way, silently omitting them is probably not the ideal way of handling this now. Also intro-install_plan.json
probably shouldn't be considered something that is exclusively for meson-python
, so I expect it to be complete regarding all install targets.
intro-install_plan.json
cannot be complete by design: Meson allows to install the same file in multiple locations but the intro-install_plan.json
is a mapping from source location to installation location, thus it cannot describe a source file being installed in multiple places. See https://github.com/mesonbuild/meson/issues/11539 and https://github.com/mesonbuild/meson/issues/12001
Sure, but that doesn't quite apply to this situation. It could be as complete as possible as the metadata encoding scheme allows for.
I'd suggest to consider these Meson bugs, and once they're included in intro-install_plan.json
then we have to figure out how to do something reasonable with them in mesonpython. For .pc
files there's also gh-240, so those we do have to figure something out for.
Reproducible: #608
install_data
here is just an example, I know I can usepy.install_sources
, but that is not viable in various different scenarios. In my case, I ran into it when usingimport('pkgconfig').generate(..., install_dir: py.get_path('purelib') / ...)
.