Skip to content

Commit

Permalink
Replace the interpreter with an LLVM compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickpeterse committed May 11, 2023
1 parent 77a83c7 commit c44dfa9
Show file tree
Hide file tree
Showing 285 changed files with 30,546 additions and 30,518 deletions.
8 changes: 7 additions & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))']
rustflags = ['-C', 'target-feature=+aes']
rustflags = ['-C', 'target-feature=+aes', '-C', 'force-unwind-tables']

# This is needed for stack traces to work when `panic=abort` is used. See
# https://github.com/rust-lang/rust/issues/94815 and
# https://github.com/rust-lang/backtrace-rs/issues/397 for more details.
[build]
rustflags = ['-C', 'force-unwind-tables']
34 changes: 21 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'compiler/**'
- 'inko/**'
- 'ipm/**'
- 'libstd/**'
- 'std/**'
- 'types/**'
- 'vm/**'
- 'Cargo.*'
Expand All @@ -22,7 +22,9 @@ on:
workflow_dispatch:

env:
CARGO_HOME: ${{ github.workspace }}/.cargo
# This directory must be named differently from `.cargo`, otherwise it will
# conflict with our local Cargo configuration.
CARGO_HOME: ${{ github.workspace }}/.cargo-home
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

Expand All @@ -40,15 +42,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.62
- uses: dtolnay/rust-toolchain@1.63
with:
components: 'clippy'
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cargo
${{ env.CARGO_HOME }}
target
key: ${{ runner.os }}
- name: Install LLVM
run: bash scripts/llvm.sh
- run: 'cargo clippy -- -D warnings'

cargo-fmt:
Expand All @@ -61,7 +65,7 @@ jobs:
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cargo
${{ env.CARGO_HOME }}
target
key: ${{ runner.os }}
- run: 'cargo fmt --all --check'
Expand All @@ -78,13 +82,13 @@ jobs:

compiler:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
version:
- '1.62'
- '1.63'
- stable
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -95,37 +99,41 @@ jobs:
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cargo
${{ env.CARGO_HOME }}
target
key: ${{ runner.os }}-stable
- name: Install LLVM
run: bash scripts/llvm.sh
- name: Running tests
run: cargo test

std:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
needs:
- compiler
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.62
- uses: dtolnay/rust-toolchain@1.63
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cargo
${{ env.CARGO_HOME }}
target
key: ${{ runner.os }}-stable
- name: Install LLVM
run: bash scripts/llvm.sh
- name: Compiling
run: cargo build --release
- name: Running tests
run: |
cd libstd
cargo run --release -p inko -- test
cd std
../target/release/inko test
nightly-container:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
*.egg-info/
__pycache__
/docs/plugins/pygments-inko-lexer/poetry.lock
/build
/std/build
Loading

0 comments on commit c44dfa9

Please sign in to comment.