From 96cb42861c8d3beb58ee5c4adb48b3a9244cbb14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 21 Mar 2023 13:15:15 +0100 Subject: [PATCH 1/3] [CI] Remove cross-compiliation on Windows --- .github/workflows/win.yml | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 649af6315e1e..21d7ff6bcc98 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -7,28 +7,7 @@ concurrency: cancel-in-progress: true jobs: - x86_64-linux-job: - runs-on: ubuntu-latest - container: crystallang/crystal:1.7.2-build - steps: - - name: Download Crystal source - uses: actions/checkout@v3 - - - name: Build C extensions - run: | - make deps - - name: Cross-compile Crystal - run: | - LLVM_TARGETS=X86 bin/crystal build --cross-compile --target x86_64-pc-windows-msvc src/compiler/crystal.cr -Dwithout_playground -Dwithout_iconv -Dwithout_interpreter -Duse_pcre2 - - - name: Upload Crystal object file - uses: actions/upload-artifact@v3 - with: - name: objs - path: crystal.obj - - x86_64-windows-job: - needs: x86_64-linux-job + x86_64-windows: runs-on: windows-2022 steps: - name: Disable CRLF line ending substitution @@ -37,6 +16,11 @@ jobs: - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1 + - name: Install Crystal + uses: crystal-lang/install-crystal@v1 + with: + crystal: "1.7.3" + - name: Download Crystal source uses: actions/checkout@v3 @@ -329,19 +313,10 @@ jobs: echo "CRYSTAL_SPEC_COMPILER_BIN=$(pwd)\.build\crystal.exe" >> ${env:GITHUB_ENV} echo "LLVM_CONFIG=$(pwd)\llvm\bin\llvm-config.exe" >> ${env:GITHUB_ENV} - - name: Download Crystal object file - uses: actions/download-artifact@v3 - with: - name: objs - name: Build LLVM extensions run: make -f Makefile.win deps - - name: Link Crystal executable - run: | - Invoke-Expression "cl crystal.obj /Fecrystal src\llvm\ext\llvm_ext.obj $(llvm\bin\llvm-config.exe --libs) libs\pcre2-8.lib libs\gc.lib WS2_32.lib advapi32.lib libcmt.lib dbghelp.lib ole32.lib shell32.lib legacy_stdio_definitions.lib /link /LIBPATH:$(pwd)\libs /STACK:0x800000 /ENTRY:wmainCRTStartup" - mkdir .build - mv crystal.exe .build/ - - name: Re-build Crystal + - name: Build Crystal run: | bin/crystal.bat env make -f Makefile.win -B From 176b94ef93ae41749384da4afada77e3b12580f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 21 Mar 2023 17:51:48 +0100 Subject: [PATCH 2/3] Add sed command to `scripts/release-update.sh` --- scripts/release-update.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/release-update.sh b/scripts/release-update.sh index afb59c7d5455..ec9c9570636c 100755 --- a/scripts/release-update.sh +++ b/scripts/release-update.sh @@ -26,6 +26,9 @@ sed -i -E "s|crystal-[0-9.]+-[0-9]|crystal-$CRYSTAL_VERSION-1|g" bin/ci sed -i -E "/crystal_bootstrap_version:/ s/(, ${CRYSTAL_VERSION%.*}\.[0-9]*)?\]\$/, $CRYSTAL_VERSION]/" .github/workflows/linux.yml sed -i -E "s|crystallang/crystal:[0-9.]+|crystallang/crystal:$CRYSTAL_VERSION|g" .github/workflows/*.yml +# Edit .github/workflows/*.yml to update version for install-crystal action +sed -i -E "s|crystal: \"[0-9.]+\"|crystal: \"$CRYSTAL_VERSION\"|g" .github/workflows/*.yml + # Edit shell.nix latestCrystalBinary using nix-prefetch-url --unpack darwin_url="https://github.com/crystal-lang/crystal/releases/download/$CRYSTAL_VERSION/crystal-$CRYSTAL_VERSION-1-darwin-universal.tar.gz" darwin_sha=$(nix-prefetch-url --unpack $darwin_url) From 80cecdad16ed6e01d5892e8828f0382736a91755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 22 Mar 2023 15:23:35 +0100 Subject: [PATCH 3/3] Fix botched merge commit --- .github/workflows/win.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 674a3d1d28fc..21d7ff6bcc98 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -7,28 +7,7 @@ concurrency: cancel-in-progress: true jobs: - x86_64-linux-job: - runs-on: ubuntu-latest - container: crystallang/crystal:1.7.3-build - steps: - - name: Download Crystal source - uses: actions/checkout@v3 - - - name: Build C extensions - run: | - make deps - - name: Cross-compile Crystal - run: | - LLVM_TARGETS=X86 bin/crystal build --cross-compile --target x86_64-pc-windows-msvc src/compiler/crystal.cr -Dwithout_playground -Dwithout_iconv -Dwithout_interpreter -Duse_pcre2 - - - name: Upload Crystal object file - uses: actions/upload-artifact@v3 - with: - name: objs - path: crystal.obj - - x86_64-windows-job: - needs: x86_64-linux-job + x86_64-windows: runs-on: windows-2022 steps: - name: Disable CRLF line ending substitution