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

Implement initial support for no_std #270

Merged
merged 1 commit into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ main() {
release_flag="--release"
fi

$cargo build -p cdylib --target $TARGET $release_flag
$cargo build -p cdylib --target $TARGET $release_flag $FEATURES
}

main
13 changes: 9 additions & 4 deletions .github/workflows/build_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@ main() {
release_flag="--release"
fi

if [ "$NO_STD" = "true" ]; then
(cd crates/no-std-test && cargo build --target $TARGET $FEATURES)
return
fi

case $TARGET in
asmjs-unknown-emscripten)
$cargo build -p livesplit --target $TARGET --release
$cargo build -p livesplit --target $TARGET --release $FEATURES
;;
wasm32-unknown-emscripten)
rm target/wasm32-unknown-emscripten/release/deps/*.wasm 2>/dev/null || :
rm target/wasm32-unknown-emscripten/release/deps/*.js 2>/dev/null || :
$cargo build -p livesplit --target $TARGET --release
$cargo build -p livesplit --target $TARGET --release $FEATURES
;;
wasm32-unknown-unknown)
$cargo build -p cdylib --target $TARGET --release
$cargo build -p cdylib --target $TARGET --release $FEATURES
;;
*)
$cargo build -p staticlib --target $TARGET $release_flag
$cargo build -p staticlib --target $TARGET $release_flag $FEATURES
;;
esac
}
Expand Down
182 changes: 170 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,25 @@ jobs:
fail-fast: false
matrix:
label:
# Bare Metal
- Bare Metal Nvidia PTX 64
- Bare Metal ARM Cortex-M thumbv6m
- Bare Metal ARM Cortex-M thumbv7em
- Bare Metal ARM Cortex-M thumbv7em Hardware Float
- Bare Metal ARM Cortex-M thumbv7m
- Bare Metal ARM Cortex-M thumbv8m.base
- Bare Metal ARM Cortex-M thumbv8m.main
- Bare Metal ARM Cortex-M thumbv8m.main Hardware Float
- Bare Metal RISC-V 32 i
- Bare Metal RISC-V 32 imac
- Bare Metal RISC-V 32 imc
- Bare Metal RISC-V 64 gc
- Bare Metal RISC-V 64 imac

# Web
# FIXME: asmjs is broken at the moment. It's unclear why.
# FIXME: emscripten is broken at the moment. cross' emscripten is too old.
# - Web asmjs
- Web wasm32 emscripten
# - Web wasm32 emscripten
- Web wasm32

# Windows
Expand Down Expand Up @@ -104,6 +119,140 @@ jobs:
- macOS Nightly

include:
# Bare Metal
- label: Bare Metal Nvidia PTX 64
target: nvptx64-nvidia-cuda
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal ARM Cortex-M thumbv6m
target: thumbv6m-none-eabi
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
features: "--features doesnt-have-atomics"

- label: Bare Metal ARM Cortex-M thumbv7em
target: thumbv7em-none-eabi
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal ARM Cortex-M thumbv7em Hardware Float
target: thumbv7em-none-eabihf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal ARM Cortex-M thumbv7m
target: thumbv7m-none-eabi
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal ARM Cortex-M thumbv8m.base
target: thumbv8m.base-none-eabi
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal ARM Cortex-M thumbv8m.main
target: thumbv8m.main-none-eabi
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal ARM Cortex-M thumbv8m.main Hardware Float
target: thumbv8m.main-none-eabihf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal RISC-V 32 i
target: riscv32i-unknown-none-elf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
features: "--features doesnt-have-atomics"

- label: Bare Metal RISC-V 32 imac
target: riscv32imac-unknown-none-elf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal RISC-V 32 imc
target: riscv32imc-unknown-none-elf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
features: "--features doesnt-have-atomics"

- label: Bare Metal RISC-V 64 gc
target: riscv64gc-unknown-none-elf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

- label: Bare Metal RISC-V 64 imac
target: riscv64imac-unknown-none-elf
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true

# Web
# - label: Web asmjs
# target: asmjs-unknown-emscripten
Expand All @@ -113,21 +262,19 @@ jobs:
# dylib: skip
# release_anyway: true

- label: Web wasm32 emscripten
target: wasm32-unknown-emscripten
os: ubuntu-latest
toolchain: stable
tests: skip
dylib: skip
release_anyway: true
# - label: Web wasm32 emscripten
# target: wasm32-unknown-emscripten
# os: ubuntu-latest
# toolchain: stable
# tests: skip
# dylib: skip

- label: Web wasm32
target: wasm32-unknown-unknown
os: ubuntu-latest
tests: skip
dylib: skip
install_target: true
release_anyway: true

# Windows
- label: Windows aarch64
Expand Down Expand Up @@ -394,24 +541,28 @@ jobs:
target: x86_64-pc-windows-msvc
os: windows-latest
toolchain: beta
release: skip
cross: skip

- label: Windows Nightly
target: x86_64-pc-windows-msvc
os: windows-latest
toolchain: nightly
release: skip
cross: skip

- label: Windows Beta gnu
target: x86_64-pc-windows-gnu
toolchain: beta-x86_64-pc-windows-gnu
release: skip
os: windows-latest
cross: skip
install_target: true

- label: Windows Nightly gnu
target: x86_64-pc-windows-gnu
toolchain: nightly-x86_64-pc-windows-gnu
release: skip
os: windows-latest
cross: skip
install_target: true
Expand All @@ -420,22 +571,26 @@ jobs:
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
toolchain: beta
release: skip

- label: Linux Nightly
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
toolchain: nightly
release: skip

- label: macOS Beta
target: x86_64-apple-darwin
os: macOS-latest
toolchain: beta
release: skip
cross: skip

- label: macOS Nightly
target: x86_64-apple-darwin
os: macOS-latest
toolchain: nightly
release: skip
cross: skip

steps:
Expand Down Expand Up @@ -463,6 +618,8 @@ jobs:
TARGET: ${{ matrix.target }}
SKIP_CROSS: ${{ matrix.cross }}
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
FEATURES: ${{ matrix.features }}
NO_STD: ${{ matrix.no_std }}

- name: Build Shared Library
if: matrix.dylib == ''
Expand All @@ -471,6 +628,7 @@ jobs:
TARGET: ${{ matrix.target }}
SKIP_CROSS: ${{ matrix.cross }}
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
FEATURES: ${{ matrix.features }}

- name: Test
if: matrix.tests == ''
Expand All @@ -480,15 +638,15 @@ jobs:
SKIP_CROSS: ${{ matrix.cross }}

- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta')))
if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
shell: bash
run: .github/workflows/before_deploy.sh
env:
OS_NAME: ${{ matrix.os }}
TARGET: ${{ matrix.target }}

- name: Release
if: startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta')))
if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
uses: softprops/action-gh-release@v1
with:
files: livesplit-core-*.*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ main() {
fi

$cargo test -p livesplit-core --all-features --target $TARGET
$cargo test -p livesplit-core --no-default-features --target $TARGET
$cargo test -p livesplit-core --no-default-features --features std --target $TARGET
}

main