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

ci: fix wasm build script #4519

Merged
merged 1 commit into from
Dec 5, 2023
Merged

ci: fix wasm build script #4519

merged 1 commit into from
Dec 5, 2023

Conversation

aqrln
Copy link
Member

@aqrln aqrln commented Dec 4, 2023

The build script had an invalid sed command with an extra ''
argument that caused it to fail with

sed: can't read s/name = "query_engine_wasm"/name = "query_engine"/g: No such file or directory

Example: https://github.com/prisma/prisma-engines/actions/runs/7090582268/job/19297872413

image image

This is reproducible both on CI and locally for me. Perhaps it was
written for BSD sed and doesn't work with GNU sed (so it always fails on
Linux and also fails on macOS inside prisma-engines Nix flake but maybe
it works on macOS without Nix)?

Because of this, a broken package was published from CI.

The commit fixes the sed command and adds set -e so that errors like
this would fail CI instead of silently continuing and doing wrong
things.

The build script had an invalid `sed` command with an extra `''`
argument that caused it to fail with

```
sed: can't read s/name = "query_engine_wasm"/name = "query_engine"/g: No such file or directory
```

Example: https://github.com/prisma/prisma-engines/actions/runs/7090582268/job/19297872413

This is reproducible both on CI and locally for me. Perhaps it was
written for BSD sed and doesn't work with GNU sed (so it always fails on
Linux and also fails on macOS inside prisma-engines Nix flake but maybe
it works on macOS without Nix)?

Because of this, a broken package was published from CI.

The commit fixes the `sed` command and adds `set -e` so that errors like
this would fail CI instead of silently continuing and doing wrong
things.
@aqrln aqrln requested a review from a team as a code owner December 4, 2023 19:03
@aqrln aqrln requested review from miguelff, Druue and jkomyno and removed request for a team December 4, 2023 19:03
@aqrln aqrln self-assigned this Dec 4, 2023
Copy link

codspeed-hq bot commented Dec 4, 2023

CodSpeed Performance Report

Merging #4519 will improve performances by 5.73%

Comparing ci-fix-wasm-build-script (576bb26) with main (845c140)

Summary

⚡ 1 improvements
✅ 10 untouched benchmarks

Benchmarks breakdown

Benchmark main ci-fix-wasm-build-script Change
large_read 7.6 ms 7.2 ms +5.73%

@aqrln aqrln added this to the 5.7.0 milestone Dec 4, 2023
@aqrln
Copy link
Member Author

aqrln commented Dec 4, 2023

Turns out it is indeed GNU sed vs BSD sed difference!

Seems like the only way to make it work in both (other than not using in-place editing) is something like

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

@aqrln
Copy link
Member Author

aqrln commented Dec 5, 2023

Gonna merge this as is and open a follow-up PR to make it cross-platform to avoid merge conflicts in another PR.

@aqrln aqrln merged commit a26fa4c into main Dec 5, 2023
33 checks passed
@aqrln aqrln deleted the ci-fix-wasm-build-script branch December 5, 2023 16:30
aqrln added a commit that referenced this pull request Dec 5, 2023
#4519 fixed the `build.sh`
script being broken with GNU sed (e.g. on Linux, including on CI) but
broke it with BSD sed (e.g. on vanilla macOS with out-of-the box BSD
sed, without GNU sed installed via Homebrew or Nix). This commit makes
the script cross-platform.
aqrln added a commit that referenced this pull request Dec 5, 2023
#4519 fixed the `build.sh`
script being broken with GNU sed (e.g. on Linux, including on CI) but
broke it with BSD sed (e.g. on vanilla macOS with out-of-the box BSD
sed, without GNU sed installed via Homebrew or Nix). This commit makes
the script cross-platform.

Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants