This strikes me as the core of the issue here. Schemes are supposed to be supplied with config variables and handle them appropriately. So if posix_local can’t handle a base value other than /usr, it’s (IMO) the scheme that’s at fault. But trying to assign blame is counterproductive here, and I’m not trying to do that - just to understand better how we got into this situation (and work out how to avoid it in the future).
Yeah, I find the whole reasoning around --prefix (and --root, for that matter) to be pretty obscure. Maybe it’s because of my Windows background, but it makes very little sense to me. I’d personally rather we just had the system schemes (system, user and venv) along with a user-configurable “target” style scheme, that allowed the user to pick their own layout. But that’s a much bigger project, and one I simply haven’t got time for at the moment.
Part of the problem is that I, personally, don’t feel qualified to make a call here. I understand that it’s a simple fix that would help Debian, but as I said, I don’t have a good view of the bigger picture. And the fact that @pradyunsg started this thread suggests to me that he also didn’t know the best answer (although in the intervening 3 years, enough might have changed to alter his view).
I really hope not. IMO, sysconfig gives us the flexibility to allow distros to set up their own layouts. All that is missing is a bit of documentation clarifying how schemes should map to typical installation scenarios. That’s something that should be in core, but was traditionally hidden in the murk that was the distutils documentation - and when distutils was taken out of core, even the hints that were in there got lost. The only reason I think it’s a hard problem to address is because it crosses the boundary between “core functionality” and “packaging ecosystem” in a way that makes it feel like no-one owns the issue.
Yes, and uv pip install has a --prefix option as well.
On the other hand, if you’re saying that we should deprecate and ultimately remove --prefix, you won’t get any argument from me. Can we do the same for --root, please
? Realistically, that’s not an option, though, so deciding on correct behaviour for --prefix installs is necessary, like it or not.