glandium / git-cinnabar

git remote helper to interact with mercurial repositories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default GIT_SSH should be C:\windows\system32\OpenSSH\ssh.exe if no GIT_SSH env

makotokato opened this issue · comments

When using git-cinnabar with ssh, we have to set GIT_SSH on Windows.

But the latest Windows 10 may install OpenSSH in C:\windows\system32\OpenSSH, so I guess that it is better to set this default ssh.exe if no GIT_SSH environment variable and OpenSSH for Windows is available.

Do you have mercurial installed, or are you using the experimental native mercurial wire support? If the former, is mercurial able to access ssh repos without you setting ui.ssh? If the latter, is git able to access ssh repos without you setting GIT_SSH?

I use Python3's mercurial, so I use experimental native support.

Can you set GIT_TRACE=1 in the environment, set git config cinnabar.check helper, and try whatever command you were using that needs ssh, without GIT_SSH being set, and paste the output?

./mach try log.

16:05:57.469369 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:05:57.469369 git.c:447               trace: built-in: git add 'c:\Development\gecko\try_task_config.json'
16:05:58.318313 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:05:58.333933 git.c:734               trace: exec: git-cinnabar --version
16:05:58.333933 run-command.c:667       trace: run_command: git-cinnabar --version
16:05:58.986084 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
16:05:58.989086 git.c:447               trace: built-in: git config cinnabar.experiments
16:05:59.609255 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
16:05:59.612237 git.c:447               trace: built-in: git config -l -z
16:06:00.894483 exec-cmd.c:238          trace: resolved executable dir: c:/Users/makoto/.mozbuild/git-cinnabar
16:06:00.895488 exec-cmd.c:54           RUNTIME_PREFIX requested, but prefix computation failed.  Using static fallback 'C:/Users/task_160919462850477/msys64/usr'.
16:06:00.897520 ./run-command.c:664     trace: run_command: GIT_EDITOR=echo git config --system -e
16:06:01.080483 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:06:01.085489 git.c:447               trace: built-in: git commit --allow-empty -m 'Try Chooser Enhanced (16 tasks selected)

Pushed via `mach try chooser`'
16:06:03.023047 run-command.c:667       trace: run_command: git maintenance run --auto --no-quiet
16:06:03.084062 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
16:06:03.094060 git.c:447               trace: built-in: git maintenance run --auto --no-quiet
16:06:03.267052 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:06:03.272050 git.c:447               trace: built-in: git push hg::ssh://hg.mozilla.org/try +HEAD:refs/heads/branches/default/tip
16:06:03.277049 run-command.c:667       trace: run_command: GIT_DIR=.git git remote-hg hg::ssh://hg.mozilla.org/try ssh://hg.mozilla.org/try
16:06:03.300061 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
16:06:03.303049 git.c:734               trace: exec: git-remote-hg hg::ssh://hg.mozilla.org/try ssh://hg.mozilla.org/try
16:06:03.303049 run-command.c:667       trace: run_command: git-remote-hg hg::ssh://hg.mozilla.org/try ssh://hg.mozilla.org/try
16:06:03.478048 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
16:06:03.481050 git.c:447               trace: built-in: git config cinnabar.experiments
16:06:03.897259 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
16:06:03.902257 git.c:447               trace: built-in: git config -l -z
16:06:05.145902 exec-cmd.c:238          trace: resolved executable dir: c:/Users/makoto/.mozbuild/git-cinnabar
16:06:05.146901 exec-cmd.c:54           RUNTIME_PREFIX requested, but prefix computation failed.  Using static fallback 'C:/Users/task_160919462850477/msys64/usr'.
16:06:05.148035 ./run-command.c:664     trace: run_command: GIT_EDITOR=echo git config --system -e
remote: m_kato@ga2.so-net.ne.jp@hg.mozilla.org: Permission denied (publickey).
ERROR unknown url type: ssh
Run the command again with `git -c cinnabar.check=traceback <command>` to see the full traceback.
pack_report: getpagesize()            =      65536
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit      = 35184372088832
pack_report: pack_used_ctr            =         11
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =   15228105 /   15228105
16:06:07.776338 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:06:07.776338 git.c:447               trace: built-in: git reset 'HEAD~'
16:06:09.084386 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:06:09.084386 git.c:447               trace: built-in: git log --name-only --diff-filter=ADM --oneline --pretty=format: HEAD --not --remotes
16:06:09.153512 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
16:06:09.153512 git.c:447               trace: built-in: git diff --name-only --diff-filter=ADM
Error running mach:

    ['try', 'chooser']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file try| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

subprocess.CalledProcessError: Command '('c:\\Program Files\\Git\\bin\\git.EXE', 'push', 'hg::ssh://hg.mozilla.org/try', '+HEAD:refs/heads/branches/default/tip')' returned non-zero exit status 128.

  File "c:\Development\gecko\tools/tryselect/mach_commands.py", line 354, in try_chooser
    return self.run(**kwargs)
  File "c:\Development\gecko\tools/tryselect/mach_commands.py", line 197, in run
    return mod.run(**kwargs)
  File "c:\Development\gecko\tools\tryselect\selectors\chooser\__init__.py", line 95, in run
    closed_tree=closed_tree,
  File "c:\Development\gecko\tools\tryselect\push.py", line 213, in push_to_try
    vcs.push_to_try(commit_message)
  File "c:\Development\gecko\python/mozversioncontrol\mozversioncontrol\__init__.py", line 645, in push_to_try
    cwd=self.path,
  File "c:\mozilla-build\python3\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)

Of course, If I set GIT_SSH=<ssh path>, no problem.

It also seems you are using mercurial. You can try git config cinnabar.experiments wire.

680bc31 will avoid the fallback that causes the weird part of the error, making it more apparent something else is going on. In your case, I'd expect that would leave you with this error message:

Pushed via `mach try chooser`'
remote: m_kato@ga2.so-net.ne.jp@hg.mozilla.org: Permission denied (publickey).
ERROR no suitable response from remote hg

which would be better than "ERROR unknown url type: ssh".

You'll note that without GIT_SSH, ssh is found. The problem is that its configuration doesn't work for you, and whatever other ssh you gave via GIT_SSH does. Note that per https://github.com/glandium/git-cinnabar/wiki/Windows-Support git puts its ssh first in PATH, and that might be what's not working (plus there are other problems with it if running under mozillabuild).

I don't really want to have a behavior diverging from what git itself does if you use it with ssh urls.