-
Notifications
You must be signed in to change notification settings - Fork 70
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
We are not copying the files from the Meson install directory #344
Comments
I added the information required to handle |
This is wrong. It should be |
For this part it'd be great if we had a test case, that's a lot easier to talk about then discussing what may happen in the absence of it. Would you be able to construct one @FFY00?
Thanks for fixing that. This is an issue with minor impact, and it's already fixed in Meson, so I agree that it's fine to just wait for that - no need to implement a workaround for older Meson versions that we still support. I guess we do need a test case. Either way, this is gh-317 so let's keep the discussion there and keep this for the RPATH one. |
Thanks!
I'd say this is a bug in Meson, there's no point in having that method if you can't use the paths for anything, and using Anyway, as a user, I'd assume that works. |
The documentation is clear about what that function does, I don't understand why you would expect it to do something different than what it is documented to do. If you want to mix purelib and platlib you use
Well, it does not, and you receive and error telling you that it doesn't, so that you can fix your code and your expectations. |
For users to interpret the documentation that way, they need to be aware that Meson will change the Python paths, instead of simply honoring what is returned by sysconfig.
I missed that bit in the documentation, thank you for pointing it out.
As I mentioned, the documentation is not clear IMO, and it does work in certain scenarios. Since it doesn't many other scenarios, and |
The primary distinction between py.get_path() and py.get_install_dir() is that the former lets you get at information like Which is relevant for a couple reasons, but most blatantly if you've configured meson with ... We provide get_path() for the same reason we provide get_variable(), for the sake of thoroughness in case people want to introspect python for cases that aren't builtin... I suppose it may be plausible to have get_path recognize attempts to use it to emit purelib/platlib directories and emit a warning that get_install_dir() is probably what was meant? |
But it's irrelevant by design because Meson will mangle the install paths. If you are changing the paths for install, shouldn't you also change the paths here? In which scenario would you want a path that points to a directory that is not consistent with the Python installation Meson is installing for? Again, I don't think Meson should be changing these paths at all in the first place, and instead pick up the right Python interpreter, but if you do, shouldn't that also be reflected here? |
I truly have no idea why people might want to get the path to for example "stdlib" (which really has nothing to do with installing anything). But then again, I also have no idea under what circumstances people want get_variable(). I am sure that inventive people doing complex things will discover reasons why such information matters to them, though. I would even venture to say it's not totally inconceivable that someone will have thought of some highly unusual reason why they want to check inside the default purelib directory for something unconnected to where files are being installed to. And the assumption behind both those functions was that they would be advanced-usage auxiliary functions, ever since the module's original implementation way back in early 2018. |
That is fair, but as-is, given Meson's handling of Python, they're mostly unusable IMO. Fixing them is not that easy anyway. Meson picking the incorrect Python interpreter, and subsequently having to mangle its paths, is what actually needs fixing 🙃 |
@FFY00 you have been reporting that Meson picks the wrong python interpreter in some cases multiple times now. However, I haven't been able to understand what you mean with that, and it is not my experience. Can you be more specific about the circumstances in which Meson picks the wrong python interpreter, and what you mean by wrong? |
I have explained this multiple times on the Meson bug tracker, like in mesonbuild/meson#11133 (comment), but the summary is that Meson picks the Python interpreter just like it would any other program and then tries to adapt the paths for the prefix it wants to install, which is not portable. Installation paths differ between interpreters. You cannot reliably pick the paths from one, change the prefix, and expect them to work on a different interpreter. If you want to install a project to Additionally, the interpreter in the prefix you are going to install to might even be a completely different version, so you might end up building incompatible modules. This at least won't crash, because the modules will include the minor Python version in the name, but it's just another case that showcases the issue. |
This is fixed after gh-467 and previous PRs, closing. The |
RPATH handling is not correct, though. It is just that our tests do not spot the problem: we leave a spurious RPATH entry pointing at the directory in which the executable, library, or Python extension are installed. #469 fixes this issue and extends the tests. I also wonder if we need to amend the documentation to reflect the fact that we don't actually run |
Good point - probably worth mentioning. Low prio I think, but still useful. How about we open a new doc issue to track this? |
Done. See #473 |
While reviewing #340, I found that we are not actually using the Meson install directory to copy files to the wheel, and instead we are copying them from the build directory.
This has two problems I can identify:
RPATH
RPATH
so that you can run stuff from the build directoryinstall_subdir
are ignoredReproducible with all examples from the
install_subdir
docs:The text was updated successfully, but these errors were encountered: