-
Notifications
You must be signed in to change notification settings - Fork 202
gitlab-ci: fix the cargo invocation in the Windows job
#2233
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
base: master
Are you sure you want to change the base?
Changes from all commits
cdf2eff
19a4d93
6703fa0
5310afc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| param( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patrick Steinhardt wrote on the Git mailing list (how to reply to this email): On Sat, Sep 19, 2026 at 12:12:10PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The minimal Git for Windows SDK already supplies Git and GCC. The
> MinGW Makefile build needs the GNU Rust toolchain, not another Git
> installation or Meson.
Huh, what's GNU Rust?
> Let the dependency installer serve this configuration while keeping
> the existing package set for MSVC builds.
Okay. What's implicit here is that we in fact don't use this script at
all at the current point in time for our MinGW build, we rather use the
"install-sdk.ps1" script. I assume it will be wired up in the next step,
so let's read on.
> diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1
> index e3b367fa54..8c68fb0cfc 100755
> --- a/ci/install-dependencies.ps1
> +++ b/ci/install-dependencies.ps1
> @@ -41,6 +42,17 @@ function Invoke-Installer {
> }
> }
>
> +$rustTarget = if ($Mingw) { 'gnu' } else { 'msvc' }
> +$rustMsi = Get-Installer "rust-$rustTarget.msi" (
> + "https://static.rust-lang.org/dist/" +
> + "rust-$RustVersion-x86_64-pc-windows-$rustTarget.msi")
> +Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust',
> + 'ADDLOCAL=Rustc,Cargo,Std', '/quiet', '/norestart')
> +
> +if ($Mingw) {
> + return
> +}
> +
> $gitAssetVersion = $GitVersion -replace '\.windows\.\d+$', ''
> $gitInstaller = Get-Installer "Git-Installer.exe" `
> "https://github.com/git-for-windows/git/releases/download/v$GitVersion/PortableGit-$gitAssetVersion-64-bit.7z.exe"
Okay, so installing Rust is the only thing we will want to do on both
MSVC and MinGW builds.
PatrickThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Johannes Schindelin wrote on the Git mailing list (how to reply to this email): Hi Patrick,
On Thu, 24 Sep 2026, Patrick Steinhardt wrote:
> On Sat, Sep 19, 2026 at 12:12:10PM +0000, Johannes Schindelin via GitGitGadget wrote:
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > The minimal Git for Windows SDK already supplies Git and GCC. The
> > MinGW Makefile build needs the GNU Rust toolchain, not another Git
> > installation or Meson.
>
> Huh, what's GNU Rust?
Sorry, poor wording. I meant the Rust toolchain compatible with GCC (as
opposed to the Rust toolchain producing Visual C-compatible libraries).
Will reword. Using `git history reword`, thank you so much for that!
> > Let the dependency installer serve this configuration while keeping
> > the existing package set for MSVC builds.
>
> Okay. What's implicit here is that we in fact don't use this script at
> all at the current point in time for our MinGW build, we rather use the
> "install-sdk.ps1" script. I assume it will be wired up in the next step,
> so let's read on.
Correct. Will clarify the commit message.
> > diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1
> > index e3b367fa54..8c68fb0cfc 100755
> > --- a/ci/install-dependencies.ps1
> > +++ b/ci/install-dependencies.ps1
> > @@ -41,6 +42,17 @@ function Invoke-Installer {
> > }
> > }
> >
> > +$rustTarget = if ($Mingw) { 'gnu' } else { 'msvc' }
> > +$rustMsi = Get-Installer "rust-$rustTarget.msi" (
> > + "https://static.rust-lang.org/dist/" +
> > + "rust-$RustVersion-x86_64-pc-windows-$rustTarget.msi")
> > +Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust',
> > + 'ADDLOCAL=Rustc,Cargo,Std', '/quiet', '/norestart')
> > +
> > +if ($Mingw) {
> > + return
> > +}
> > +
> > $gitAssetVersion = $GitVersion -replace '\.windows\.\d+$', ''
> > $gitInstaller = Get-Installer "Git-Installer.exe" `
> > "https://github.com/git-for-windows/git/releases/download/v$GitVersion/PortableGit-$gitAssetVersion-64-bit.7z.exe"
>
> Okay, so installing Rust is the only thing we will want to do on both
> MSVC and MinGW builds.
Precisely (or as Claude would say: You're absolutely right!),
Johannes |
||
| [string]$DownloadDirectory = '.dependencies' | ||
| [string]$DownloadDirectory = '.dependencies', | ||
| [switch]$Mingw | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
|
@@ -11,7 +12,9 @@ $RustVersion = '1.96.0' | |
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patrick Steinhardt wrote on the Git mailing list (how to reply to this email): On Sat, Sep 19, 2026 at 12:12:11PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> Creating .git/info/exclude as a file with `New-Item` and `-Force`
> truncates existing contents.
>
> When install-dependencies.ps1 follows install-sdk.ps1, this discards
> the latter's /git-sdk exclusion and causes ci/lib.sh to reject SDK
> files as unignored build artifacts.
Okay, this confirms that it's indeed the plan to start calling this
script for MinGW builds, too.
> diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1
> index 8c68fb0cfc..f6868dc670 100755
> --- a/ci/install-dependencies.ps1
> +++ b/ci/install-dependencies.ps1
> @@ -12,7 +12,9 @@ $RustVersion = '1.96.0'
>
> New-Item -Path $DownloadDirectory -ItemType Directory -Force | Out-Null
> New-Item -Path .git/info -ItemType Directory -Force | Out-Null
> -New-Item -Path .git/info/exclude -ItemType File -Force | Out-Null
> +if (-not (Test-Path .git/info/exclude)) {
> + New-Item -Path .git/info/exclude -ItemType File | Out-Null
> +}
> Add-Content -Path .git/info/exclude -Value "/$DownloadDirectory"
Makes sense.
Patrick |
||
| New-Item -Path $DownloadDirectory -ItemType Directory -Force | Out-Null | ||
| New-Item -Path .git/info -ItemType Directory -Force | Out-Null | ||
| New-Item -Path .git/info/exclude -ItemType File -Force | Out-Null | ||
| if (-not (Test-Path .git/info/exclude)) { | ||
| New-Item -Path .git/info/exclude -ItemType File | Out-Null | ||
| } | ||
| Add-Content -Path .git/info/exclude -Value "/$DownloadDirectory" | ||
|
|
||
| function Get-Installer { | ||
|
|
@@ -41,6 +44,17 @@ function Invoke-Installer { | |
| } | ||
| } | ||
|
|
||
| $rustTarget = if ($Mingw) { 'gnu' } else { 'msvc' } | ||
| $rustMsi = Get-Installer "rust-$rustTarget.msi" ( | ||
| "https://static.rust-lang.org/dist/" + | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patrick Steinhardt wrote on the Git mailing list (how to reply to this email): On Sat, Sep 19, 2026 at 12:12:13PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> GitLab's MinGW job cannot find `x86_64-w64-mingw32-gcc` when linking
> gitcore's build script:
> https://gitlab.com/dscho/git1/-/jobs/16593470275
>
> Although gitcore is a static library, Cargo first links `build.rs`
> as a host executable. We omitted the GNU MSI's `Gcc` feature, which
> supplies the required linker and platform libraries:
> https://github.com/rust-lang/rust/blob/1.96.0/src/etc/installer/msi/rust.wxs
Hm. Does that mean that we now have two versions of GCC available, once
via the MinGW environment and once via Rust?
Thanks!
PatrickThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Johannes Schindelin wrote on the Git mailing list (how to reply to this email): Hi Patrick,
On Thu, 24 Sep 2026, Patrick Steinhardt wrote:
> On Sat, Sep 19, 2026 at 12:12:13PM +0000, Johannes Schindelin via GitGitGadget wrote:
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > GitLab's MinGW job cannot find `x86_64-w64-mingw32-gcc` when linking
> > gitcore's build script:
> > https://gitlab.com/dscho/git1/-/jobs/16593470275
> >
> > Although gitcore is a static library, Cargo first links `build.rs`
> > as a host executable. We omitted the GNU MSI's `Gcc` feature, which
> > supplies the required linker and platform libraries:
> > https://github.com/rust-lang/rust/blob/1.96.0/src/etc/installer/msi/rust.wxs
>
> Hm. Does that mean that we now have two versions of GCC available, once
> via the MinGW environment and once via Rust?
I don't think that Rust produces intermediate C by default, so no, this
would include a second version of GCC. It will just make sure that the
installed Rust version can produce libraries that GCC can link to.
Ciao,
Johannes |
||
| "rust-$RustVersion-x86_64-pc-windows-$rustTarget.msi") | ||
| Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust', | ||
| "ADDLOCAL=Rustc,Cargo,Std$(if ($Mingw) { ',Gcc' })", '/quiet', '/norestart') | ||
|
|
||
| if ($Mingw) { | ||
| return | ||
| } | ||
|
|
||
| $gitAssetVersion = $GitVersion -replace '\.windows\.\d+$', '' | ||
| $gitInstaller = Get-Installer "Git-Installer.exe" ` | ||
| "https://github.com/git-for-windows/git/releases/download/v$GitVersion/PortableGit-$gitAssetVersion-64-bit.7z.exe" | ||
|
|
@@ -49,7 +63,3 @@ Invoke-Installer $gitInstaller @('-y', '-o"C:\Program Files\Git"') | |
| $mesonMsi = Get-Installer "meson.msi" ` | ||
| "https://github.com/mesonbuild/meson/releases/download/$MesonVersion/meson-$MesonVersion-64.msi" | ||
| Invoke-Installer msiexec.exe @('/i', $mesonMsi, 'INSTALLDIR=C:\Meson', '/quiet', '/norestart') | ||
|
|
||
| $rustMsi = Get-Installer "rust.msi" ` | ||
| "https://static.rust-lang.org/dist/rust-$RustVersion-x86_64-pc-windows-msvc.msi" | ||
| Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust', 'ADDLOCAL=Rustc,Cargo,Std', '/quiet', '/norestart') | ||
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.
Patrick Steinhardt wrote on the Git mailing list (how to reply to this email):
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.
Johannes Schindelin wrote on the Git mailing list (how to reply to this email):