Skip to content

Commit

Permalink
fix rust_wasm_build (#1824)
Browse files Browse the repository at this point in the history
  • Loading branch information
007gzs authored Feb 27, 2025
1 parent 45fdd95 commit 5bece9c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-and-push-wasm-plugin-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ jobs:
command="
set -e
cd /workspace/plugins/wasm-rust/extensions/${PLUGIN_NAME}
if [ -f ./.prebuild ]; then
echo 'Found .prebuild file, sourcing it...'
. ./.prebuild
fi
rustup target add wasm32-wasip1
cargo build --target wasm32-wasip1 --release
cp target/wasm32-wasip1/release/*.wasm plugin.wasm
tar czvf plugin.tar.gz plugin.wasm
Expand Down
4 changes: 2 additions & 2 deletions plugins/wasm-rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ WORKDIR /workspace
RUN rustup target add wasm32-wasip1
ARG PLUGIN_NAME="say-hello"
ARG BUILD_OPTS="--release"
ARG BUILDRC=".buildrc"
ARG PREBUILD=".prebuild"
COPY . .
WORKDIR /workspace/extensions/$PLUGIN_NAME
RUN if [ -f $BUILDRC ]; then sh $BUILDRC; fi
RUN if [ -f $PREBUILD ]; then sh $PREBUILD; fi
RUN cargo build --target wasm32-wasip1 $BUILD_OPTS \
&& cp target/wasm32-wasip1/release/*.wasm /main.wasm

Expand Down
1 change: 0 additions & 1 deletion plugins/wasm-rust/extensions/ai-data-masking/.buildrc

This file was deleted.

3 changes: 3 additions & 0 deletions plugins/wasm-rust/extensions/ai-data-masking/.prebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apt-get update
apt-get install gcc gcc-multilib llvm clang -y
apt-get clean
5 changes: 1 addition & 4 deletions plugins/wasm-rust/src/event_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ impl EventStream {
}

fn is_2eol(&self, i: usize) -> Option<usize> {
let size1 = match self.is_eol(i) {
None => return None,
Some(size1) => size1,
};
let size1 = self.is_eol(i)?;
if i + size1 < self.buffer.len() {
match self.is_eol(i + size1) {
None => {
Expand Down

0 comments on commit 5bece9c

Please sign in to comment.