Skip to content

Commit

Permalink
chore: update rust and wasi toolchain (#7212)
Browse files Browse the repository at this point in the history
Resolves #7175 
This PR updates rust and wasi toolchain to latest.

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [x] Tests added (always)
- [x] Docs updated (only required for features)
- [x] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
Pushkarm029 authored Nov 12, 2024
1 parent 7f00098 commit c8aea62
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[env]
# tree-sitter build fails with newer version of clang unless implicit-function-declaration is ignored
CC_wasm32_wasi = { value = ".cargo/wasi-sdk-21.0/bin/clang -Wno-error=implicit-function-declaration", relative = true }
AR_wasm32_wasi = { value = ".cargo/wasi-sdk-21.0/bin/ar", relative = true }
CC_wasm32_wasi = { value = ".cargo/wasi-sdk-24.0/bin/clang -Wno-error=implicit-function-declaration", relative = true }
AR_wasm32_wasi = { value = ".cargo/wasi-sdk-24.0/bin/ar", relative = true }
2 changes: 1 addition & 1 deletion packages/@winglang/wingc/scripts/postcompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ wingc=$(cd $(dirname $0)/.. && pwd)
# Currently we only do release wasm builds
target="release"

wasm_opt="$wingc/../../../.cargo/binaryen-version_117/bin/wasm-opt"
wasm_opt="$wingc/../../../.cargo/binaryen-version_119/bin/wasm-opt"
input_wasm="$wingc/../../../target/wasm32-wasi/$target/wingc.wasm"
output_wasm="$wingc/wingc.wasm"

Expand Down
3 changes: 2 additions & 1 deletion packages/@winglang/wingc/src/lsp/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ pub fn on_completion(params: lsp_types::CompletionParams) -> CompletionResponse
.pos_args
.iter()
.filter(|a| !types.get_expr_type(a).is_unresolved())
.count() == func.parameters.len() - 1
.count()
== func.parameters.len() - 1
{
completions.extend(get_inner_struct_completions(structy, arg_list_strings));
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
profile = "default"
channel = "1.77.2"
channel = "1.82.0"
targets = ["wasm32-wasi"]
15 changes: 12 additions & 3 deletions scripts/setup_wasi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -eo pipefail

TOOL_INSTALL_DIR="./.cargo"

BINARYEN_VERSION="version_117"
WASI_SDK_VERSION="21"
BINARYEN_VERSION="version_119"
WASI_SDK_VERSION="24"
WASI_SDK_VERSION_FULL="$WASI_SDK_VERSION.0"

SYS_OS=$OSTYPE
Expand Down Expand Up @@ -54,7 +54,7 @@ fi
# Download wasi-sdk
WASI_SDK_INSTALL_DIR="$TOOL_INSTALL_DIR/wasi-sdk-$WASI_SDK_VERSION_FULL"
if [ ! -d $WASI_SDK_INSTALL_DIR ]; then
WASI_SDK_TARBALL="wasi-sdk-$WASI_SDK_VERSION_FULL-$SYS_OS.tar.gz"
WASI_SDK_TARBALL="wasi-sdk-$WASI_SDK_VERSION_FULL-$SYS_ARCH-$SYS_OS.tar.gz"
WASI_SDK_INSTALL_URL="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/$WASI_SDK_TARBALL"
OUTFILE="/tmp/$WASI_SDK_TARBALL"

Expand All @@ -67,4 +67,13 @@ if [ ! -d $WASI_SDK_INSTALL_DIR ]; then

echo "Extracting to $WASI_SDK_INSTALL_DIR..."
tar zxf $OUTFILE -C $TOOL_INSTALL_DIR

# Rename the architecture-specific directory to a generic name
EXTRACTED_DIR="$TOOL_INSTALL_DIR/wasi-sdk-$WASI_SDK_VERSION_FULL-$SYS_ARCH-$SYS_OS"
GENERIC_DIR="$TOOL_INSTALL_DIR/wasi-sdk-$WASI_SDK_VERSION_FULL"

if [ -d "$EXTRACTED_DIR" ]; then
echo "Renaming $EXTRACTED_DIR to $GENERIC_DIR..."
mv "$EXTRACTED_DIR" "$GENERIC_DIR"
fi
fi

0 comments on commit c8aea62

Please sign in to comment.