Skip to content

Commit

Permalink
Merge branch 'master' into changelog/1.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Sep 19, 2024
2 parents 05adb04 + edfe1f4 commit 20ec402
Show file tree
Hide file tree
Showing 110 changed files with 1,818 additions and 706 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ concurrency:

jobs:
aarch64-musl-build:
runs-on: [linux, ARM64]
runs-on: [runs-on, runner=2cpu-linux-arm64, "run-id=${{ github.run_id }}"]
if: github.repository == 'crystal-lang/crystal'
steps:
- name: Download Crystal source
uses: actions/checkout@v4
- name: Build Crystal
uses: docker://jhass/crystal:1.0.0-alpine-build
uses: docker://crystallang/crystal:1.13.2-alpine-84codes-build
with:
args: make crystal
- name: Upload Crystal executable
Expand All @@ -26,7 +26,7 @@ jobs:
src/llvm/ext/llvm_ext.o
aarch64-musl-test-stdlib:
needs: aarch64-musl-build
runs-on: [linux, ARM64]
runs-on: [runs-on, runner=4cpu-linux-arm64, "family=m7g", ram=16, "run-id=${{ github.run_id }}"]
if: github.repository == 'crystal-lang/crystal'
steps:
- name: Download Crystal source
Expand All @@ -38,12 +38,12 @@ jobs:
- name: Mark downloaded compiler as executable
run: chmod +x .build/crystal
- name: Run stdlib specs
uses: docker://jhass/crystal:1.0.0-alpine-build
uses: docker://crystallang/crystal:1.13.2-alpine-84codes-build
with:
args: make std_spec FLAGS=-Duse_pcre
args: make std_spec
aarch64-musl-test-compiler:
needs: aarch64-musl-build
runs-on: [linux, ARM64]
runs-on: [runs-on, runner=4cpu-linux-arm64, "family=m7g", ram=16, "run-id=${{ github.run_id }}"]
if: github.repository == 'crystal-lang/crystal'
steps:
- name: Download Crystal source
Expand All @@ -55,17 +55,17 @@ jobs:
- name: Mark downloaded compiler as executable
run: chmod +x .build/crystal
- name: Run compiler specs
uses: docker://jhass/crystal:1.0.0-alpine-build
uses: docker://crystallang/crystal:1.13.2-alpine-84codes-build
with:
args: make primitives_spec compiler_spec FLAGS=-Dwithout_ffi
aarch64-gnu-build:
runs-on: [linux, ARM64]
runs-on: [runs-on, runner=2cpu-linux-arm64, "run-id=${{ github.run_id }}"]
if: github.repository == 'crystal-lang/crystal'
steps:
- name: Download Crystal source
uses: actions/checkout@v4
- name: Build Crystal
uses: docker://jhass/crystal:1.0.0-build
uses: docker://crystallang/crystal:1.13.2-ubuntu-84codes-build
with:
args: make crystal
- name: Upload Crystal executable
Expand All @@ -77,7 +77,7 @@ jobs:
src/llvm/ext/llvm_ext.o
aarch64-gnu-test-stdlib:
needs: aarch64-gnu-build
runs-on: [linux, ARM64]
runs-on: [runs-on, runner=4cpu-linux-arm64, "family=m7g", ram=16, "run-id=${{ github.run_id }}"]
if: github.repository == 'crystal-lang/crystal'
steps:
- name: Download Crystal source
Expand All @@ -89,12 +89,12 @@ jobs:
- name: Mark downloaded compiler as executable
run: chmod +x .build/crystal
- name: Run stdlib specs
uses: docker://jhass/crystal:1.0.0-build
uses: docker://crystallang/crystal:1.13.2-ubuntu-84codes-build
with:
args: make std_spec
aarch64-gnu-test-compiler:
needs: aarch64-gnu-build
runs-on: [linux, ARM64]
runs-on: [runs-on, runner=4cpu-linux-arm64, "family=m7g", ram=16, "run-id=${{ github.run_id }}"]
if: github.repository == 'crystal-lang/crystal'
steps:
- name: Download Crystal source
Expand All @@ -106,6 +106,6 @@ jobs:
- name: Mark downloaded compiler as executable
run: chmod +x .build/crystal
- name: Run compiler specs
uses: docker://jhass/crystal:1.0.0-build
uses: docker://crystallang/crystal:1.13.2-ubuntu-84codes-build
with:
args: make primitives_spec compiler_spec
70 changes: 56 additions & 14 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

env:
SPEC_SPLIT_DOTS: 160
CI_LLVM_VERSION: "18.1.1"

jobs:
Expand All @@ -20,6 +21,13 @@ jobs:
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Set up Cygwin
uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4
with:
packages: make
install-dir: C:\cygwin64
add-to-path: false

- name: Download Crystal source
uses: actions/checkout@v4

Expand Down Expand Up @@ -49,7 +57,7 @@ jobs:
run: .\etc\win-ci\build-pcre2.ps1 -BuildTree deps\pcre2 -Version 10.43
- name: Build libiconv
if: steps.cache-libs.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Version 1.17
- name: Build libffi
if: steps.cache-libs.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-ffi.ps1 -BuildTree deps\ffi -Version 3.3
Expand Down Expand Up @@ -92,6 +100,13 @@ jobs:
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Set up Cygwin
uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4
with:
packages: make
install-dir: C:\cygwin64
add-to-path: false

- name: Download Crystal source
uses: actions/checkout@v4

Expand All @@ -111,7 +126,7 @@ jobs:
libs/xml2-dynamic.lib
dlls/pcre.dll
dlls/pcre2-8.dll
dlls/libiconv.dll
dlls/iconv-2.dll
dlls/gc.dll
dlls/libffi.dll
dlls/zlib1.dll
Expand All @@ -130,7 +145,7 @@ jobs:
run: .\etc\win-ci\build-pcre2.ps1 -BuildTree deps\pcre2 -Version 10.43 -Dynamic
- name: Build libiconv
if: steps.cache-dlls.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Dynamic
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Version 1.17 -Dynamic
- name: Build libffi
if: steps.cache-dlls.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-ffi.ps1 -BuildTree deps\ffi -Version 3.3 -Dynamic
Expand Down Expand Up @@ -213,16 +228,16 @@ jobs:
if: steps.cache-llvm-dlls.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-llvm.ps1 -BuildTree deps\llvm -Version ${{ env.CI_LLVM_VERSION }} -TargetsToBuild X86,AArch64 -Dynamic

x86_64-windows:
x86_64-windows-release:
needs: [x86_64-windows-libs, x86_64-windows-dlls, x86_64-windows-llvm-libs, x86_64-windows-llvm-dlls]
uses: ./.github/workflows/win_build_portable.yml
with:
release: false
release: true
llvm_version: "18.1.1"

x86_64-windows-test:
runs-on: windows-2022
needs: [x86_64-windows]
needs: [x86_64-windows-release]
steps:
- name: Disable CRLF line ending substitution
run: |
Expand All @@ -237,7 +252,7 @@ jobs:
- name: Download Crystal executable
uses: actions/download-artifact@v4
with:
name: crystal
name: crystal-release
path: build

- name: Restore LLVM
Expand Down Expand Up @@ -265,13 +280,40 @@ jobs:
- name: Build samples
run: make -f Makefile.win samples

x86_64-windows-release:
if: github.repository_owner == 'crystal-lang' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/ci/'))
needs: [x86_64-windows-libs, x86_64-windows-dlls, x86_64-windows-llvm-libs, x86_64-windows-llvm-dlls]
uses: ./.github/workflows/win_build_portable.yml
with:
release: true
llvm_version: "18.1.1"
x86_64-windows-test-interpreter:
runs-on: windows-2022
needs: [x86_64-windows-release]
steps:
- name: Disable CRLF line ending substitution
run: |
git config --global core.autocrlf false
- name: Download Crystal source
uses: actions/checkout@v4

- name: Download Crystal executable
uses: actions/download-artifact@v4
with:
name: crystal-release
path: build

- name: Restore LLVM
uses: actions/cache/restore@v4
with:
path: llvm
key: llvm-libs-${{ env.CI_LLVM_VERSION }}-msvc
fail-on-cache-miss: true

- name: Set up environment
run: |
Add-Content $env:GITHUB_PATH "$(pwd)\build"
Add-Content $env:GITHUB_ENV "CRYSTAL_SPEC_COMPILER_BIN=$(pwd)\build\crystal.exe"
- name: Run stdlib specs with interpreter
run: bin\crystal i spec\std_spec.cr

- name: Run primitives specs with interpreter
run: bin\crystal i spec\primitives_spec.cr

x86_64-windows-installer:
if: github.repository_owner == 'crystal-lang' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/ci/'))
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/win_build_portable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
id: install-crystal
with:
crystal: "1.13.2"

Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
libs/xml2-dynamic.lib
dlls/pcre.dll
dlls/pcre2-8.dll
dlls/libiconv.dll
dlls/iconv-2.dll
dlls/gc.dll
dlls/libffi.dll
dlls/zlib1.dll
Expand Down Expand Up @@ -107,14 +108,18 @@ jobs:
run: |
echo "CRYSTAL_LIBRARY_PATH=$(pwd)\libs" >> ${env:GITHUB_ENV}
echo "LLVM_CONFIG=$(pwd)\llvm\bin\llvm-config.exe" >> ${env:GITHUB_ENV}
# NOTE: the name of the libiconv DLL has changed, so we manually copy
# the new one to the existing Crystal installation; remove after
# updating the base compiler to 1.14
cp dlls/iconv-2.dll ${{ steps.install-crystal.outputs.path }}
- name: Build LLVM extensions
run: make -f Makefile.win deps

- name: Build Crystal
run: |
bin/crystal.bat env
make -f Makefile.win -B ${{ inputs.release && 'release=1' || '' }}
make -f Makefile.win -B ${{ inputs.release && 'release=1' || '' }} interpreter=1
- name: Download shards release
uses: actions/checkout@v4
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,30 @@ _Freeze period starts on 2024-09-25_
[#15002]: https://github.com/crystal-lang/crystal/pull/15002
[#14748]: https://github.com/crystal-lang/crystal/pull/14748

## [1.13.3] (2024-09-18)

[1.13.3]: https://github.com/crystal-lang/crystal/releases/1.13.3

### Bugfixes

#### stdlib

- **[regression]** Fix use global paths in macro bodies ([#14965], thanks @straight-shoota)
- *(system)* **[regression]** Fix `Process.exec` stream redirection on Windows ([#14986], thanks @HertzDevil)
- *(text)* **[regression]** Fix `String#index` and `#rindex` for `Char::REPLACEMENT` ([#14937], thanks @HertzDevil)

[#14965]: https://github.com/crystal-lang/crystal/pull/14965
[#14986]: https://github.com/crystal-lang/crystal/pull/14986
[#14937]: https://github.com/crystal-lang/crystal/pull/14937

### Infrastructure

- Changelog for 1.13.3 ([#14991], thanks @straight-shoota)
- *(ci)* Enable runners from `runs-on.com` for Aarch64 CI ([#15007], thanks @straight-shoota)

[#14991]: https://github.com/crystal-lang/crystal/pull/14991
[#15007]: https://github.com/crystal-lang/crystal/pull/15007

## [1.13.2] (2024-08-20)

[1.13.2]: https://github.com/crystal-lang/crystal/releases/1.13.2
Expand Down
47 changes: 10 additions & 37 deletions etc/win-ci/build-iconv.ps1
Original file line number Diff line number Diff line change
@@ -1,56 +1,29 @@
param(
[Parameter(Mandatory)] [string] $BuildTree,
[Parameter(Mandatory)] [string] $Version,
[switch] $Dynamic
)

. "$(Split-Path -Parent $MyInvocation.MyCommand.Path)\setup.ps1"

[void](New-Item -Name (Split-Path -Parent $BuildTree) -ItemType Directory -Force)
Setup-Git -Path $BuildTree -Url https://github.com/pffang/libiconv-for-Windows.git -Ref 1353455a6c4e15c9db6865fd9c2bf7203b59c0ec # master@{2022-10-11}
Invoke-WebRequest "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${Version}.tar.gz" -OutFile libiconv.tar.gz
tar -xzf libiconv.tar.gz
mv libiconv-* $BuildTree
rm libiconv.tar.gz

Run-InDirectory $BuildTree {
Replace-Text libiconv\include\iconv.h '__declspec (dllimport) ' ''

echo '<Project>
<PropertyGroup>
<ForceImportAfterCppTargets>$(MsbuildThisFileDirectory)\Override.props</ForceImportAfterCppTargets>
</PropertyGroup>
</Project>' > 'Directory.Build.props'

echo "<Project>
<PropertyGroup>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<DebugInformationFormat>None</DebugInformationFormat>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition=`"'`$(Configuration)'=='Release'`">
<ClCompile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
</Project>" > 'Override.props'

if ($Dynamic) {
MSBuild.exe /p:Platform=x64 /p:Configuration=Release libiconv.vcxproj
} else {
MSBuild.exe /p:Platform=x64 /p:Configuration=ReleaseStatic libiconv.vcxproj
}
$env:CHERE_INVOKING = 1
& 'C:\cygwin64\bin\bash.exe' --login "$PSScriptRoot\cygwin-build-iconv.sh" "$Version" "$(if ($Dynamic) { 1 })"
if (-not $?) {
Write-Host "Error: Failed to build libiconv" -ForegroundColor Red
Exit 1
}
}

if ($Dynamic) {
mv -Force $BuildTree\output\x64\Release\libiconv.lib libs\iconv-dynamic.lib
mv -Force $BuildTree\output\x64\Release\libiconv.dll dlls\
mv -Force $BuildTree\iconv\lib\iconv.dll.lib libs\iconv-dynamic.lib
mv -Force $BuildTree\iconv\bin\iconv-2.dll dlls\
} else {
mv -Force $BuildTree\output\x64\ReleaseStatic\libiconvStatic.lib libs\iconv.lib
mv -Force $BuildTree\iconv\lib\iconv.lib libs\
}
Loading

0 comments on commit 20ec402

Please sign in to comment.