-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos/sshd: fixes validation for cross-compilation #62853
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
Conversation
First of all sorry for the breakage I caused! In fact @fpletz and I discussed about this in #58718.
Same here, we assumed that On a side-note: there are some other modules like
Naively asked: why? In other words: which sort of issues do you have in mind? The current validation only ensures the syntactical correctness of the resulting sshd configuration, so we shouldn't experience too much behavioral differences in that case, right? |
I assumed that it would validate that options are set in valid ways, and that options are valid. Meaning that those cases could be problematic:
If it only checks syntax it might be less of an issue, assuming at that point that an incompatible syntax using Open SSH sshd fork would likely not the module anyway.
This is not obvious whether it checks validity of options and values or only that it can parse the file. |
In native mode, this patch causes:
Looking at it, I'm not sure why. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would've went for cfgc.package -> pkgs.buildPackages.openssh
in nativeBuildInputs
.
The splicing that makes I too would just unconditionally do |
Middle ground would be something like:
That would address both potential closure size concerns and fix cross-compilation (if only a bit verbose). |
30cd4ac
to
0bb0ff1
Compare
0bb0ff1
to
317d67a
Compare
317d67a
to
861bbbc
Compare
Thank you so much for working on this! Tested here too. |
Motivation for this change
Make cross-compilation work for
sd-image
without modifications in Nixpkgs.This is the only bit which cannot be tackled through options or overlays.
I do not like the solution. Do not merge before one of our cross expert chimed in with another solution.The issue here is that, AFAIUI,cfgc.package
will not resolve to the rightnativeBuildInput
, though I do not understand why exactly. This is not as simple as testing with any other sshd, ideally you want to test with the one that will run the configuration. Thus, it needs to be the one configured in the option, but its cross-compiled cousin.Using @yegortimoshenko's suggestion.
This was tested by building sd_image through cross-compilation.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)cc @matthewbauer @Ericson2314 as cross-compilation experts