Skip to content

Commit d66e15f

Browse files
committed
chore: use rust-toolchain.toml for default toolchain
1 parent 664369c commit d66e15f

File tree

10 files changed

+276
-297
lines changed

10 files changed

+276
-297
lines changed

Makefile

Lines changed: 250 additions & 272 deletions
Large diffs are not rendered by default.
File renamed without changes.

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "stable"

scripts/check_memory_errors.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ if [[ "${RUN_VALGRIND}" == "0" && "${RUN_COMPUTE_SANITIZER}" == "0" ]]; then
2828
fi
2929

3030
# List the tests into a temporary file
31-
RUSTFLAGS="$RUSTFLAGS" cargo "${CARGO_RS_BUILD_TOOLCHAIN}" nextest list --cargo-profile "${CARGO_PROFILE}" \
31+
RUSTFLAGS="$RUSTFLAGS" cargo nextest list --cargo-profile "${CARGO_PROFILE}" \
3232
--features=integer,internal-keycache,gpu-debug,zk-pok -p "${TFHE_SPEC}" &> /tmp/test_list.txt
3333

3434
# Filter the tests to get only the HL ones
3535
TESTS_HL=$(sed -e $'s/\x1b\[[0-9;]*m//g' < /tmp/test_list.txt | grep 'high_level_api::.*gpu.*' )
3636

3737
if [[ "${RUN_VALGRIND}" == "1" ]]; then
3838
# Build the tests but don't run them
39-
RUSTFLAGS="$RUSTFLAGS" cargo "${CARGO_RS_BUILD_TOOLCHAIN}" test --no-run --profile "${CARGO_PROFILE}" \
39+
RUSTFLAGS="$RUSTFLAGS" cargo test --no-run --profile "${CARGO_PROFILE}" \
4040
--features=integer,internal-keycache,gpu-debug,zk-pok -p "${TFHE_SPEC}"
4141

4242
# Find the test executable -> last one to have been modified
@@ -61,7 +61,7 @@ TESTS_HL=$(sed -e $'s/\x1b\[[0-9;]*m//g' < /tmp/test_list.txt | grep 'high_leve
6161

6262
if [[ "${RUN_COMPUTE_SANITIZER}" == "1" ]]; then
6363
# Build the tests but don't run them
64-
RUSTFLAGS="$RUSTFLAGS" cargo "${CARGO_RS_BUILD_TOOLCHAIN}" test --no-run --profile "${CARGO_PROFILE}" \
64+
RUSTFLAGS="$RUSTFLAGS" cargo test --no-run --profile "${CARGO_PROFILE}" \
6565
--features=integer,internal-keycache,gpu,zk-pok -p "${TFHE_SPEC}"
6666

6767
# Find the test executable -> last one to have been modified

scripts/install_typos.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
rust_toolchain=""
5+
rust_toolchain=
66
required_typos_version=""
77

88
function usage() {
@@ -36,11 +36,11 @@ do
3636
done
3737

3838
if [[ "${rust_toolchain::1}" != "+" ]]; then
39-
rust_toolchain="+${rust_toolchain}"
39+
rust_toolchain=${rust_toolchain:"+${rust_toolchain}"}
4040
fi
4141

4242
if ! which typos ; then
43-
cargo "${rust_toolchain}" install --locked typos-cli --version ~"${required_typos_version}" || \
43+
cargo ${rust_toolchain:+"$rust_toolchain"} install --locked typos-cli --version ~"${required_typos_version}" || \
4444
( echo "Unable to install typos-cli, unknown error." && exit 1 )
4545

4646
exit 0
@@ -59,6 +59,6 @@ if [[ "${ver_major}" -gt "${min_ver_major}" ]]; then
5959
elif [[ "${ver_major}" -eq "${min_ver_major}" ]] && [[ "${ver_minor}" -ge "${min_ver_minor}" ]]; then
6060
exit 0
6161
else
62-
cargo "${rust_toolchain}" install --locked typos-cli --version ~"${required_typos_version}" || \
62+
cargo ${rust_toolchain:+"$rust_toolchain"} install --locked typos-cli --version ~"${required_typos_version}" || \
6363
( echo "Unable to install typos-cli, unknown error." && exit 1 )
6464
fi

scripts/install_zizmor.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ do
3636
done
3737

3838
if [[ "${rust_toolchain::1}" != "+" ]]; then
39-
rust_toolchain="+${rust_toolchain}"
39+
rust_toolchain=${rust_toolchain:+"+$rust_toolchain"}
4040
fi
4141

4242
if ! which zizmor ; then
43-
cargo "${rust_toolchain}" install --locked zizmor --version ~"${required_zizmor_version}" || \
43+
cargo ${rust_toolchain} install --locked zizmor --version ~"${required_zizmor_version}" || \
4444
( echo "Unable to install zizmor, unknown error." && exit 1 )
4545

4646
exit 0
@@ -59,6 +59,6 @@ if [[ "${ver_major}" -gt "${min_ver_major}" ]]; then
5959
elif [[ "${ver_major}" -eq "${min_ver_major}" ]] && [[ "${ver_minor}" -ge "${min_ver_minor}" ]]; then
6060
exit 0
6161
else
62-
cargo "${rust_toolchain}" install --locked zizmor --version ~"${required_zizmor_version}" || \
62+
cargo ${rust_toolchain} install --locked zizmor --version ~"${required_zizmor_version}" || \
6363
( echo "Unable to install zizmor, unknown error." && exit 1 )
6464
fi

scripts/integer-tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function usage() {
2020
echo
2121
}
2222

23-
RUST_TOOLCHAIN="+stable"
23+
RUST_TOOLCHAIN=""
2424
multi_bit_argument=
2525
sign_argument=
2626
fast_tests_argument=
@@ -89,7 +89,7 @@ do
8989
done
9090

9191
if [[ "${RUST_TOOLCHAIN::1}" != "+" ]]; then
92-
RUST_TOOLCHAIN="+${RUST_TOOLCHAIN}"
92+
RUST_TOOLCHAIN=${RUST_TOOLCHAIN:+"+${RUST_TOOLCHAIN}"}
9393
fi
9494

9595
if [[ "${FAST_TESTS}" == TRUE ]]; then
@@ -168,7 +168,7 @@ fi
168168

169169
echo "${filter_expression}"
170170

171-
cargo "${RUST_TOOLCHAIN}" nextest run \
171+
cargo ${RUST_TOOLCHAIN} nextest run \
172172
--tests \
173173
--cargo-profile "${cargo_profile}" \
174174
--package "${tfhe_package}" \
@@ -179,7 +179,7 @@ cargo "${RUST_TOOLCHAIN}" nextest run \
179179
-E "$filter_expression"
180180

181181
if [[ -z ${multi_bit_argument} && -z ${long_tests_argument} ]]; then
182-
cargo "${RUST_TOOLCHAIN}" test \
182+
cargo ${RUST_TOOLCHAIN} test \
183183
--profile "${cargo_profile}" \
184184
--package "${tfhe_package}" \
185185
--no-default-features \

scripts/shortint-tests.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -e
44

55
function usage() {
66
echo "$0: shortint test runner"
@@ -13,7 +13,7 @@ function usage() {
1313
echo
1414
}
1515

16-
RUST_TOOLCHAIN="+stable"
16+
RUST_TOOLCHAIN=""
1717
multi_bit=""
1818
multi_bit_argument=
1919
fast_tests_argument=
@@ -57,7 +57,7 @@ do
5757
done
5858

5959
if [[ "${RUST_TOOLCHAIN::1}" != "+" ]]; then
60-
RUST_TOOLCHAIN="+${RUST_TOOLCHAIN}"
60+
RUST_TOOLCHAIN=${RUST_TOOLCHAIN:+"+${RUST_TOOLCHAIN}"}
6161
fi
6262

6363
if [[ "${FAST_TESTS}" == TRUE ]]; then
@@ -88,7 +88,7 @@ if [[ "${BIG_TESTS_INSTANCE}" != TRUE ]]; then
8888
filter_expression_small_params=$(/usr/bin/python3 scripts/test_filtering.py --layer shortint ${fast_tests_argument} ${multi_bit_argument})
8989

9090
# Run tests only no examples or benches with small params and more threads
91-
cargo "${RUST_TOOLCHAIN}" nextest run \
91+
cargo ${RUST_TOOLCHAIN} nextest run \
9292
--tests \
9393
--cargo-profile "${cargo_profile}" \
9494
--package "${tfhe_package}" \
@@ -105,7 +105,7 @@ if [[ "${BIG_TESTS_INSTANCE}" != TRUE ]]; then
105105
and not test(~smart_add_and_mul)"""
106106

107107
# Run tests only no examples or benches with big params and less threads
108-
cargo "${RUST_TOOLCHAIN}" nextest run \
108+
cargo ${RUST_TOOLCHAIN} nextest run \
109109
--tests \
110110
--cargo-profile "${cargo_profile}" \
111111
--package "${tfhe_package}" \
@@ -116,7 +116,7 @@ and not test(~smart_add_and_mul)"""
116116
-E "${filter_expression_big_params}"
117117

118118
if [[ "${multi_bit}" == "" ]]; then
119-
cargo "${RUST_TOOLCHAIN}" test \
119+
cargo ${RUST_TOOLCHAIN} test \
120120
--profile "${cargo_profile}" \
121121
--package "${tfhe_package}" \
122122
--features=shortint,internal-keycache,zk-pok,experimental \
@@ -128,17 +128,17 @@ else
128128
filter_expression=$(/usr/bin/python3 scripts/test_filtering.py --layer shortint --big-instance ${fast_tests_argument} ${multi_bit_argument})
129129

130130
# Run tests only no examples or benches with small params and more threads
131-
cargo "${RUST_TOOLCHAIN}" nextest run \
131+
cargo ${RUST_TOOLCHAIN} nextest run \
132132
--tests \
133133
--cargo-profile "${cargo_profile}" \
134134
--package "${tfhe_package}" \
135135
--profile ci \
136136
--features=shortint,internal-keycache,experimental \
137137
--test-threads "${n_threads_big}" \
138-
-E "${filter_expression}"
138+
-E "$filter_expression"
139139

140140
if [[ "${multi_bit}" == "" ]]; then
141-
cargo "${RUST_TOOLCHAIN}" test \
141+
cargo ${RUST_TOOLCHAIN} test \
142142
--profile "${cargo_profile}" \
143143
--package "${tfhe_package}" \
144144
--features=shortint,internal-keycache,experimental \

tfhe/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
#![allow(clippy::iter_with_drain)] // 2
6868
#![allow(clippy::large_stack_frames)] // 1
6969
#![cfg_attr(feature = "__wasm_api", allow(dead_code))]
70-
#![cfg_attr(all(doc, not(doctest)), feature(doc_cfg))]
7170
// Weird clippy lint triggering without any code location
7271
#![cfg_attr(test, allow(clippy::large_stack_arrays))]
7372

utils/param_dedup/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn main() {
330330
);
331331

332332
let formatting_toolchain = {
333-
let tmp = fs::read_to_string("toolchain.txt").unwrap();
333+
let tmp = fs::read_to_string("nightly-toolchain.txt").unwrap();
334334
let tmp = tmp.trim();
335335
format!("+{tmp}")
336336
};

0 commit comments

Comments
 (0)