-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: support shared libraries inside packages #257
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is exactly what we need. I think it is a non-breaking change. I did this change in #238 and it worked with NumPy as well.
May be we can accept ––destdir
as an optional argument and pass it only when available. That way if someone needs it they can pass it via spin build ––destdir
. In simple words, its just like what we did for ––prefix
in spin
.
I don't think anyone needs it - I'd avoid adding it unless there's a real-world use case. |
Good catch, thanks @rgommers! Happy to move to |
This drops the use of staged installs with `--destdir` in favor of using `--prefix` for the install location. The problem is that RPATHs in extension modules end up pointing to what Meson thinks is the final install location (i.e., inside the prefix) rather than to the staging directory. `--destdir` seems meant for packaging, as an actual staging area, while for `spin` the final install directory is `build-install` (by default), there is no intent to later put this package into `/usr` or `C:\`. Hence using `--prefix` seems like the correct thing to do. The one test change here is to a test that was incorrect. `meson setup --prefix` expects an absolute path, and `/foobar` isn't a path that exists or can be created. Addresses the issue discussed in PR 238 - the `spin build` behavior before this change cannot be made to work for SciPy, because the internal shared library in `scipy.special` keeps breaking. It should also address the problem discussed in issue spin#176.
dd3c945
to
8620c27
Compare
This tests using a shared library from a Python extension module, which is relevant for SciPy (scipy.special contains such a shared library).
8620c27
to
e1cee14
Compare
I can't quite tell what's up with the editable install failures on Windows. Will need to switch to a Windows machine to see what's up - could be something trivial, but if it's not then it's probably relevant for SciPy as well when we switch to |
Windows is very finicky; I have a test machine here for that purpose, and can help debug if that'd be helpful. |
Thanks. I'll try to have a look at it in the coming days, but if you have time to look at it that may be helpful. I haven't quite followed along with how editable install support in |
|
This drops the use of staged installs with
--destdir
in favor of using--prefix
for the install location. The problem is that RPATHs in extension modules end up pointing to what Meson thinks is the final install location (i.e., inside the prefix) rather than to the staging directory.--destdir
seems meant for packaging, as an actual staging area, while forspin
the final install directory isbuild-install
(by default), there is no intent to later put this package into/usr
orC:\
. Hence using--prefix
seems like the correct thing to do.The one test change here is to a test that was incorrect.
meson setup --prefix
expects an absolute path, and/foobar
isn't a path that exists or can be created.Addresses the issue discussed in gh-238 - the
spin build
behavior before this change cannot be made to work for SciPy, because the internal shared library inscipy.special
keeps breaking. It should also address the problem discussed in issue gh-176.It may be my fault for suggesting the use of
--destdir
early on inspin
's life - I think I understand the tradeoffs a bit better now.@stefanv question about testing - do you want me to extend
example_pkg
with a shared library? It will look likesharedlib-in-package/mypkg/sub/*
in mesonbuild/meson-python#700. It's a little bit of extra complexity, but it should be pretty robust since it mirrors what SciPy has internally.