Skip to content

Comments

Move worker_proto defs out of remote-store.cc to own file#8360

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:worker-protocol.cc
May 17, 2023
Merged

Move worker_proto defs out of remote-store.cc to own file#8360
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:worker-protocol.cc

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented May 17, 2023

Motivation

These items are not templates, and they declared in worker-protocol.hh; therefore they should live in a worker-protocol.cc.

Anything else needlessly diverges from convention. After all, it is not like this code is only used in remote-store.cc; it is also used in daemon.cc. There is no good reason to place it with the client implementation or the server implementation when it used equally by both.

(No code is changed, just code is moved. One can use git diff --color-moved to verify.)

Context

This came from #6223; I do understand that PR is still WIP and not yet idea-approved from the team as a whole, but prep commits like this I think should avoid the controversial downsides.

Moving things into better locations might seem trivial, but it will help me avoid conflicts on #6223 which is very useful to me. Even if that PR doesn't happen, per the motivation above (which is careful not to mention #6233, and just talk about this change in isolation) I think it is still net-positive.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.

@Ericson2314 Ericson2314 requested a review from thufschmitt as a code owner May 17, 2023 14:06
@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label May 17, 2023
@Ericson2314 Ericson2314 enabled auto-merge May 17, 2023 14:15
These items are not templates, and they declared in
`worker-protocol.hh`; therefore they should live in a
`worker-protocol.cc`.

Anything else needlessly diverges from convention. After all, it is not
like this code is only used in `remote-store.cc`; it is also used in
`daemon.cc`. There is no good reason to place it with the client
implementation or the server implementation when it used equally by
both.
@Ericson2314 Ericson2314 force-pushed the worker-protocol.cc branch from 75aaaea to 904878d Compare May 17, 2023 14:36
@Ericson2314 Ericson2314 merged commit 05cb934 into NixOS:master May 17, 2023
@Ericson2314 Ericson2314 deleted the worker-protocol.cc branch May 17, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants