Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query-engine-wasm: fix build.sh with BSD sed #4522

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions query-engine/query-engine-wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OUT_NPM_NAME="@prisma/query-engine-wasm"
# to avoid conflicts with libquery's `name = "query_engine"` library name declaration.
# This little `sed -i` trick below is a hack to publish "@prisma/query-engine-wasm"
# with the same binding filenames currently expected by the Prisma Client.
sed -i 's/name = "query_engine_wasm"/name = "query_engine"/g' Cargo.toml
sed -i.bak 's/name = "query_engine_wasm"/name = "query_engine"/g' Cargo.toml

# use `wasm-pack build --release` on CI only
if [[ -z "$BUILDKITE" ]] && [[ -z "$GITHUB_ACTIONS" ]]; then
Expand All @@ -25,7 +25,12 @@ fi

wasm-pack build $BUILD_PROFILE --target $OUT_TARGET

sed -i 's/name = "query_engine"/name = "query_engine_wasm"/g' Cargo.toml
sed -i.bak 's/name = "query_engine"/name = "query_engine_wasm"/g' Cargo.toml

# Remove the backup file created by sed. We only created it because there's no
# cross-platform way to specify we don't need one (it's just `-i` in GNU sed
# but `-i ""` in BSD sed).
rm Cargo.toml.bak

sleep 1

Expand Down
Loading