Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/llvm-15-f…
Browse files Browse the repository at this point in the history
…inal
  • Loading branch information
HertzDevil committed Mar 9, 2023
2 parents 1e0df7d + 374224d commit 9ecaadc
Show file tree
Hide file tree
Showing 468 changed files with 6,226 additions and 2,942 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ parameters:
distribution-scripts-version:
description: "Git ref for version of https://github.com/crystal-lang/distribution-scripts/"
type: string
default: "d8c44c0a2c977bfb90363923047f2c64cef3bf8e"
default: "dd0ef752b995c04b5e3bf80e474881ba107e4476"
previous_crystal_base_url:
description: "Prefix for URLs to Crystal bootstrap compiler"
type: string
default: "https://github.com/crystal-lang/crystal/releases/download/1.7.0/crystal-1.7.0-1"
default: "https://github.com/crystal-lang/crystal/releases/download/1.7.2/crystal-1.7.2-1"

defaults:
environment: &env
Expand All @@ -19,7 +19,9 @@ defaults:
- run: bin/ci prepare_system
- run: echo 'export CURRENT_TAG="$CIRCLE_TAG"' >> $BASH_ENV
- run: bin/ci prepare_build
- run: bin/ci build
- run:
command: bin/ci build
no_output_timeout: 30m
- run:
when: always
command: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Run stdlib specs
uses: docker://jhass/crystal:1.0.0-alpine-build
with:
args: make std_spec
args: make std_spec FLAGS=-Duse_pcre
aarch64-musl-test-compiler:
needs: aarch64-musl-build
runs-on: [linux, ARM64]
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
crystal_bootstrap_version: [1.2.2, 1.3.2, 1.4.1, 1.5.1, 1.6.2, 1.7.0]
crystal_bootstrap_version: [1.2.2, 1.3.2, 1.4.1, 1.5.1, 1.6.2]
flags: ["USE_PCRE1=true"]
include:
# libffi is only available starting from the 1.2.2 build images
- crystal_bootstrap_version: 1.0.0
flags: -Dwithout_ffi
flags: "FLAGS=-Dwithout_ffi USE_PCRE1=true"
- crystal_bootstrap_version: 1.1.1
flags: -Dwithout_ffi
flags: "FLAGS=-Dwithout_ffi USE_PCRE1=true"
- crystal_bootstrap_version: 1.7.2
flags: ""
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -33,7 +36,7 @@ jobs:
run: bin/ci prepare_build

- name: Test
run: FLAGS=${{ matrix.flags }} bin/ci build
run: ${{ matrix.flags }} bin/ci build

x86_64-musl-test:
env:
Expand Down Expand Up @@ -63,13 +66,13 @@ jobs:
include:
- llvm_version: 13.0.0
llvm_url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
base_image: ubuntu-20.04
base_image: ubuntu-22.04
- llvm_version: 14.0.0
llvm_url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
base_image: ubuntu-18.04
base_image: ubuntu-22.04
- llvm_version: 15.0.6
llvm_url: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
base_image: ubuntu-18.04
base_image: ubuntu-22.04
runs-on: ${{ matrix.base_image }}
name: "Test LLVM ${{ matrix.llvm_version }} (${{ matrix.base_image }})"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Download Crystal source
uses: actions/checkout@v3

- uses: cachix/install-nix-action@v18
- uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.9.2/install
extra_nix_config: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
openssl3:
runs-on: ubuntu-latest
name: "OpenSSL 3.0"
container: crystallang/crystal:1.7.0-alpine
container: crystallang/crystal:1.7.2-alpine
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -23,7 +23,7 @@ jobs:
openssl111:
runs-on: ubuntu-latest
name: "OpenSSL 1.1.1"
container: crystallang/crystal:1.7.0-alpine
container: crystallang/crystal:1.7.2-alpine
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -36,7 +36,7 @@ jobs:
libressl34:
runs-on: ubuntu-latest
name: "LibreSSL 3.4"
container: crystallang/crystal:1.7.0-alpine
container: crystallang/crystal:1.7.2-alpine
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/regex-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
pcre:
runs-on: ubuntu-latest
name: "PCRE"
container: crystallang/crystal:1.7.0-alpine
container: crystallang/crystal:1.7.2-alpine
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -17,15 +17,15 @@ jobs:
pcre2:
runs-on: ubuntu-latest
name: "PCRE2"
container: crystallang/crystal:1.7.0-alpine
container: crystallang/crystal:1.7.2-alpine
steps:
- name: Download Crystal source
uses: actions/checkout@v3
- name: Install PCRE2
run: apk add pcre2-dev
- name: Assert using PCRE2
run: bin/crystal eval -Duse_pcre2 'abort unless Regex::Engine == Regex::PCRE2'
run: bin/crystal eval 'abort unless Regex::Engine == Regex::PCRE2'
- name: Assert select PCRE
run: bin/crystal eval -Duse_pcre 'abort unless Regex::Engine == Regex::PCRE'
- name: Run Regex specs
run: bin/crystal spec -Duse_pcre2 --order=random spec/std/regex*
run: bin/crystal spec --order=random spec/std/regex*
3 changes: 3 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
#
# ```terminal-session
# $ find src/lib_c -maxdepth 1 -mindepth 1 -type d -printf '%P\n' | sort
# aarch64-android
# aarch64-darwin
# aarch64-linux-gnu
# aarch64-linux-musl
# arm-linux-gnueabihf
# i386-linux-gnu
# i386-linux-musl
# wasm32-wasi
# x86_64-darwin
# x86_64-dragonfly
# x86_64-freebsd
Expand Down Expand Up @@ -43,6 +45,7 @@ jobs:
fail-fast: false
matrix:
target:
- aarch64-linux-android
- aarch64-darwin
- arm-linux-gnueabihf
- i386-linux-gnu
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wasm32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
jobs:
wasm32-test:
runs-on: ubuntu-latest
container: crystallang/crystal:1.7.0-build
container: crystallang/crystal:1.7.2-build
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -30,8 +30,8 @@ jobs:
- name: Download wasm32 libs
run: |
mkdir wasm32-wasi-libs
curl -LO https://github.com/lbguilherme/wasm-libs/releases/download/0.0.2/wasm32-wasi-libs.tar.gz
echo "114dd08b776c92e15b4ec83178fa486dc436e24b7f662c3241a8cdf2506fe426 wasm32-wasi-libs.tar.gz" | sha256sum -c -
curl -LO https://github.com/lbguilherme/wasm-libs/releases/download/0.0.3/wasm32-wasi-libs.tar.gz
echo "cd36f319f8f9f9cd08f723d10e6ec2b92f2e44d3ce3b20344b8041386d85c261 wasm32-wasi-libs.tar.gz" | sha256sum -c -
tar -f wasm32-wasi-libs.tar.gz -C wasm32-wasi-libs -xz
rm wasm32-wasi-libs.tar.gz
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
x86_64-linux-job:
runs-on: ubuntu-latest
container: crystallang/crystal:1.7.0-build
container: crystallang/crystal:1.7.2-build
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -15,7 +15,7 @@ jobs:
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
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
Expand All @@ -31,7 +31,7 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d # v1.12.0
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1

- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -42,6 +42,7 @@ jobs:
with:
path: | # openssl and llvm take much longer to build so they are cached separately
libs/pcre.lib
libs/pcre2-8.lib
libs/iconv.lib
libs/gc.lib
libs/ffi.lib
Expand Down Expand Up @@ -310,7 +311,7 @@ jobs:
if: steps.cache-llvm.outputs.cache-hit != 'true'
working-directory: ./llvm-src
run: |
cmake . -Thost=x64 -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_USE_CRT_RELEASE=MT -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF
cmake . -Thost=x64 -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DLLVM_USE_CRT_RELEASE=MT -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF
cmake --build . --config Release
- name: Gather LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
Expand All @@ -332,7 +333,7 @@ jobs:
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\pcre.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"
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/
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# 1.7.2 (2023-01-23)
## Standard Library

### Runtime

- Fix: Add `Nil` return type restrictions to `load_debug_info` ([#12992](https://github.com/crystal-lang/crystal/pull/12992), thanks @straight-shoota)

## Compiler

### Codegen

- Add error handling to compiler when linker is unavailable ([#12899](https://github.com/crystal-lang/crystal/pull/12899), thanks @straight-shoota)

### Parser

- Revert "Parser: Fix restrict grammar for name and supertype in type def (#12622)" ([#12977](https://github.com/crystal-lang/crystal/pull/12977), thanks @straight-shoota)

## Other

- Update `VERSION` to `1.7.2-dev` ([#12993](https://github.com/crystal-lang/crystal/pull/12993), thanks @straight-shoota)

# 1.7.1 (2023-01-17)

## Tools

### Playground

- Fix baked-in path in playground to resolve at runtime ([#12948](https://github.com/crystal-lang/crystal/pull/12948), thanks @straight-shoota)

## Other

- Update `VERSION` to 1.7.1-dev ([#12950](https://github.com/crystal-lang/crystal/pull/12950), thanks @straight-shoota)

# 1.7.0 (2023-01-09)

## Language
Expand Down
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
## Build the compiler
## $ make
## Build the compiler with progress output
## $ make progress=true
## $ make progress=1
## Clean up built files then build the compiler
## $ make clean crystal
## Build the compiler in release mode
## $ make crystal release=1
## Run all specs in verbose mode
## $ make spec verbose=1
## $ make crystal release=1 interpreter=1
## Run tests
## $ make test
## Run stdlib tests
## $ make std_spec
## Run compiler tests
## $ make compiler_spec

CRYSTAL ?= crystal ## which previous crystal compiler use
LLVM_CONFIG ?= ## llvm-config command path to use
Expand Down Expand Up @@ -80,9 +84,11 @@ check_llvm_config = $(eval \
.PHONY: all
all: crystal ## Build all files (currently crystal only) [default]

.PHONY: test
test: spec ## Run tests

.PHONY: spec
spec: $(O)/all_spec ## Run all specs
$(O)/all_spec $(SPEC_FLAGS)
spec: std_spec primitives_spec compiler_spec

.PHONY: std_spec
std_spec: $(O)/std_spec ## Run standard library specs
Expand All @@ -100,6 +106,10 @@ primitives_spec: $(O)/primitives_spec ## Run primitives specs
smoke_test: ## Build specs as a smoke test
smoke_test: $(O)/std_spec $(O)/compiler_spec $(O)/crystal

.PHONY: all_spec
all_spec: $(O)/all_spec ## Run all specs (note: this builds a huge program; `test` recipe builds individual binaries and is recommended for reduced resource usage)
$(O)/all_spec $(SPEC_FLAGS)

.PHONY: samples
samples: ## Build example programs
$(MAKE) -C samples
Expand All @@ -118,7 +128,7 @@ llvm_ext: $(LLVM_EXT_OBJ)

.PHONY: format
format: ## Format sources
./bin/crystal tool format$(if $(check), --check) src spec samples
./bin/crystal tool format$(if $(check), --check) src spec samples scripts

.PHONY: install
install: $(O)/crystal man/crystal.1.gz ## Install the compiler at DESTDIR
Expand Down Expand Up @@ -178,7 +188,7 @@ $(O)/std_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES)
$(O)/compiler_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES)
$(call check_llvm_config)
@mkdir -p $(O)
$(EXPORT_CC) $(EXPORTS) ./bin/crystal build $(FLAGS) $(SPEC_WARNINGS_OFF) -o $@ spec/compiler_spec.cr
$(EXPORT_CC) $(EXPORTS) ./bin/crystal build $(FLAGS) $(SPEC_WARNINGS_OFF) -o $@ spec/compiler_spec.cr --release

$(O)/primitives_spec: $(O)/crystal $(DEPS) $(SOURCES) $(SPEC_SOURCES)
@mkdir -p $(O)
Expand All @@ -187,7 +197,9 @@ $(O)/primitives_spec: $(O)/crystal $(DEPS) $(SOURCES) $(SPEC_SOURCES)
$(O)/crystal: $(DEPS) $(SOURCES)
$(call check_llvm_config)
@mkdir -p $(O)
$(EXPORTS) $(EXPORTS_BUILD) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib
# NOTE: USE_PCRE1 is only used for testing compatibility with legacy environments that don't provide libpcre2.
# Newly built compilers should never be distributed with libpcre to ensure syntax consistency.
$(EXPORTS) $(EXPORTS_BUILD) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib $(if $(USE_PCRE1),-D use_pcre,-D use_pcre2)

$(LLVM_EXT_OBJ): $(LLVM_EXT_DIR)/llvm_ext.cc
$(call check_llvm_config)
Expand Down
Loading

0 comments on commit 9ecaadc

Please sign in to comment.