Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ build:mingw64:
before_script:

Copy link
Copy Markdown

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):

On Sat, Sep 19, 2026 at 12:12:12PM +0000, Johannes Schindelin via GitGitGadget wrote:
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index cd6fd4a504..3f24835500 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -133,8 +133,11 @@ build:mingw64:
>    before_script:
>      - *windows_before_script
>      - ./ci/install-sdk.ps1 -directory "git-sdk"
> +    - ./ci/install-dependencies.ps1 -Mingw

I wonder whether it would now make sense to also hoist "install-sdk.ps1"
into "install-dependencies.ps1" now.

>    script:
> -    - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
> +    # The minimal SDK's profile resets PATH.
> +    - git-sdk/usr/bin/bash.exe -l -c
> +        'PATH=$PATH:/c/Rust/bin ci/make-test-artifacts.sh artifacts'

Are we sure that PATH cannot ever contain spaces or should we rather
quote here?

Patrick

Copy link
Copy Markdown

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):

Hi Patrick,

On Thu, 24 Sep 2026, Patrick Steinhardt wrote:

> On Sat, Sep 19, 2026 at 12:12:12PM +0000, Johannes Schindelin via GitGitGadget wrote:
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index cd6fd4a504..3f24835500 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -133,8 +133,11 @@ build:mingw64:
> >    before_script:
> >      - *windows_before_script
> >      - ./ci/install-sdk.ps1 -directory "git-sdk"
> > +    - ./ci/install-dependencies.ps1 -Mingw
> 
> I wonder whether it would now make sense to also hoist "install-sdk.ps1"
> into "install-dependencies.ps1" now.

Honestly, I wouldn't. It is conceptually a different thing, the SDK brings
a ready-configured environment (which _partially_ ships dependencies,
that's right, but it's a Venn diagram, not a strict super set
relationship).

> >    script:
> > -    - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
> > +    # The minimal SDK's profile resets PATH.
> > +    - git-sdk/usr/bin/bash.exe -l -c
> > +        'PATH=$PATH:/c/Rust/bin ci/make-test-artifacts.sh artifacts'
> 
> Are we sure that PATH cannot ever contain spaces or should we rather
> quote here?

Ah, quoting in shell, what a wonderfully magical world. While you would be
correct that passing an unquoted `$PATH` as an _argument_ would cause
unwanted misinterpretation as multiple arguments instead of a single one,
_assigning variables_ is a completely different issue. Observe:

  $ x="Patrick Steinhardt"; x=$x=hello env | grep ^x=
  x=Patrick Steinhardt=hello

Wha...? It did _not_ split the $x at whitespace? No. In what must have
occurred as quite logical to the inventors of the Unix shell syntax,
interpolating unquoted variables in assignments does *not* split at
whitespace, unlike in other instances where unquoted variables are very
much split at whitespace.

Ciao,
Johannes

- *windows_before_script
- ./ci/install-sdk.ps1 -directory "git-sdk"
- ./ci/install-dependencies.ps1 -Mingw
script:
- git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
# The minimal SDK's profile resets PATH.
- git-sdk/usr/bin/bash.exe -l -c
'PATH=$PATH:/c/Rust/bin ci/make-test-artifacts.sh artifacts'
artifacts:
paths:
- artifacts
Expand Down
22 changes: 16 additions & 6 deletions ci/install-dependencies.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
param(

Copy link
Copy Markdown

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):

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.

Patrick

Copy link
Copy Markdown

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):

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'
Expand All @@ -11,7 +12,9 @@ $RustVersion = '1.96.0'

Copy link
Copy Markdown

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):

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 {
Expand Down Expand Up @@ -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/" +

Copy link
Copy Markdown

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):

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!

Patrick

Copy link
Copy Markdown

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):

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"
Expand All @@ -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')
Loading