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

feat: reintroduce nix flake #1683

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Commits on Apr 28, 2024

  1. build(nix): add nix flake with cargo-pgrx package

    This exposes the `cargo pgrx` binary as a flake package called
    `cargo-pgrx`. It can be built using `nix build .#cargo-pgrx`.
    
    The systems specified in this flake were chosen from the project's
    README of tested systems. The flake inputs were chosen to minimize the
    maintenance burden.
    
    Since the build runs tests in order to succeed, but the tests are
    performed at build time for nix, the `test_parse_managed_postmasters`
    test has been skipped. Since pgrx already has a test suite that runs
    outside of nix, this should be a good compromise to allow the build to
    work, but also keep the majority of the tests to ensure that nix users
    are aware when they are broken. In addition to this, the `PGRX_HOME`
    variable must be set for tests, so it is assigned to a tmpdir before
    running the tests.
    justinrubek committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    c495891 View commit details
    Browse the repository at this point in the history
  2. ci(nix): add rust-toolchain update script

    This script can be ran to update the rust-toolchain that is used by nix
    builds. Since `fenix` is a flake input end-users are able to override it
    themselves to whichever version they please, however it is useful to
    have the provided version up to date, particularly if the project
    ends up having an MSRV.
    
    We could likely change this script to be one that updates all flake
    inputs, however I find it useful to be able to update the rust
    toolchain separately from the other dependencies and have chosen to
    provide a script soley for that. This matches the existing `rustup.sh`
    that is used to update the rustup toolchain version. If you wish to make
    this file a generic `flake.lock` updater, remove `fenix` from the call
    to `nix flake update` and it will update all inputs.
    justinrubek committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    242a588 View commit details
    Browse the repository at this point in the history
  3. feat(nix): provide buildPgrxExtension function

    This function can be used by external nix flakes to build an extension
    using pgrx. The caller must provide the postgres package, the rust
    toolchain, extension source code, and flake system that they are
    building for.
    
    Most of this configuration has been converted from the previous nix
    flake exposed from pgrx. I've made every attempt to trim away parts that
    don't serve a purpose, but there's a chance that this could be
    simplified slightly by someone who has more knowledge of pgrx than I do.
    justinrubek committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    13cf708 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2024

  1. fix(nix): aarch64-darwin builds

    Co-authored-by: Sam Rose <samuel@supabase.io>
    samrose and Sam Rose committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    38ffc9e View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. feat: add a devShell

    samrose committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    d8da280 View commit details
    Browse the repository at this point in the history