Compare commits

...

4 Commits

Author SHA1 Message Date
007gzs
102596360a rustup target add wasm32-wasip1 2025-02-27 13:28:20 +08:00
007gzs
7354d80263 fix prebuild 2025-02-27 11:42:34 +08:00
007gzs
3646502248 fix clippy 2025-02-27 11:12:51 +08:00
007gzs
8be591d052 fix rust_wasm_build 2025-02-27 10:30:34 +08:00
5 changed files with 11 additions and 7 deletions

View File

@@ -133,6 +133,11 @@ jobs:
command=" command="
set -e set -e
cd /workspace/plugins/wasm-rust/extensions/${PLUGIN_NAME} 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 cargo build --target wasm32-wasip1 --release
cp target/wasm32-wasip1/release/*.wasm plugin.wasm cp target/wasm32-wasip1/release/*.wasm plugin.wasm
tar czvf plugin.tar.gz plugin.wasm tar czvf plugin.tar.gz plugin.wasm

View File

@@ -3,10 +3,10 @@ WORKDIR /workspace
RUN rustup target add wasm32-wasip1 RUN rustup target add wasm32-wasip1
ARG PLUGIN_NAME="say-hello" ARG PLUGIN_NAME="say-hello"
ARG BUILD_OPTS="--release" ARG BUILD_OPTS="--release"
ARG BUILDRC=".buildrc" ARG PREBUILD=".prebuild"
COPY . . COPY . .
WORKDIR /workspace/extensions/$PLUGIN_NAME 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 \ RUN cargo build --target wasm32-wasip1 $BUILD_OPTS \
&& cp target/wasm32-wasip1/release/*.wasm /main.wasm && cp target/wasm32-wasip1/release/*.wasm /main.wasm

View File

@@ -1 +0,0 @@
apt update && apt-get install gcc gcc-multilib llvm clang -y && apt clean

View File

@@ -0,0 +1,3 @@
apt-get update
apt-get install gcc gcc-multilib llvm clang -y
apt-get clean

View File

@@ -108,10 +108,7 @@ impl EventStream {
} }
fn is_2eol(&self, i: usize) -> Option<usize> { fn is_2eol(&self, i: usize) -> Option<usize> {
let size1 = match self.is_eol(i) { let size1 = self.is_eol(i)?;
None => return None,
Some(size1) => size1,
};
if i + size1 < self.buffer.len() { if i + size1 < self.buffer.len() {
match self.is_eol(i + size1) { match self.is_eol(i + size1) {
None => { None => {