Repository: ruby/setup-msys2-gcc
Pull request #21: Support clangarm64 environment
Author: login: ntkme
Created: 2025-04-19T05:52:30Z | Merged: 2025-04-29T22:44:08Z

This PR is the prerequisite for: https://github.com/ruby/setup-ruby/pull/750

The complication here is that `windows-11-arm` runner does not have msys2 preinstalled, so that we have to create a full msys2 package, instead of the current partial update package.

Following the naming convention of ruby-builder, the partial package is named `msys2-windows-latest`, and the full package is named `msys2-windows-11-arm64`.

Another tricky problem is the chicken and egg problem that this PR depends on updated setup-ruby in order to run ruby script on `windows-11-arm`, while the `setup-ruby` also depends on the artifacts here. So currently this PR is pointing to my fork of setup-ruby, which download msys2 from my fork of setup-msys2-gcc. We can update this later once this is merged and a working build is available in this repo.


Diff:
diff --git a/.github/workflows/windows-build-tools.yml b/.github/workflows/windows-build-tools.yml
index 54367cf..e43486c 100644
--- a/.github/workflows/windows-build-tools.yml
+++ b/.github/workflows/windows-build-tools.yml
@@ -11,35 +11,43 @@ on:
 jobs:
   msys2:
     name: >-
-      msys2 tools
+      ${{ matrix.name }} tools
     #env:
     #  FORCE_UPDATE: true
-    runs-on: windows-2022
+    permissions:
+      contents: write
+    runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: false
+      matrix:
+        include:
+          - { os: windows-2022, ruby: ucrt, name: msys2 }
+          - { os: windows-11-arm, ruby: 3.4, name: msys2-arm64 }
     steps:
       - name: Checkout
         uses: actions/checkout@v4
 
       - name: Copy msys2 files to temp dir
         run:  |
-          $temp = $env:RUNNER_TEMP
-          md $temp\msys64
-          # copy current msys2 to temp folder, needed to determine what files to include
-          # in zip file (only newer files)
-          xcopy C:\msys64 $temp\msys64 /s /q
+          if (Test-Path -LiteralPath C:\msys64 -PathType Container) {
+            $temp = $env:RUNNER_TEMP
+            md $temp\msys64
+            # copy current msys2 to temp folder, needed to determine what files to include
+            # in zip file (only newer files)
+            xcopy C:\msys64 $temp\msys64 /s /q
+          }
         timeout-minutes: 15
 
       - name: Set up Ruby
         uses: ruby/setup-ruby@v1
         with:
-          ruby-version: ucrt
+          ruby-version: ${{ matrix.ruby }}
         timeout-minutes: 7
 
       - name: Update msys2 tools 7z and Upload
-        run:  ruby create_msys2_pkg.rb
+        run:  ruby create_msys2_pkg.rb ${{ matrix.name }}
         env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          GITHUB_TOKEN: ${{ github.token }}
         timeout-minutes: 10
 
   gcc-mingw:
@@ -49,6 +57,8 @@ jobs:
       ${{ matrix.gcc }} gcc
     #env:
     #  FORCE_UPDATE: true
+    permissions:
+      contents: write
     runs-on: windows-2022
     strategy:
       fail-fast: false
@@ -69,16 +79,18 @@ jobs:
       - name: Update ${{ matrix.gcc }} gcc 7z and Upload
         run:  ruby create_gcc_pkg.rb ${{ matrix.gcc }}
         env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          GITHUB_TOKEN: ${{ github.token }}
         timeout-minutes: 13
 
   gcc-ucrt:
     if: ${{ always() }}
-    needs: gcc-mingw
+    needs: msys2
     name: >-
       ${{ matrix.gcc }} gcc
     #env:
     #  FORCE_UPDATE: true
+    permissions:
+      contents: write
     runs-on: windows-2022
     strategy:
       fail-fast: false
@@ -99,6 +111,37 @@ jobs:
       - name: Update ${{ matrix.gcc }} gcc 7z and Upload
         run:  ruby create_gcc_pkg.rb ${{ matrix.gcc }}
         env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          GITHUB_TOKEN: ${{ github.token }}
+        timeout-minutes: 13
+
+  gcc-clangarm64:
+    if: ${{ always() }}
+    needs: msys2
+    name: >-
+      ${{ matrix.gcc }} gcc
+    #env:
+    #  FORCE_UPDATE: true
+    permissions:
+      contents: write
+    runs-on: windows-11-arm
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - { gcc: clangarm64-3.0 , ruby: 3.4 }
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Set up Ruby
+        uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: ${{ matrix.ruby }}
+        timeout-minutes: 7
+
+      - name: Update ${{ matrix.gcc }} gcc 7z and Upload
+        run:  ruby create_gcc_pkg.rb ${{ matrix.gcc }}
+        env:
+          GITHUB_TOKEN: ${{ github.token }}
         timeout-minutes: 13
 
diff --git a/README.md b/README.md
index 2ea9b3c..c111c52 100644
--- a/README.md
+++ b/README.md
@@ -16,25 +16,30 @@ Below summarizes the default MSYS2 installations on Actions Windows images:
 
 | Actions<br/>Image  |  MSYS<br/>Base | MSYS<br/>Build Tools | mingw64<br/>gcc & tools | mingw64<br/>packages | ucrt64<br/>gcc & tools | ucrt64<br/>packages |
 |--------------------|:--------------:|:--------------------:|:-----------------------:|:--------------------:|:----------------------:|:-------------------:|
+| **11-arm**         | No  | No  | No  | No  | No  | No |
 | **2022 and later** | Yes | No  | No  | No  | No  | No |
 | **2016, 2019**     | Yes | Yes | Yes | Some | No  | No  |
 
 ### Notes
 
-Six package files are stored in a GitHub release, and are used by
+Eight package files are stored in a GitHub release, and are used by
 [ruby/setup-ruby](https://github.com/ruby/setup-ruby).  They are:
 
 * **`msys2.7z`** The base msys2 installation on Actions Windows images contains a minimal
 set of bash tools, and no shared build tools.  Code updates the MSYS2 files, and saves only
-updated files to the 7z.  All Ruby Windows releases from version 2.4 and later use these
+updated files to the 7z.  All Ruby Windows x64 releases from version 2.4 and later use these
 tools.
 
+* **`msys2-arm64.7z`** The base msys2 installation on Actions Windows images contains a minimal
+set of bash tools, and no shared build tools.  Code saves complate base MSYS2 files to the 7z.
+All Ruby Windows arm64 releases from version 3.4 and later use these tools.
+
 * **`mingw64.7z`** This contains the mingw64 gcc chain and any packages needed to build
 Ruby.  This has OpenSSL 1.1.1 installed, as of 26-Apr-2024, 1.1.1.w.  Normal Ruby Windows
 releases from version 2.4 thru 3.0 use these tools.
 
 * **`mingw64-3.0.7z`** This contains the mingw64 gcc chain and any packages needed to build
-Ruby.  The MSYS2 OpenSSL 3.3.z package is installed.  The mingw Ruby master build is the
+Ruby.  The MSYS2 OpenSSL 3.y.z package is installed.  The mingw Ruby master build is the
 only build that uses this.
 
 * **`ucrt64.7z`** This contains the ucrt64 gcc chain and any packages needed to build
@@ -42,7 +47,11 @@ Ruby.  This has OpenSSL 1.1.1 installed, as of 26-Apr-2024, 1.1.1.w.  Ruby versi
 the only release that uses this.
 
 * **`ucrt64-3.0.7z`** This contains the ucrt64 gcc chain and any packages needed to build
-Ruby. The MSYS2 OpenSSL 3.3.z package is installed.  Ruby 3.2, head, & ucrt builds use this.
+Ruby. The MSYS2 OpenSSL 3.y.z package is installed.  Ruby 3.2, head, & ucrt builds use this.
+
+* **`clangarm64-3.0.7z`** This contains the clangarm64 gcc chain and any packages needed to build
+Ruby. The MSYS2 OpenSSL 3.y.z package is installed.  Ruby 3.4 and head builds on windows arm64
+use this.
 
 * **`mswin.7z`** This contains files needed to compile Windows Ruby mswin builds. It contains
 libffi, libyaml, openssl, readline, and zlib, built with the Microsoft vcpkg system.  This
diff --git a/common.rb b/common.rb
index a4a0c50..3729f3c 100644
--- a/common.rb
+++ b/common.rb
@@ -34,16 +34,9 @@ module Common
   PACMAN     = 'C:/msys64/usr/bin/pacman.exe'
   BASH       = 'C:/msys64/usr/bin/bash.exe'
 
-  SSL_3_SAVE_FILES = %w[
-    bin/libcrypto-3-x64.dll
-    bin/libssl-3-x64.dll
-    etc/ssl/openssl.cnf
-  ]
-
   def gh_api_graphql(http, query)
     body = {}
     body["query"] = query
-    response = nil
 
     req = Net::HTTP::Post.new '/gh_api_graphql'
     req['Authorization'] = "Bearer #{TOKEN}"
@@ -315,12 +308,12 @@ def refresh_keys
     system 'taskkill /f /fi "MODULES eq msys-2.0.dll"'
 
     STDOUT.syswrite "#{str}\n#{END_GROUP}"
-    
+
     str.match?(/new signatures:|signatures cleaned:/) ? true : nil
   end
 
   def pacman_syuu(ignore = nil)
-    
+
     usr_bin = "#{MSYS2_ROOT}/usr/bin"
 
     exit 1 unless system "#{usr_bin}/sed -i 's/^CheckSpace/#CheckSpace/g' C:/msys64/etc/pacman.conf"
diff --git a/create_gcc_pkg.rb b/create_gcc_pkg.rb
index 5c82c11..52e701a 100644
--- a/create_gcc_pkg.rb
+++ b/create_gcc_pkg.rb
@@ -38,14 +38,26 @@ class << self
         ['mingw64', 'mingw-w64-x86_64-']
       when 'mingw32'
         ['mingw32', 'mingw-w64-i686-']
+      when 'clangarm64'
+        ['clangarm64', 'mingw-w64-clang-aarch64-']
       else
-        STDOUT.syswrite "Invalid package type, must be ucrt64, mingw64, or mingw32\n"
+        STDOUT.syswrite "Invalid package type, must be ucrt64, mingw64, mingw32, or clangarm64\n"
         exit 1
       end
 
     MSYS2_PKG = "#{MSYS2_ROOT}/#{PKG_DIR}"
-    
-    SSL_1_DLLS = %w[bin/libcrypto-1_1-x64.dll bin/libssl-1_1-x64.dll]
+
+    SSL_1_DLLS = if PKG_DIR == 'clangarm64'
+                   %w[bin/libcrypto-1_1.dll bin/libssl-1_1.dll]
+                 else
+                   %w[bin/libcrypto-1_1-x64.dll bin/libssl-1_1-x64.dll]
+                 end
+
+    SSL_3_SAVE_FILES = if PKG_DIR == 'clangarm64'
+                         %w[bin/libcrypto-3.dll bin/libssl-3.dll etc/ssl/openssl.cnf]
+                       else
+                         %w[bin/libcrypto-3-x64.dll bin/libssl-3-x64.dll etc/ssl/openssl.cnf]
+                       end
 
     def add_ri2_key
       # appveyor ri2 package signing key
@@ -85,11 +97,9 @@ def openssl_upgrade
       pkg_name = "openssl-3.0.7-1-any.pkg.tar.zst"
       pkg = "https://github.com/oneclick/rubyinstaller2-packages/releases/download/ci.ri2/#{PKG_PRE}#{pkg_name}"
       pkg_sig = "#{pkg}.sig"
-      old_dlls = %w[libcrypto-1_1-x64.dll libssl-1_1-x64.dll]
-      dll_root = "#{MSYS2_ROOT}/#{PKG_DIR}/bin"
 
       # save previous dll files so we can copy back into folder
-      old_dlls.each { |fn| FileUtils.cp "#{dll_root}/#{fn}", "." }
+      SSL_1_DLLS.each { |fn| FileUtils.cp "#{MSYS2_PKG}/#{fn}", "." }
 
       download pkg    , "./#{PKG_PRE}#{pkg_name}"
       download pkg_sig, "./#{PKG_PRE}#{pkg_name}.sig"
@@ -98,11 +108,7 @@ def openssl_upgrade
       exec_check "Install OpenSSL Upgrade", "pacman.exe -Udd --noconfirm --noprogressbar #{PKG_PRE}#{pkg_name}"
 
       # copy previous dlls back into MSYS2 folder
-      old_dlls.each do |fn|
-        unless File.exist? "#{dll_root}/#{fn}"
-          FileUtils.cp fn , "#{dll_root}/#{fn}"
-        end
-      end
+      SSL_1_DLLS.each { |fn| FileUtils.cp_r File.basename(fn) , "#{MSYS2_PKG}/#{fn}" }
     end
 
     # Below files are part of the 'ca-certificates' package, they are not
@@ -142,7 +148,7 @@ def install_gcc
       # Note that OpenSSL may need to be ignored
       if PKG_NAME.end_with?('-3.0')
         pacman_syuu
-     else
+      else
         pacman_syuu
       end
 
@@ -241,6 +247,10 @@ def run
         STDOUT.syswrite "\n#{GRN}** Creating and Uploading #{PKG_DIR} gcc tools 7z **#{RST}\n\n"
       end
 
+      exec_check "Remove all uninstalled packages" , "#{BASH} -c \"paccache -r -f -u -k0\""
+      exec_check "Keep the newest for all other packages" , "#{BASH} -c \"paccache -r -f -k1\""
+      exec_check "Remove all cached packages" , "#{PACMAN} -Scc --noconfirm"
+
       copy_to_temp
 
       clean_package
diff --git a/create_mswin_pkg.rb b/create_mswin_pkg.rb
index 8c08e0d..eed7e4d 100644
--- a/create_mswin_pkg.rb
+++ b/create_mswin_pkg.rb
@@ -60,7 +60,7 @@ def generate_package_files
       Dir.chdir VCPKG do |d|
 
         install_info = %x(./vcpkg install  #{PACKAGES} --triplet=x64-windows --dry-run)
-        
+
         installed_packages = install_info.include?('The following packages will be built and installed')
 
         exec_check "Installing #{PACKAGES}",
@@ -101,7 +101,7 @@ def generate_package_files
 
     def run
       generate_package_files
-      
+
       copy_ssl_files
 
       # create 7z archive file
diff --git a/create_msys2_pkg.rb b/create_msys2_pkg.rb
index 2afcb5e..98b42fc 100644
--- a/create_msys2_pkg.rb
+++ b/create_msys2_pkg.rb
@@ -21,8 +21,22 @@ class << self
     LOCAL = 'var/lib/pacman/local'
     CACHE = 'var/cache/pacman/pkg'
 
-    MSYS2_PKG = RUBY_PLATFORM.include?('ucrt') ?
-      "#{MSYS2_ROOT}/ucrt64" : "#{MSYS2_ROOT}/mingw64"
+    MSYS2_PKG = case RUBY_PLATFORM
+                when 'aarch64-mingw-ucrt'
+                  "#{MSYS2_ROOT}/clangarm64"
+                when /ucrt$/
+                  "#{MSYS2_ROOT}/ucrt64"
+                else
+                  "#{MSYS2_ROOT}/mingw64"
+                end
+
+    PKG_NAME = ARGV[0].downcase
+
+    SSL_3_SAVE_FILES = %w[
+      bin/libcrypto-3-x64.dll
+      bin/libssl-3-x64.dll
+      etc/ssl/openssl.cnf
+    ]
 
     def update_msys2
 
@@ -101,8 +115,6 @@ def run
 
       log_array_2_column updated_pkgs, 48, "Installed MSYS2 Packages"
 
-      gpg_files = Dir["#{MSYS2_ROOT}/etc/pacman.d/gnupg/*"].count { |fn| File.file? fn }
-
       if current_pkgs == updated_pkgs && !updated_keys && !ENV.key?('FORCE_UPDATE')
         STDOUT.syswrite "\n** No update to MSYS2 tools needed **\n\n"
         exit 0
@@ -110,20 +122,24 @@ def run
         STDOUT.syswrite "\n#{GRN}** Creating and Uploading MSYS update 7z **#{RST}\n\n"
       end
 
+      exec_check "Remove all uninstalled packages" , "#{BASH} -c \"paccache -r -f -u -k0\""
+      exec_check "Keep the newest for all other packages" , "#{BASH} -c \"paccache -r -f -k1\""
+      exec_check "Remove all cached packages" , "#{PACMAN} -Scc --noconfirm"
+
       remove_non_msys2
-      remove_duplicate_files
+      remove_duplicate_files if File.exist?(ORIG_MSYS2)
       clean_database 'msys'
       clean_packages
 
       # create 7z file
       STDOUT.syswrite "##[group]#{YEL}Create msys2 7z file#{RST}\n"
-      tar_path = "#{Dir.pwd}\\msys2.7z".gsub '/', '\\'
+      tar_path = "#{Dir.pwd}\\#{PKG_NAME}.7z".gsub '/', '\\'
       Dir.chdir MSYS2_ROOT do
         exit 1 unless system "\"#{SEVEN}\" a #{tar_path}"
       end
       STDOUT.syswrite "##[endgroup]\n"
 
-      upload_7z_update 'msys2', time
+      upload_7z_update PKG_NAME, time
     end
   end
 end


Reviews:
user: login: ntkme
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-24T20:30:05Z
user: login: ntkme
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-24T20:41:41Z

Review comments:
diff_hunk: @@ -11,35 +11,67 @@ on:
 jobs:
   msys2:
     name: >-
-      msys2 tools
+      ${{ matrix.os }} msys2 tools
     #env:
     #  FORCE_UPDATE: true
-    runs-on: windows-2022
+    permissions:
+      contents: write
path: .github/workflows/windows-build-tools.yml
user: login: ntkme
body: GitHub now blocks user from adding new secret starting with `GITHUB` in name, which is a pain for me to test in my fork. Switch to custom `permission` +  `github.token` allows me to run this on my fork more easily without adding a secret `GITHUB_TOKEN`. Also note that even if the write permission is requested, it will not be granted to PRs (similar to how secret works), so there isn't a security concern.
created_at: 2025-04-24T20:30:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -11,35 +11,67 @@ on:
 jobs:
   msys2:
     name: >-
-      msys2 tools
+      ${{ matrix.os }} msys2 tools
     #env:
     #  FORCE_UPDATE: true
-    runs-on: windows-2022
+    permissions:
+      contents: write
+    runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: false
+      matrix:
+        include:
+          - { os: windows-2022, ruby: ucrt, type: ucrt64, windows-toolchain: default }
+          - { os: windows-11-arm, ruby: 3.4, type: clangarm64, windows-toolchain: none }
     steps:
       - name: Checkout
         uses: actions/checkout@v4
 
+      - name: Set platform
+        id:   platform
+        run:  |
+          platform=${{ matrix.os }}
+          platform=${platform/windows-2022/windows-latest}
+          platform=${platform/windows-11-arm/windows-arm64}
+          echo "platform=$platform" >> $GITHUB_OUTPUT
+        shell: bash
+
       - name: Copy msys2 files to temp dir
+        if: matrix.windows-toolchain == 'default'
         run:  |
           $temp = $env:RUNNER_TEMP
           md $temp\msys64
           # copy current msys2 to temp folder, needed to determine what files to include
           # in zip file (only newer files)
           xcopy C:\msys64 $temp\msys64 /s /q
+
+      - name: Install msys2
+        if: matrix.windows-toolchain == 'none'
+        run:  |
+          (New-Object System.Net.WebClient).DownloadFile("https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe", "msys2-x86_64-latest.sfx.exe")
+          (New-Object System.Net.WebClient).DownloadFile("https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig", "msys2-x86_64-latest.sfx.exe.sig")
+          gpg --keyserver keyserver.ubuntu.com --recv "0EBF 782C 5D53 F7E5 FB02  A667 46BD 761F 7A49 B0EC"
+          gpg --verify msys2-x86_64-latest.sfx.exe.sig
+
+          .\msys2-x86_64-latest.sfx.exe -y -oC:\
+
+          C:\msys64\msys2_shell.cmd -defterm -here -no-start -${{ matrix.type }}
path: .github/workflows/windows-build-tools.yml
user: login: ntkme
body: There is a bug in the GUI installer currently:https://github.com/msys2/msys2-installer/issues/96
It is why this PR uses the sfx installer and `msys2_shell.cmd` to initialize the setup.
created_at: 2025-04-24T20:41:41Z
author_association: CONTRIBUTOR

PR comments:
user: login: MSP-Greg
created_at: 2025-04-24T19:30:15Z
body: @eregon

Actually, looking at it right now...
author_association: COLLABORATOR
user: login: MSP-Greg
created_at: 2025-04-25T00:05:23Z
body: @ntkme

Thanks for your work on this.  Currently I only have x64 locally, so this is very helpful.

One thing is the renaming of some of the 7z files.  I think the MSYS2 files are:
```
msys2-windows-11-arm64.7z
msys2-windows-arm64.7z
msys2-windows-latest.7z
```

Maybe we could keep `msys2.7z` as the x64 name, and use `msys2-arm64.7z` for arm64?

JFYI, I'm looking at pulling PR's from both repos and generating the arm64 files here...
author_association: COLLABORATOR
user: login: ntkme
created_at: 2025-04-25T00:27:44Z
body: > Maybe we could keep msys2.7z as the x64 name, and use msys2-arm64.7z for arm64?

That's definitely an option. Honestly I don't have a personal preference here, I was trying to keep the naming conversion aligned with packages in ruby-builder.
author_association: CONTRIBUTOR
user: login: MSP-Greg
created_at: 2025-04-25T01:49:34Z
body: I have no idea if the 7z files created here are used anywhere else (besides setup-ruby).  Also, most people would hopefully know that mingw & msys2 are windows specific build tools.

I've got a question that you may know the answer to.  On x64, we've got both msys2/mingw based builds (mingw or ucrt) and an mswin (MSVC) build.  Given that vcpkg is installed on the arm64 runner, can an arm64 Ruby be built using MSVC?
author_association: COLLABORATOR
user: login: ntkme
created_at: 2025-04-25T01:55:40Z
body: > Given that vcpkg is installed on the arm64 runner, can an arm64 Ruby be built using MSVC?

The answer in theory is yes, but I don’t think anyone has attempted. There might be issues with build scripts that need to be fixed.
author_association: CONTRIBUTOR
user: login: ntkme
created_at: 2025-04-25T11:10:04Z
body: Updated the PR with `msys2.7z` and `msys2-arm64.7z` package names as suggested.
author_association: CONTRIBUTOR
user: login: eregon
created_at: 2025-04-25T14:02:09Z
body: > Given that vcpkg is installed on the arm64 runner, can an arm64 Ruby be built using MSVC?

FWIW I saw https://bugs.ruby-lang.org/issues/21277 today on this topic
author_association: MEMBER
user: login: MSP-Greg
created_at: 2025-04-25T14:17:17Z
body: @eregon

Thanks.

Certainly won't happen today, but I hope to get head builds in ruby-loco for arm64 mswin & ucrt...
author_association: COLLABORATOR
user: login: MSP-Greg
created_at: 2025-04-26T14:15:30Z
body: @ntkme

Again, thanks for your work on this.

Now that the 7z files exist and setup-ruby works, I'm wondering about one issue.

Currently, the 7z files are only replaced if there has been an update.  IOW, we'd prefer to not update the files in the release if nothing has changed.  I need to review the code more, things like the below.  Should `windows-toolchain: none` be removed?
```
- { os: windows-11-arm, ruby: 3.4, name: msys2-arm64, type: clangarm64, windows-toolchain: none }
```

I'm not sure, and I may not have a lot of time for OSS this weekend...
author_association: COLLABORATOR
user: login: ntkme
created_at: 2025-04-26T16:47:52Z
body: @MSP-Greg Added a new commit `Remove code used for bootstrap msys2-arm64`. It should achieve what you're asking for.
author_association: CONTRIBUTOR
user: login: ntkme
created_at: 2025-04-29T22:58:04Z
body: @MSP-Greg Looks like the downgrade gcc step is failing on clangarm64, working on a fix right now.
author_association: CONTRIBUTOR
user: login: MSP-Greg
created_at: 2025-04-29T23:01:18Z
body: Sorry, I didn't think that would be an issue.  Do I need to add the packages to the release?
author_association: COLLABORATOR
user: login: ntkme
created_at: 2025-04-29T23:06:47Z
body: "gcc" on clangarm64 is just a wrapper script that make clang to accept gcc style parameters... So you cannot "downgrade gcc" on clangarm64 to begin with. - This step should simply be skipped on clangarm64 - Or, if we want to lock the clang version, we need to upload a backup of specific version of gcc-compact and related clang packages:

https://packages.msys2.org/packages/mingw-w64-clang-aarch64-gcc
https://packages.msys2.org/packages/mingw-w64-clang-aarch64-gcc-compat
https://packages.msys2.org/packages/mingw-w64-clang-aarch64-clang
https://packages.msys2.org/packages/mingw-w64-clang-aarch64-clang-libs
https://packages.msys2.org/packages/mingw-w64-clang-aarch64-compiler-rt
https://packages.msys2.org/packages/mingw-w64-clang-aarch64-lld
https://packages.msys2.org/packages/mingw-w64-clang-aarch64-llvm
author_association: CONTRIBUTOR
user: login: MSP-Greg
created_at: 2025-04-29T23:12:21Z
body: So we should skip the downgrade?

JFYI, this is the first time we've had a gcc issue, and this code has been in existence since GitHub Actions was in beta.
author_association: COLLABORATOR
user: login: ntkme
created_at: 2025-04-29T23:13:49Z
body: > So we should skip the downgrade?

Depends on whether we prefer to lock down compiler version or to receive upgrade when available. If we prefer upgrade, then just skip the downgrade, and we can always add a locked version later if upgrade run into problem.
author_association: CONTRIBUTOR
user: login: MSP-Greg
created_at: 2025-04-29T23:34:32Z
body: Got a fix running in my fork...
author_association: COLLABORATOR
user: login: ntkme
created_at: 2025-04-29T23:40:43Z
body: @MSP-Greg I have https://github.com/ruby/setup-msys2-gcc/pull/23 ready for view - this skip the downgrade of clang right now, but make it super easy to add clang downgrade if we ever need it later. 
author_association: CONTRIBUTOR