Skip to content

Split out store-open.hh and store-registration.hh #13188

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

Ericson2314
Copy link
Member

Motivation

The existing header is a bit too big. Now the following use-cases are separated, and get their own headers:

  • Using or implementing an arbitrary store: remaining store-api.hh

    This is closer to just being about the Store (and StoreConfig)
    classes, as one would expect.

  • Opening a store from a textual description: store-open.hh

    Opening an aribtrary store implementation like this requires some sort
    of store registration mechanism to exists, but the caller doesn't need
    to know how it works. This just exposes the functions which use such a
    mechanism, without exposing the mechanism itself

  • Registering a store implementation: store-registration.hh

    This requires understanding how the mechanism actually works, and the
    mechanism in question involves templated machinery in headers we
    rather not expose to things that don't need it, as it would slow down
    compilation for no reason.

Context

Gets us closer to #11139


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

The existing header is a bit too big. Now the following use-cases are
separated, and get their own headers:

- Using or implementing an arbitrary store: remaining `store-api.hh`

  This is closer to just being about the `Store` (and `StoreConfig`)
  classes, as one would expect.

- Opening a store from a textual description: `store-open.hh`

  Opening an aribtrary store implementation like this requires some sort
  of store registration mechanism to exists, but the caller doesn't need
  to know how it works. This just exposes the functions which use such a
  mechanism, without exposing the mechanism itself

- Registering a store implementation: `store-registration.hh`

  This requires understanding how the mechanism actually works, and the
  mechanism in question involves templated machinery in headers we
  rather not expose to things that don't need it, as it would slow down
  compilation for no reason.
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner May 14, 2025 20:10
@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority store Issues and pull requests concerning the Nix store repl The Read Eval Print Loop, "nix repl" command and debugger c api Nix as a C library with a stable interface labels May 14, 2025
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just moved code, modulo formatting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just moved code, modulo formatting

@roberth roberth merged commit 12b7132 into master May 14, 2025
25 checks passed
@roberth roberth deleted the store-open-reg-header branch May 14, 2025 22:21
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2025-05-14-nix-team-meeting-minutes-226/64298/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger store Issues and pull requests concerning the Nix store with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants