Skip to content

Commit

Permalink
[rs] add cranelift compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Apr 6, 2024
1 parent d14fa19 commit ded8e87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rs/build_cranelift_debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eu

cd $(dirname $0)
BUILDDIR=${BUILD_ROOT:-target}/$(basename $(pwd))-cranelift-$(echo $(basename $0) | sed 's/build_*\(.*\).sh/\1/')-$(uname)-$(uname -m)
export CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift
export CARGO_TARGET_DIR=$BUILDDIR
cargo +nightly build -Zcodegen-backend --release
cp $BUILDDIR/debug/rosettaboy-rs ./rosettaboy-cranelift
3 changes: 3 additions & 0 deletions utils/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ USER dev
ENV PATH="/home/dev/.cargo/bin:$PATH"
RUN wget -qO - https://sh.rustup.rs | sh -s -- --default-toolchain ${RUST_VERSION} -y && \
cargo search foo
# Cranelift is only in nightly
RUN rustup toolchain install nightly \
&& rustup component add rustc-codegen-cranelift-preview --toolchain nightly


#######################################################################
Expand Down

0 comments on commit ded8e87

Please sign in to comment.