Skip to content
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

[CI] Remove cross-compiliation on Windows #13207

Merged
merged 4 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
39 changes: 7 additions & 32 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions scripts/release-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <url>
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)
Expand Down