# [PATCH 0/2] Update the win+VS build definition

6 messages from 2024-08-20 to 2024-08-20. Participants: Johannes Schindelin via GitGitGadget, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/61983

## Johannes Schindelin via GitGitGadget, 2024-08-20 14:31

Subject: [PATCH 0/2] Update the win+VS build definition
Message-ID: <pull.1775.git.1724164270.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1775.git.1724164270.gitgitgadget%40gmail.com

```
These two patches have been in Git for Windows' fork for quite a while.

While the win+VS builds are not run in Git's CI builds, it is still a good
idea to upstream these changes.

Johannes Schindelin (2):
  ci: bump microsoft/setup-msbuild from v1 to v2
  ci(win+VS): download the vcpkg artifacts using a dedicated GitHub
    Action

 .github/workflows/main.yml | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)


base-commit: bb9c16bd4f1a9a00799e10c81ee6506cf468c0c7
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1775%2Fdscho%2Fwin%2BVS-updates-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1775/dscho/win+VS-updates-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1775
-- 
gitgitgadget

```

## Johannes Schindelin via GitGitGadget, 2024-08-20 14:31

Subject: [PATCH 1/2] ci: bump microsoft/setup-msbuild from v1 to v2
Message-ID: <51eeafc713ca5a83499ceca3602e77c15dbfcab9.1724164270.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/51eeafc713ca5a83499ceca3602e77c15dbfcab9.1724164270.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1775.git.1724164270.gitgitgadget@gmail.com>

```
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>

The main benefit: The new version uses a node.js version that is not yet
deprecated.

Links:
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1...v2)

This patch was originally by GitHub's Dependabot, but I cannot attribute
that bot properly because it has no dedicated email address. Probably
because it hasn't reached legal age yet, or something.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 13cc0fe8077..85e5767aae6 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -190,7 +190,7 @@ jobs:
         Expand-Archive compat.zip -DestinationPath . -Force
         Remove-Item compat.zip
     - name: add msbuild to PATH
-      uses: microsoft/setup-msbuild@v1
+      uses: microsoft/setup-msbuild@v2
     - name: copy dlls to root
       shell: cmd
       run: compat\vcbuild\vcpkg_copy_dlls.bat release
-- 
gitgitgadget


```

## Johannes Schindelin via GitGitGadget, 2024-08-20 14:31

Subject: [PATCH 2/2] ci(win+VS): download the vcpkg artifacts using a dedicated GitHub Action
Message-ID: <1e2ad9d536e075098edd913b326086a88c69ad4a.1724164270.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/1e2ad9d536e075098edd913b326086a88c69ad4a.1724164270.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1775.git.1724164270.gitgitgadget@gmail.com>

```
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The Git for Windows project provides a GitHub Action to download and
cache Azure Pipelines artifacts (such as the `vcpkg` artifacts), hiding
gnarly internals, and also providing some robustness against network
glitches. Let's use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/main.yml | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 85e5767aae6..1ee0433acc1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -181,14 +181,10 @@ jobs:
         repository: 'microsoft/vcpkg'
         path: 'compat/vcbuild/vcpkg'
     - name: download vcpkg artifacts
-      shell: powershell
-      run: |
-        $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
-        $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
-        $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
-        (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
-        Expand-Archive compat.zip -DestinationPath . -Force
-        Remove-Item compat.zip
+      uses: git-for-windows/get-azure-pipelines-artifact@v0
+      with:
+        repository: git/git
+        definitionId: 9
     - name: add msbuild to PATH
       uses: microsoft/setup-msbuild@v2
     - name: copy dlls to root
-- 
gitgitgadget

```

## Junio C Hamano, 2024-08-20 15:22

Subject: Re: [PATCH 0/2] Update the win+VS build definition
Message-ID: <xmqqv7zvb4mu.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqv7zvb4mu.fsf%40gitster.g
In-Reply-To: <pull.1775.git.1724164270.gitgitgadget@gmail.com>

```
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> These two patches have been in Git for Windows' fork for quite a while.
>
> While the win+VS builds are not run in Git's CI builds, it is still a good
> idea to upstream these changes.
>
> Johannes Schindelin (2):
>   ci: bump microsoft/setup-msbuild from v1 to v2
>   ci(win+VS): download the vcpkg artifacts using a dedicated GitHub
>     Action
>
>  .github/workflows/main.yml | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)

Thanks.  

Do you mind if I applied these directly to 'maint' and merged the
result upwards?

```

## Johannes Schindelin, 2024-08-20 20:15

Subject: Re: [PATCH 0/2] Update the win+VS build definition
Message-ID: <ab765f95-1208-fa77-01a7-2dd4f5eea90d@gmx.de>
URL: https://gitlist.dev/e/ab765f95-1208-fa77-01a7-2dd4f5eea90d%40gmx.de
In-Reply-To: <xmqqv7zvb4mu.fsf@gitster.g>

```
Hi Junio,

On Tue, 20 Aug 2024, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > These two patches have been in Git for Windows' fork for quite a while.
> >
> > While the win+VS builds are not run in Git's CI builds, it is still a good
> > idea to upstream these changes.
> >
> > Johannes Schindelin (2):
> >   ci: bump microsoft/setup-msbuild from v1 to v2
> >   ci(win+VS): download the vcpkg artifacts using a dedicated GitHub
> >     Action
> >
> >  .github/workflows/main.yml | 14 +++++---------
> >  1 file changed, 5 insertions(+), 9 deletions(-)
>
> Thanks.
>
> Do you mind if I applied these directly to 'maint' and merged the
> result upwards?

I concur that this is a good idea.

Thank you,
Johannes

```

## Junio C Hamano, 2024-08-20 20:38

Subject: Re: [PATCH 0/2] Update the win+VS build definition
Message-ID: <xmqq34mz6ibw.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq34mz6ibw.fsf%40gitster.g
In-Reply-To: <ab765f95-1208-fa77-01a7-2dd4f5eea90d@gmx.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> Do you mind if I applied these directly to 'maint' and merged the
>> result upwards?
>
> I concur that this is a good idea.

Will, do.  Thanks.

```
