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

Ensure we can construct remote store configs in isolation #11108

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

Ericson2314
Copy link
Member

Motivation

Progress towards #10766

Context

I thought that #10768 achieved, but when I went to use this stuff (in Hydra), turns out it did not. (Those using FooConfig; lines were not working --- they are so finicky!) This PR gets the job done, and adds some trivial unit tests to make sure I did what I intended.

I had to add add a header to expose SSHStoreConfig, after which the preexisting ssh-store-config.* were very confusingly named files, so I renamed them to common-ssh-store-config.hh to match the type defined therein.

Priorities and Process

Add 👍 to pull requests you find important.

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

@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Jul 15, 2024
@@ -143,6 +143,7 @@
''^src/libstore/common-protocol-impl\.hh$''
''^src/libstore/common-protocol\.cc$''
''^src/libstore/common-protocol\.hh$''
''^src/libstore/common-ssh-store-config\.hh$''
Copy link
Contributor

Choose a reason for hiding this comment

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

why not apply formatting?

Copy link
Member Author

@Ericson2314 Ericson2314 Jul 15, 2024

Choose a reason for hiding this comment

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

We don't yet have a plan for how we want to format existing files (and this is a renamed file) --- e.g. creating conflicts with PRs, cherry-picks between us and Lix, etc. makes for some real downsides.

Copy link
Contributor

Choose a reason for hiding this comment

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

there is already a clang-format; I find this take a bit odd.
Format and move on my take.

@@ -1,6 +1,6 @@
#include <regex>

#include "ssh-store-config.hh"
#include "common-ssh-store-config.hh"
Copy link
Contributor

Choose a reason for hiding this comment

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

ssh directory ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would wait for such things until we've fully switched to Meson -- the subdirectories we have today are not done in a consistent manner and mostly stuff is flat.

src/libstore/legacy-ssh-store.cc Outdated Show resolved Hide resolved
std::string_view scheme,
std::string_view host,
const Params & params)
: StoreConfig(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this validate it's ssh-ng ?

Copy link
Member Author

@Ericson2314 Ericson2314 Jul 15, 2024

Choose a reason for hiding this comment

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

Oh can't do that because its mounted-ssh-ng for subclass (which itself is bad, but we cannot yet fix)

tests/unit/libstore/legacy-ssh-store.cc Outdated Show resolved Hide resolved
Progress towards NixOS#10766

I thought that NixOS#10768 achieved, but when I went to use this stuff (in
Hydra), turns out it did not. (Those `using FooConfig;` lines were not
working --- they are so finicky!) This PR gets the job done, and adds
some trivial unit tests to make sure I did what I intended.

I had to add add a header to expose `SSHStoreConfig`, after which the
preexisting `ssh-store-config.*` were very confusingly named files, so I
renamed them to `common-ssh-store-config.hh` to match the type defined
therein.

namespace nix {

struct SSHStoreConfig : virtual RemoteStoreConfig, virtual CommonSSHStoreConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Any comments here you can add?
I'm not familiar with what makes this experimental vs. legacy?

Should the legacy have \deprecated or @deprecated (whatever is the pattern in doxygen)

Copy link
Member Author

Choose a reason for hiding this comment

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

I just moved this code. the legacy ssh uses a different protocol, but this one uses the same protocol as the Nix daemon. It probably shouldn't say "experimental" as its not an experimental feature (it predates those), but I think that's best done in a separate PR.

@Ericson2314 Ericson2314 merged commit 4bbadba into NixOS:master Jul 16, 2024
11 checks passed
@Ericson2314 Ericson2314 deleted the remote-store-constructors branch July 16, 2024 02:51
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