Skip to content

Pass NIX_SSHOPTS when checking for an ssh master connection.#8506

Merged
roberth merged 2 commits intoNixOS:masterfrom
corngood:ssh-master
Jul 18, 2023
Merged

Pass NIX_SSHOPTS when checking for an ssh master connection.#8506
roberth merged 2 commits intoNixOS:masterfrom
corngood:ssh-master

Conversation

@corngood
Copy link
Contributor

Motivation

This adds NIX_SSHOPTS to the args when calling ssh -O check.

Context

This should fix #8480.

I'm a little worried about the consequences of this, but the docs don't make any promises about how ssh is called, so I think it's fair to use NIX_SSHOPTS in this way.

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.

corngood added 2 commits June 13, 2023 00:54
This highlights a problem caused by SSHMaster::isMasterRunning returning
false when NIX_SSHOPTS contains -oControlPath.
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Jun 13, 2023
@thufschmitt
Copy link
Member

cc @balsoft

@ikervagyok
Copy link

This fixed my issue with rebuilding and deploying for a remote host with on latest nixpkgs master and nix 2.16.1. Before applying this path it needed a reboot after every rebuild. Now it just works as usual.

nixos-rebuild switch \
  --flake '/CONFIGPATH/#HOSTNAME' \
  --target-host HOSTNAME

tested with nixosconfig:

  nix.package = pkgs.nixVersions.nix_2_16.overrideDerivation (oldAttrs: {
    patches = [
      (pkgs.fetchpatch {
        url = " https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/8506.patch";
        sha256 = "sha256-fZXbMoDasvhT9qzcizhxwHe/rlFN9kpahywWqxuNEWQ=";
      })
    ];

@domenkozar
Copy link
Member

@roberth wdty?

@roberth roberth merged commit 0e3a7e3 into NixOS:master Jul 18, 2023
@github-actions
Copy link

Backport failed for 2.15-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin 2.15-maintenance
git worktree add -d .worktree/backport-8506-to-2.15-maintenance origin/2.15-maintenance
cd .worktree/backport-8506-to-2.15-maintenance
git checkout -b backport-8506-to-2.15-maintenance
ancref=$(git merge-base 041486b11674e0480ad85f63d262c33a09276ef1 d5e1eb20a2712eb17076c3ca2d30e5ac4a351d00)
git cherry-pick -x $ancref..d5e1eb20a2712eb17076c3ca2d30e5ac4a351d00

@github-actions
Copy link

Successfully created backport PR for 2.16-maintenance:

@github-actions
Copy link

Backport failed for 2.15-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin 2.15-maintenance
git worktree add -d .worktree/backport-8506-to-2.15-maintenance origin/2.15-maintenance
cd .worktree/backport-8506-to-2.15-maintenance
git checkout -b backport-8506-to-2.15-maintenance
ancref=$(git merge-base 041486b11674e0480ad85f63d262c33a09276ef1 d5e1eb20a2712eb17076c3ca2d30e5ac4a351d00)
git cherry-pick -x $ancref..d5e1eb20a2712eb17076c3ca2d30e5ac4a351d00

@github-actions
Copy link

Git push to origin failed for 2.16-maintenance with exitcode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2.15: nix-copy-closure hangs if ControlPath provided for SSH

6 participants