fix: force Pkg to use system git on Windows for ct-registry/git-deps - #67
Merged
Conversation
The ssh-agent set up for `Add ct-registry` is only reachable by system git/ssh — that step already succeeds because of it. But Pkg's own git operations after that (re-fetching the registry during instantiate, and cloning any git-sourced dependency such as CTLie) go through Julia's bundled LibGit2 instead, which can't use that same agent on Windows (its named-pipe transport isn't something libssh2 understands there) and fails with "user cancelled credential request". Set JULIA_PKG_USE_CLI_GIT=true on Windows so those operations shell out to the system git that already has working SSH access, instead of LibGit2. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Confirmed on OptimalControl.jl#826 job 90836999549: the previous fix
(setting JULIA_PKG_USE_CLI_GIT=true via GITHUB_ENV) had no effect.
julia-actions/julia-buildpkg@v1's own script unconditionally runs
`ENV["JULIA_PKG_USE_CLI_GIT"] = <git_cli input, default false>` before
Pkg.Registry.add()/Pkg.build(), clobbering whatever was exported before
the step ran. The action does expose a `git_cli` input for exactly this
case ("might be necessary for more complicated SSH setups") — pass it
instead of fighting the action's own default.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Seen on
windows-latestin control-toolbox/OptimalControl.jl#826, job 90833796963:The step-by-step job log shows exactly where this splits:
ssh-agent.exeand talks to it via systemgit/ssh, which is why the existing "Prefer Git's OpenSSH client (Windows)" fix (PR Fix Windows ct-registry: OpenSSH client + cache ordering #66) works for it.Pkg.instantiate/Pkg.buildre-fetches the registry and clones any git-sourced dependency (hereCTLie) through Julia's own bundled LibGit2, not system git. The stacktrace confirms it (LibGit2.CachedCredentials,LibGit2.clone). On Windows, LibGit2's libssh2 can't talk to the ssh-agent the same way system git can (agent transport mismatch), so it falls back to an interactive credential prompt that can never be answered in CI.Same root cause as #66, one layer deeper: that PR fixed the tool (
add-julia-registry's own ssh-agent/ssh-keyscan invocation), this one fixes Pkg itself.Fix
Set
JULIA_PKG_USE_CLI_GIT=trueon Windows (right afterAdd ct-registrysets up the working agent) so Pkg shells out to systemgitfor its own registry/dependency git operations too, instead of using the bundled LibGit2.Test plan
uses: control-toolbox/CTActions/.github/workflows/ci.yml@fix/windows-pkg-cli-git) and confirm the Windows CPU job goes green@mainonce merged🤖 Generated with Claude Code