Skip to content
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

postgresql: split -lib and -dev outputs cleanly #294504

Merged
merged 6 commits into from
Aug 24, 2024

Commits on Aug 23, 2024

  1. postgresql: move dynamic modules to default output

    Dynamic modules are technically libraries, but are not used by other packages.
    Instead they are loaded by PostgreSQL itself, e.g. as extensions. Those just
    increased the size of the lib output without benefit.
    
    This removes the NIX_PGLIBDIR hack introduced in NixOS#17838 and instead makes sure
    that pg_config always returns the correct PGLIBDIR. The test for postgis
    introduced in the same PR is still passing with the change.
    wolfgangwalther committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    5547322 View commit details
    Browse the repository at this point in the history
  2. postgresql: move libecpq to lib output

    This library is used by other packages, so should be in the lib output.
    
    By removing unused sections, libecpg will not contain any references to other
    outputs and thus does not increase the closure for the lib output anymore.
    This will also help massively when splitting a dev output later.
    
    As a side-effect, this also unbreaks pkgsMusl.postgresql_12_jit and
    pkgsMusl.postgresql_13_jit. For, at least to me, unknown reasons, those build
    fine now.
    wolfgangwalther committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    7797728 View commit details
    Browse the repository at this point in the history
  3. postgresql: split dev output

    This splits a dev output to make the default output not depend on any
    build dependencies anymore. This also avoids removing references from
    pgxs' Makefile this way, which should, at least theoretically, be good
    to build extensions via pgxs, making sure they use the same tooling.
    
    ecpg is the "embedded SQL C preprocessor", which is certainly a dev
    tool.
    
    Most important, for closure size anyway, is to move pg_config to the dev
    output, since it retains paths to all the other outputs.
    
    The only thing with references to the dev output remaining is then the
    postgres binary itself. It contains all the output paths, because it
    shows those in the pg_config system view. There is no other way than
    to nuke those references to avoid circular dependencies between outputs
    - and blowing up closure size again.
    wolfgangwalther committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    435f51c View commit details
    Browse the repository at this point in the history
  4. postgresql: remove references to llvm-dev on darwin as well

    The !isDarwin condition seems to have been put in place only because of the
    use of patchelf, which in turn seemed to be necessary because of nuke-refs.
    
    Replacing the big nuke with the more granular remove-references-to allows
    enabling this for darwin, too.
    wolfgangwalther committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    94d432c View commit details
    Browse the repository at this point in the history
  5. postgresql: refactor removal of references in bitcode files

    This prevents silently ignoring errors from "find".
    wolfgangwalther committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    dfde86f View commit details
    Browse the repository at this point in the history
  6. postgresql: refactor to simplify condition

    glibc is not available on darwin anyway and isGnu is just shorter.
    wolfgangwalther committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    73cb403 View commit details
    Browse the repository at this point in the history