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

Explicitly set RUSTUP_TOOLCHAIN to 1.64.0 #2440

Merged
merged 1 commit into from
Dec 30, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/preview-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: cp jni/deltachat-core-rust/rust-toolchain .
- uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v1
with:
working-directory: jni/deltachat-core-rust
Expand Down
6 changes: 3 additions & 3 deletions scripts/install-toolchains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#
set -e
TARGETS="armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android"
TOOLCHAIN="$(cat jni/deltachat-core-rust/rust-toolchain)"
rustup install "$TOOLCHAIN"
rustup target add $TARGETS --toolchain "$TOOLCHAIN"
RUSTUP_TOOLCHAIN=$(cat "$(dirname "$0")/rust-toolchain")
rustup install "$RUSTUP_TOOLCHAIN"
rustup target add $TARGETS --toolchain "$RUSTUP_TOOLCHAIN"
10 changes: 6 additions & 4 deletions scripts/ndk-make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$TOOLCHAIN/bin/aarch64-linux-a
export CARGO_TARGET_I686_LINUX_ANDROID_LINKER="$TOOLCHAIN/bin/i686-linux-android16-clang"
export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="$TOOLCHAIN/bin/x86_64-linux-android21-clang"

RUSTUP_TOOLCHAIN=$(cat "$(dirname "$0")/rust-toolchain")

# Check if the argument is a correct architecture:
if test $1 && echo "armeabi-v7a arm64-v8a x86 x86_64" | grep -vwq $1; then
echo "Architecture '$1' not known, possible values are armeabi-v7a, arm64-v8a, x86 and x86_64."
Expand Down Expand Up @@ -113,7 +115,7 @@ if test -z $1 || test $1 = armeabi-v7a; then
export CFLAGS=-D__ANDROID_API__=16
TARGET_CC=armv7a-linux-androideabi16-clang \
TARGET_AR=llvm-ar \
cargo +`cat rust-toolchain` rustc $RELEASEFLAG --target armv7-linux-androideabi -p deltachat_ffi -- -L "$TMPLIB"
cargo "+$RUSTUP_TOOLCHAIN" rustc $RELEASEFLAG --target armv7-linux-androideabi -p deltachat_ffi -- -L "$TMPLIB"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm +/-0 on this PR, because the downside is that this will mean that we need to bump the Rust version in even more places every few months.

But maybe we can create one file rust-toolchain in the dc-android repo that contains the name of the currently used Rust version? This way, we'd only need to update it in one place.

E.g.:

Suggested change
cargo "+$RUSTUP_TOOLCHAIN" rustc $RELEASEFLAG --target armv7-linux-androideabi -p deltachat_ffi -- -L "$TMPLIB"
cargo +`cat ../../rust-toolchain` rustc $RELEASEFLAG --target armv7-linux-androideabi -p deltachat_ffi -- -L "$TMPLIB"

cp target/armv7-linux-androideabi/$RELEASE/libdeltachat.a $jnidir/armeabi-v7a
fi

Expand All @@ -122,7 +124,7 @@ if test -z $1 || test $1 = arm64-v8a; then
export CFLAGS=-D__ANDROID_API__=21
TARGET_CC=aarch64-linux-android21-clang \
TARGET_AR=llvm-ar \
cargo +`cat rust-toolchain` rustc $RELEASEFLAG --target aarch64-linux-android -p deltachat_ffi -- -L "$TMPLIB"
cargo "+$RUSTUP_TOOLCHAIN" rustc $RELEASEFLAG --target aarch64-linux-android -p deltachat_ffi -- -L "$TMPLIB"
cp target/aarch64-linux-android/$RELEASE/libdeltachat.a $jnidir/arm64-v8a
fi

Expand All @@ -131,7 +133,7 @@ if test -z $1 || test $1 = x86; then
export CFLAGS=-D__ANDROID_API__=16
TARGET_CC=i686-linux-android16-clang \
TARGET_AR=llvm-ar \
cargo +`cat rust-toolchain` rustc $RELEASEFLAG --target i686-linux-android -p deltachat_ffi -- -L "$TMPLIB"
cargo "+$RUSTUP_TOOLCHAIN" rustc $RELEASEFLAG --target i686-linux-android -p deltachat_ffi -- -L "$TMPLIB"
cp target/i686-linux-android/$RELEASE/libdeltachat.a $jnidir/x86
fi

Expand All @@ -140,7 +142,7 @@ if test -z $1 || test $1 = x86_64; then
export CFLAGS=-D__ANDROID_API__=21
TARGET_CC=x86_64-linux-android21-clang \
TARGET_AR=llvm-ar \
cargo +`cat rust-toolchain` rustc $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi -- -L "$TMPLIB"
cargo "+$RUSTUP_TOOLCHAIN" rustc $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi -- -L "$TMPLIB"
cp target/x86_64-linux-android/$RELEASE/libdeltachat.a $jnidir/x86_64
fi

Expand Down
1 change: 1 addition & 0 deletions scripts/rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.64.0