You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Pkg.add HTTPS fails with OS Error 'Paramètre incorrect' (failed to convert string to wide form) on Windows with French Locale
Environment:
Julia Version: 1.11.4
Commit 8561cc3d68 (2025-03-10 11:36 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 20 × 13th Gen Intel(R) Core(TM) i7-13700H
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, goldmont)
Threads: 20 default, 0 interactive, 10 GC (on 20 virtual cores)
Environment:
JULIA_NUM_THREADS = (8, 1)
JULIA_SSL_CA_ROOTS_PATH =
Pkg Version: v1.11.0
Operating System: Windows 10 Pro (64-bit)
Windows Display Language/Locale: French (France)
Problem Description:
When trying to add a private package hosted on a private GitLab instance using its HTTPS URL via Pkg.add(url="..."), the operation fails consistently with an operating system error related to string conversion: failed to convert string to wide form: Paramètre incorrect.. This occurs using the default Pkg/LibGit2 pathway.
Steps to Reproduce:
The use of a private server makes exact reproduction difficult for others, but here are the steps:
Have access to a private repository on a GitLab instance requiring authentication (e.g., GitLab Enterprise). Let's call the host <private-gitlab-hostname> and the repo <group>/<project>.git.
On a Windows 10 machine configured with French locale/language settings, install Julia (e.g., 1.11.4).
Install Git for Windows and configure the credential manager: git config --global credential.helper manager.
Ensure credentials for the GitLab instance are cached (e.g., by successfully running git clone https://<private-gitlab-hostname>/<group>/<project>.git once from Git Bash).
In Julia, attempt to add the private package using its HTTPS URL (ensure ENV["JULIA_PKG_USE_CLI_GIT"] is not set or is false):
using Pkg
pkg_url ="https://<private-gitlab-hostname>/<group>/<project>.git"
Pkg.add(url=pkg_url)
Observed Behavior:
The Pkg.add command fails during the Updating git-repo or Cloning git-repo phase with the following error and stack trace:
This error occurs consistently, even when the credential manager is properly configured and has cached credentials. The credential manager prompt is never reached. Further investigation suggests the failure might originate specifically within the libgit2 C function git_utf8_to_16_alloc, aligning with the "failed to convert string to wide form" error message.
Expected Behavior:
Pkg.add should successfully clone/fetch the repository using the cached credentials from the Git Credential Manager, mirroring the behavior of command-line Git. It should not fail with the OS-level Paramètre incorrect error during the HTTPS fetch/clone operation.
Workarounds and Contrasting Behavior (Evidence that the core issue is likely within Pkg/LibGit2):
Command-line git clone https://.../ works perfectly using the exact same URL (https://<private-gitlab-hostname>/<group>/<project>.git) and successfully uses the Git Credential Manager without error.
Setting the environment variable ENV["JULIA_PKG_USE_CLI_GIT"]=true makes Pkg.add(url="https://.../") work correctly within Julia. This forces Pkg to use the external git.exe and successfully bypasses the error.
Other tools (like VS Code extensions) interacting with the same repository over HTTPS also work correctly on the same machine.
Additional Context:
The error message Paramètre incorrect. is the French translation for "Invalid parameter." This might suggest the issue is related to how LibGit2 interacts with Windows APIs concerning string handling or parameters (specifically UTF-8 to UTF-16 conversion via git_utf8_to_16_alloc), potentially influenced by the system's locale settings, when establishing the HTTPS connection to this specific server type.
Request:
Could this potential issue within Pkg/LibGit2.jl on Windows with non-English locales be investigated? Relying on the JULIA_PKG_USE_CLI_GIT workaround requires installing command-line Git, which negates some of the benefits of Julia's self-contained package management for end-users.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Title: Pkg.add HTTPS fails with OS Error 'Paramètre incorrect' (failed to convert string to wide form) on Windows with French Locale
Environment:
Commit 8561cc3d68 (2025-03-10 11:36 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 20 × 13th Gen Intel(R) Core(TM) i7-13700H
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, goldmont)
Threads: 20 default, 0 interactive, 10 GC (on 20 virtual cores)
Environment:
JULIA_NUM_THREADS = (8, 1)
JULIA_SSL_CA_ROOTS_PATH =
Problem Description:
When trying to add a private package hosted on a private GitLab instance using its HTTPS URL via
Pkg.add(url="...")
, the operation fails consistently with an operating system error related to string conversion:failed to convert string to wide form: Paramètre incorrect.
. This occurs using the default Pkg/LibGit2 pathway.Steps to Reproduce:
The use of a private server makes exact reproduction difficult for others, but here are the steps:
<private-gitlab-hostname>
and the repo<group>/<project>.git
.git config --global credential.helper manager
.git clone https://<private-gitlab-hostname>/<group>/<project>.git
once from Git Bash).ENV["JULIA_PKG_USE_CLI_GIT"]
is not set or isfalse
):Observed Behavior:
The
Pkg.add
command fails during theUpdating git-repo
orCloning git-repo
phase with the following error and stack trace:This error occurs consistently, even when the credential manager is properly configured and has cached credentials. The credential manager prompt is never reached. Further investigation suggests the failure might originate specifically within the
libgit2
C functiongit_utf8_to_16_alloc
, aligning with the "failed to convert string to wide form" error message.Expected Behavior:
Pkg.add
should successfully clone/fetch the repository using the cached credentials from the Git Credential Manager, mirroring the behavior of command-line Git. It should not fail with the OS-levelParamètre incorrect
error during the HTTPS fetch/clone operation.Workarounds and Contrasting Behavior (Evidence that the core issue is likely within Pkg/LibGit2):
git clone https://...
/ works perfectly using the exact same URL (https://<private-gitlab-hostname>/<group>/<project>.git
) and successfully uses the Git Credential Manager without error.ENV["JULIA_PKG_USE_CLI_GIT"]=true
makesPkg.add(url="https://.../")
work correctly within Julia. This forces Pkg to use the externalgit.exe
and successfully bypasses the error.Additional Context:
The error message
Paramètre incorrect.
is the French translation for "Invalid parameter." This might suggest the issue is related to howLibGit2
interacts with Windows APIs concerning string handling or parameters (specifically UTF-8 to UTF-16 conversion viagit_utf8_to_16_alloc
), potentially influenced by the system's locale settings, when establishing the HTTPS connection to this specific server type.Request:
Could this potential issue within
Pkg
/LibGit2.jl
on Windows with non-English locales be investigated? Relying on theJULIA_PKG_USE_CLI_GIT
workaround requires installing command-line Git, which negates some of the benefits of Julia's self-contained package management for end-users.The text was updated successfully, but these errors were encountered: