-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Make a libpq package #61580
Comments
CC @matthewbauer @peti for Haskell. CC @FRidh for Python, would Python benefit from this? |
I thought the postgresql.lib output would do this for us? |
@matthewbauer yes for runtime closure size, no for |
FWIW, regarding closure size, I considered splitting this up before when I did significant Postgres work last year but ultimately went against it because multi-output That said something containing "only" As for dependencies, well, they're pretty slim too:
But why do we need them?
Therefore, I think a much better use of time would be to just slim down |
@nh2 Does overriding |
@thoughtpolice Thanks for your analysis, that is good to know.
That is not enough for musl support though because with the current setup where we build all of postgresql with So in my proposal, a It seems a good idea to me to give that "postgres without systemd build dependency" thing a name, and I found |
I don't follow the logic here. You want a systemd-less version of
In other words: why should upstream Put another way -- what use cases does this particular scheme make easier/possible that aren't currently possible, and why is this the way it must be done? Keep in mind that third parties outside use I'm not convinced this is a good plan yet. IMO it would be strictly better to simply disable systemd support unilaterally if
I may be misunderstanding something, but this seems somewhat fishy as an approach, to me. Also, the whole phrasing of "introduce libpq so I can use musl" seems like a classic X-is-Y problem... The actual problem is not that |
@thoughtpolice What you propose sounds like a good plan to me. One question though: Are there situations where some programs may want to use only the postgresql server libraries? E.g. should there be |
I am not sure about that in the case of first-party things shipped with PostgreSQL. I do not think there's any reasonable way for someone to interface with/link against those meaningfully. They can only be used by For certain third party extensions, I know they do ship libraries and headers that can be consumed by other extensions. But that case is handled fine: because those expressions will act normally, have I don't think there are any realistic use cases where someone would want all the server libs, but not the binaries in So, if we cleaned up things as I mentioned earlier -- by putting server extensions in But I think that's a particular, rare-or-impossible enough bridge that we can cross that one when (if) we get to it. |
On by default, as was before. The systemd dependency means that all libraries or applications using only libpq will also pull systemd into their closures. Further, no application or library using libpq can be built against musl, as systemd relies on glibc-only features and thus does not build with musl. With it being configurable, packages that need only the library can at least turn it off to reduce their closure size.
On by default, as was before. The systemd dependency means that all libraries or applications using only libpq will also pull systemd into their closures. Further, no application or library using libpq can be built against musl, as systemd relies on glibc-only features and thus does not build with musl. With it being configurable, packages that need only the library can at least turn it off to reduce their closure size.
I don't think this is a good idea. systemd.lib is only 1.8M and seems like a reasonable thing to have a runtime dependency on:
Splitting packages into multiple parts makes things much more confusing to reason about. Just because other distros do it doesn't mean it's a good idea. Multiple outputs are there to avoid this mess. We should use package splitting as a last result! On the other hand, disabling systemd support when you are building with Musl seems reasonable. But it would be much better to just fix musl support in systemd. |
@matthewbauer FWIW, see #61581 for my proposed changes to @nh2's proposed changes -- which effectively do what you ask (systemd is always available, unless I also do not think systemd upstream has any interest in building with musl; some googling leads to various patches which seem to be rather invasive, and I think it would be better to avoid cluttering our own systemd patchset with a ~dozen more. It's possible to get a subset of systemd's library code working with musl (a lot of the most useful stuff like socket activation helper code, sd_log etc are all in just a single header file), but anything that truly needs libudev or libsystemd is going to be tricky. |
I can think of another good reason of splitting If we could have |
I wrote "splitting" but in fact I just want a separate top-level attribute for libpq. Which should be |
…S#61581) On by default, as was before. The systemd dependency means that all libraries or applications using only libpq will also pull systemd into their closures. Further, no application or library using libpq can be built against musl, as systemd relies on glibc-only features and thus does not build with musl. With it being configurable, packages that need only the library can at least turn it off to reduce their closure size.
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
still important to me |
I marked this as stale due to inactivity. → More info |
I think the first task in the OP can be checked off? |
The |
In my opinion, a separate
I opened a Draft MR based on @teburd's work to hopefully move something forward: #234470 |
Well said @szlend. Couldn't agree more |
I'm summarizing the current state:
That's all stuff that everybody seemed to agree on was a good idea. It was also proposed to have a separate In #294504, we discussed different approaches without building a separate derivation, but ultimately took it out before merge, because this approach just doesn't work well:
Multiple proposals / PRs have been made to build Those proposals don't say anything about whether This leaves us with only argument against building a separate A separate |
Does that mean we can build |
Unfortunately, at least right now, not. I didn't even find a way to do this with meson hackery, yet. So we should probably settle for a autoconf build at first and then iterate later. |
Just to make sure I follow your reasoning here, that means you'd suggest a fresh build (that just uses
Even though I'm not too happy with this, I agree. Is there any upstream bugreport already to make this better? IIRC part of the problem with the current build system was that there's a make target for libpq, but it pulls in the server part anyways(?) [1] Now that I think of it, it might make sense to allow temporarily hardcoding the source in |
Correct.
Not sure about the autoconf build there, but that's precisely the problem with meson right now. You can build libpq + client binaries only, but installing afterwards will trigger a full build of all server stuff as well. I don't think there is any upstream report about this, yet. It's on my list, but I would like to figure out a possible solution first and then propose that at the same time.
I can't think of a nice solution to allow this temporarily. The cleanest approach would be to reference the same source twice explicitly and update it independently, without relying on This would also allow merging a new major version directly into master, because it wouldn't trigger the full rebuild via libpq. While we should update libpq asap, it's kind of annoying to deal with both in the same PR (e.g. #345260). |
Decoupling |
Resolves NixOS#61580
Resolves NixOS#61580
Resolves NixOS#61580
Resolves NixOS#61580
Resolves NixOS#61580
Resolves NixOS#61580
Right now nixpkgs only has
postgresql
, which contains much more thanlibpq
.By offering a
libpq
package like other distros, the closure size of many packages could be reduced significantly.Even more so because
postgresql
currently depends onsystemd
. And that also means that no application or library usinglibpq
can be built againstmusl
, assystemd
relies on glibc-only features and thus does not build with musl.Tasks:
postgresql
->systemd
dependency configurablelibpq
package containing only libpqlibpq
instead of all of postgresqlThe text was updated successfully, but these errors were encountered: