-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add MacOS build scripts under `scripts/` * Renamed Linux Build-and-test workflow * Added MacOS Build-and-test workflow * Updated lit configuration for OS and arch support * Updated expectedly failing tests * Fixed bug in `tests/lit-llvm/option_notarget.calc` * Update license for container files
- Loading branch information
Showing
26 changed files
with
303 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
name: Build-and-test | ||
|
||
on: | ||
|
||
workflow_call: | ||
inputs: | ||
build_mode: | ||
description: Build optimization level | ||
required: true | ||
type: string | ||
distro: | ||
description: OS distribution name | ||
required: true | ||
type: string | ||
os_ver: | ||
description: OS distribution version | ||
required: true | ||
type: string | ||
os: | ||
description: OS string identifier | ||
required: true | ||
type: string | ||
script_type: | ||
description: Script type ("-container" | "-native") | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
|
||
build-and-test: | ||
runs-on: macos-14 | ||
defaults: | ||
run: | ||
working-directory: ${{ github.workspace }} | ||
steps: | ||
|
||
- name: Checkout homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build source and test | ||
run: | | ||
export BUILD_MODE=${{ inputs.build_mode }} | ||
export DISTRO=${{ inputs.distro }} | ||
export OS=${{ inputs.os }} | ||
export OS_VER=${{ inputs.os_ver }} | ||
bash -c "./scripts/build-and-test-macos14-${{ inputs.script_type }}.sh" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
name: MacOS 14 (Container) | ||
|
||
on: | ||
|
||
workflow_dispatch: | ||
branches: [ "main" ] | ||
inputs: | ||
build_mode: | ||
description: Build optimization level | ||
required: true | ||
default: debug | ||
type: choice | ||
options: | ||
- debug | ||
- release | ||
|
||
jobs: | ||
|
||
run: | ||
uses: e3m3/calcc-rust/.github/workflows/build-and-test-macos14.yaml@main | ||
with: | ||
build_mode: ${{ inputs.build_mode }} | ||
distro: fedora | ||
os_ver: 40 | ||
os: fedora-40 | ||
script_type: container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
name: MacOS 14 (Native) | ||
|
||
on: | ||
|
||
workflow_dispatch: | ||
branches: [ "main" ] | ||
inputs: | ||
build_mode: | ||
description: Build optimization level | ||
required: true | ||
default: debug | ||
type: choice | ||
options: | ||
- debug | ||
- release | ||
|
||
jobs: | ||
|
||
run: | ||
uses: e3m3/calcc-rust/.github/workflows/build-and-test-macos14.yaml@main | ||
with: | ||
build_mode: ${{ inputs.build_mode }} | ||
distro: fedora | ||
os_ver: 40 | ||
os: fedora-40 | ||
script_type: native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ Author/Maintainer: Giordano Salvador <[email protected]> | |
[![Ubuntu 22.04](https://github.com/e3m3/calcc-rust/actions/workflows/ubuntu-2204.yaml/badge.svg?event=workflow_dispatch)](https://github.com/e3m3/calcc-rust/actions/workflows/ubuntu-2204.yaml) | ||
[![Ubuntu 24.04](https://github.com/e3m3/calcc-rust/actions/workflows/ubuntu-2404.yaml/badge.svg?event=workflow_dispatch)](https://github.com/e3m3/calcc-rust/actions/workflows/ubuntu-2404.yaml) | ||
[![Fedora 40](https://github.com/e3m3/calcc-rust/actions/workflows/fedora-40.yaml/badge.svg?event=workflow_dispatch)](https://github.com/e3m3/calcc-rust/actions/workflows/fedora-40.yaml) | ||
[![MacOS 14 (Container)](https://github.com/e3m3/calcc-rust/actions/workflows/macos-14-container.yaml/badge.svg?event=workflow_dispatch)](https://github.com/e3m3/calcc-rust/actions/workflows/macos-14-container.yaml) | ||
[![MacOS 14 (Native)](https://github.com/e3m3/calcc-rust/actions/workflows/macos-14-native.yaml/badge.svg?event=workflow_dispatch)](https://github.com/e3m3/calcc-rust/actions/workflows/macos-14-native.yaml) | ||
|
||
Learning [Rust][1] [[1]] by implementing the calc langauge using the [llvm-sys][2] [[2]] crate. | ||
Implements the calc language, inspired by the [C++][3] [[3]] implementation presented by Macke and Kwan in [[4]] and [[5]]. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
FROM registry.fedoraproject.org/fedora:40 | ||
|
||
LABEL maintainer="Giordano Salvador <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
FROM docker.io/ubuntu:22.04 | ||
|
||
LABEL maintainer="Giordano Salvador <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
FROM docker.io/ubuntu:22.04 | ||
|
||
LABEL maintainer="Giordano Salvador <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
FROM docker.io/ubuntu:24.04 | ||
|
||
LABEL maintainer="Giordano Salvador <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
HOMEBREW_HOME=/opt/homebrew | ||
eval "$(${HOMEBREW_HOME}/bin/brew shellenv)" | ||
|
||
brew install -y podman | ||
podman | ||
|
||
case ${BUILD_MODE} | ||
debug) build_mode= | ||
release) build_mode=--release | ||
*) echo "Error: BUILD_MODE=$BUILD_MODE" >2 && exit 1 | ||
esac | ||
|
||
podman machine init | ||
podman machine start | ||
podman build \ | ||
-f container/Containerfile.${DISTRO}${OS_VER} \ | ||
-t ${OS}-calcc-${build_mode} \ | ||
--build-arg=BUILD_MODE=${build_mode} \ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# Copyright 2024, Giordano Salvador | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
HOMEBREW_HOME=/opt/homebrew | ||
eval "$(${HOMEBREW_HOME}/bin/brew shellenv)" | ||
|
||
LLVM_VER=18 | ||
PYTHON_VER=3.12 | ||
|
||
brew install -y python@${PYTHON_VER} llvm@${LLVM_VER} lit rustup | ||
|
||
RUSTUP_CHANNEL=stable | ||
RUSTUP_HOME=/root/.rustup | ||
RUSTUP_TOOLCHAIN=${RUSTUP_CHANNEL}-aarch64-apple-darwin | ||
PATH=${RUSTUP_HOME}/toolchains/${RUSTUP_TOOLCHAIN}/bin${PATH:+:$PATH} | ||
LD_LIBRARY_PATH=${RUSTUP_HOME}/toolchains/${RUSTUP_TOOLCHAIN}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} | ||
|
||
rustup default ${RUSTUP_CHANNEL} | ||
|
||
LLVM_HOME=${HOMEBREW_HOME}/opt/llvm@${LLVM_VER} | ||
PATH=${LLVM_HOME}/bin${PATH:+:$PATH} | ||
LD_LIBRARY_PATH=${LLVM_HOME}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} | ||
C_INCLUDE_PATH=${LLVM_HOME}/include${C_INCLUDE_PATH:+:$C_INCLUDE_PATH} | ||
CPLUS_INCLUDE_PATH=${LLVM_HOME}/include${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH} | ||
|
||
PYTHON_VENV_PATH=/root/.python/venv | ||
python3 -m venv ${PYTHON_VENV_PATH} | ||
PATH=${PYTHON_VENV_PATH}/bin${PATH:+:$PATH} | ||
|
||
export HOMEBREW_HOME | ||
export LLVM_HOME | ||
export PYTHON_VENV_PATH | ||
|
||
case ${BUILD_MODE} | ||
debug) build_mode= | ||
release) build_mode=--release | ||
*) echo "Error: BUILD_MODE=$BUILD_MODE" >2 && exit 1 | ||
esac | ||
|
||
cargo build --verbose ${BUILD_MODE} | ||
cargo test --verbose ${BUILD_MODE} -- --nocapture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ | |
// CHECK: %v3 = add nsw i64 %v2, 10 | ||
// CHECK: ret i64 %v3 | ||
// CHECK: } | ||
|
||
// XFAIL: ARCH_X86_64 && OS_LINUX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ | |
// CHECK-LABEL: entry: | ||
// CHECK: ret i64 4096 | ||
// CHECK: } | ||
|
||
// XFAIL: ARCH_X86_64 && OS_LINUX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,3 +74,5 @@ | |
// CHECK: %v3 = add nsw i64 %v2, 10 | ||
// CHECK: ret i64 %v3 | ||
// CHECK: } | ||
|
||
// XFAIL: ARCH_X86_64 && OS_LINUX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,5 @@ | |
// CHECK-LABEL: entry: | ||
// CHECK: ret i64 4096 | ||
// CHECK: } | ||
|
||
// XFAIL: ARCH_X86_64 && OS_LINUX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ | |
// CHECK_O1: ret i64 %v[[REG]] | ||
// CHECK_O1: } | ||
|
||
// XFAIL: ARCH_X86_64 && OS_LINUX |
Oops, something went wrong.