Skip to content

Commit

Permalink
Extract toml config to rust-toolchain.toml
Browse files Browse the repository at this point in the history
cherry-picked from #4699
  • Loading branch information
miguelff committed Feb 12, 2024
1 parent 9a756bf commit 5cdd2b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 4 additions & 12 deletions query-engine/query-engine-wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,19 @@ if [[ -z "${WASM_BUILD_PROFILE:-}" ]]; then
WASM_BUILD_PROFILE="release"
fi
fi
echo "Using build profile: \"${WASM_BUILD_PROFILE}\""

if [ "$WASM_BUILD_PROFILE" = "dev" ]; then
WASM_TARGET_SUBDIR="debug"
else
WASM_TARGET_SUBDIR="$WASM_BUILD_PROFILE"
fi

echo "Using build profile: \"${WASM_BUILD_PROFILE}\""

echo "ℹ️ Configuring rust toolchain to use nightly and rust-src component"
rustup default nightly-2024-01-25
rustup target add wasm32-unknown-unknown
rustup component add rust-std --target wasm32-unknown-unknown
rustup component add rust-src --target wasm32-unknown-unknown
export RUSTFLAGS="-Zlocation-detail=none"
CARGO_TARGET_DIR=$(cargo metadata --format-version 1 | jq -r .target_directory)

build() {
build() {
local CONNECTOR="$1"
local CARGO_TARGET_DIR=$(cargo metadata --format-version 1 | jq -r .target_directory)
echo "🔨 Building $CONNECTOR"
CARGO_PROFILE_RELEASE_OPT_LEVEL="z" cargo build \
RUSTFLAGS="-Zlocation-detail=none" CARGO_PROFILE_RELEASE_OPT_LEVEL="z" cargo build \
-p query-engine-wasm \
--profile "$WASM_BUILD_PROFILE" \
--features "$CONNECTOR" \
Expand Down
4 changes: 4 additions & 0 deletions query-engine/query-engine-wasm/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly-2024-01-25"
components = ["rust-src"]
targets = ["wasm32-unknown-unknown"]
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "1.76.0"
components = ["clippy", "rustfmt", "rust-src"]
targets = ["wasm32-unknown-unknown"]

0 comments on commit 5cdd2b6

Please sign in to comment.