-
Notifications
You must be signed in to change notification settings - Fork 249
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
Strangle nix #4713
Strangle nix #4713
Conversation
CodSpeed Performance ReportMerging #4713 will not alter performanceComparing Summary
|
03a4c94
to
0b0c2b8
Compare
WASM Size
|
✅ WASM query-engine performance won't change substantially (0.994x)Full benchmark report
After changes in 113e0ec |
24ca8cb
to
a1912ed
Compare
@@ -45,14 +44,15 @@ fi | |||
if [ "$WASM_BUILD_PROFILE" = "dev" ]; then | |||
WASM_TARGET_SUBDIR="debug" | |||
else | |||
WASM_TARGET_SUBDIR="release" | |||
WASM_TARGET_SUBDIR="$WASM_BUILD_PROFILE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just a bug in the code before. The profiling
profile outputs at said directory.
ba42eb6
to
6264cb3
Compare
Opened integration PR @ #4717 to check automatic engines publishing |
@aqrln I think you are in the best position to review this despite coauthoring. I will also re-read the PR looking for loose ends. |
d677cbb
to
b75ecef
Compare
bb0e934
to
d2631c5
Compare
clean-qe-wasm: | ||
@echo "Cleaning query-engine/query-engine-wasm/pkg" && \ | ||
cd query-engine/query-engine-wasm/pkg && find . ! -name '.' ! -name '..' ! -name 'README.md' -exec rm -rf {} + | ||
|
||
clean-cargo: | ||
@echo "Cleaning cargo" && \ | ||
cargo clean | ||
|
||
clean: clean-qe-wasm clean-cargo | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confident there are more things to clean. Also, the fact that pkg
exists and its checked in doesn't look right to me, being this an output directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the approach with rendering the npm package in target
that we took for prisma-schema-wasm
in this PR, maybe we should do the same for QE (in a follow-up PR since it's out of scope here)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Install wasm-bindgen, wasm-opt | ||
shell: bash | ||
run: | | ||
cargo binstall -y \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pinned
@@ -0,0 +1,4 @@ | |||
[toolchain] | |||
channel = "nightly-2024-01-25" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinned, ported into here from #4699
# with: | ||
# ref: ${{ github.event.pull_request.base.sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out to make the check green in this PR and will be uncommented in a follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precisely!
clean-qe-wasm: | ||
@echo "Cleaning query-engine/query-engine-wasm/pkg" && \ | ||
cd query-engine/query-engine-wasm/pkg && find . ! -name '.' ! -name '..' ! -name 'README.md' -exec rm -rf {} + | ||
|
||
clean-cargo: | ||
@echo "Cleaning cargo" && \ | ||
cargo clean | ||
|
||
clean: clean-qe-wasm clean-cargo | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the approach with rendering the npm package in target
that we took for prisma-schema-wasm
in this PR, maybe we should do the same for QE (in a follow-up PR since it's out of scope here)?
@@ -77,6 +115,11 @@ test-qe-verbose-st: | |||
test-qe-black-box: build-qe | |||
cargo test --package black-box-tests -- --test-threads 1 | |||
|
|||
check-schema-wasm-package: build-schema-wasm | |||
PRISMA_SCHEMA_WASM="$(REPO_ROOT)/target/prisma-schema-wasm" \ | |||
out=$(shell mktemp -d) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this line and the line that touches out
in the corresponding script, the nix derivation didn't have any meaningful outputs in this case.
rust-toolchain.toml
Outdated
@@ -0,0 +1,4 @@ | |||
[toolchain] | |||
channel = "1.76.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinning it here may cause problems in the release images, Soph has tried it previously: #4611 (comment). Did the integration release succeed with these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only did in a previous comment, but didn't got to release after this change. We might need to reopen the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#4717 reopened and updated
cherry-picked from #4699
88f233a
to
c1768d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated CI pipelines look correct and were tested. They will no longer cause friction for team members not using Nix when they try to update those. Building query-engine-wasm is cleaner this way compared to the impure build that was only nominally using Nix but was going to great lengths to work around it because of using nightly cargo flags incompatible with vendored dependencies.
One pipeline was de-scoped from this PR and will be ported separately.
The dev shell is intact and continues to provide value for team members using Nix. Most of removed Nix code that was not used on CI was also not used by any of the current team members and was not maintained, so it makes sense to not keep dead code around. Anything that will be necessary can be reintroduced, but in a way usable by all team members whenever possible as per the team consensus. The only package in the flake I personally relied on nix build
for was reintroduced as a makefile target in this PR.
run: | | ||
cargo binstall -y \ | ||
[email protected] \ | ||
[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want to pin wasm-opt
, there seems to be no harm in always using the latest version, and I'm concerned that we may just ignore updating it and miss on improved optimizations. But it's not blocking this PR, just something to think about.
This was commented out in #4713 to make the pipeline pass in the PR because the changes weren't compatible with the pipeline on `main` with the intention to uncomment immediately after landing the changes, see #4713 (comment).
This was commented out in #4713 to make the pipeline pass in the PR because the changes weren't compatible with the pipeline on `main` with the intention to uncomment immediately after landing the changes, see #4713 (comment).
Due to the lack of Nix buy-in from the team and with most of Nix users leaving, and given the increased overhead of keeping multiple separate build systems and workflows in sync after the introduction of the WebAssembly tooling and difficulties in making changes in Nix code for team members who don't use it, it was previously decided to decrease our reliance on Nix and stop using it on CI, leaving it as optional and only for local development, which mostly happened [in February](#4713). However, the engines size dashboard was still powered by Nix because we ran out of the allocated time for the tech debt task. After the Nix flake was updated last time, the workflow was broken because `wasm-bindgen-cli` in the flake was at 0.2.95 while we are currently pinned to 0.2.93 and are blocked from upgrading to a newer version at the moment. Rather than pinning `wasm-bindgen-cli` to 0.2.93 in the flake by taking it from a different nixpkgs commit, it's a good opportunity to start using the same infrastructure we use for other GitHub Actions jobs instead. With that, and given the fact that our workflows and build scripts are heavily dependent on rustup and we even used rustup within the dev shell instead of the toolchain from `rust-overlay`, there's not much benefit for the local dev shell for Nix users to be a flake, a classic `shell.nix` is more appropriate: pinning the state of the environment in `flake.lock` is no longer useful and only gets in the way. As an added bonus, classic Nix doesn't require copying the sources to the store, which makes the shell startup a bit faster. Fixes: prisma/team-orm#1444 Closes: #5072
Due to the lack of Nix buy-in from the team and with most of Nix users leaving, and given the increased overhead of keeping multiple separate build systems and workflows in sync after the introduction of the WebAssembly tooling and difficulties in making changes in Nix code for team members who don't use it, it was previously decided to decrease our reliance on Nix and stop using it on CI, leaving it as optional and only for local development, which mostly happened [in February](#4713). However, the engines size dashboard was still powered by Nix because we ran out of the allocated time for the tech debt task. After the Nix flake was updated last time, the workflow was broken because `wasm-bindgen-cli` in the flake was at 0.2.95 while we are currently pinned to 0.2.93 and are blocked from upgrading to a newer version at the moment. Rather than pinning `wasm-bindgen-cli` to 0.2.93 in the flake by taking it from a different nixpkgs commit, it's a good opportunity to start using the same infrastructure we use for other GitHub Actions jobs instead. With that, and given the fact that our workflows and build scripts are heavily dependent on rustup and we even used rustup within the dev shell instead of the toolchain from `rust-overlay`, there's not much benefit for the local dev shell for Nix users to be a flake, a classic `shell.nix` is more appropriate: pinning the state of the environment in `flake.lock` is no longer useful and only gets in the way. As an added bonus, classic Nix doesn't require copying the sources to the store, which makes the shell startup a bit faster. Fixes: prisma/team-orm#1444 Closes: #5072
Due to the lack of Nix buy-in from the team and with most of Nix users leaving, and given the increased overhead of keeping multiple separate build systems and workflows in sync after the introduction of the WebAssembly tooling and difficulties in making changes in Nix code for team members who don't use it, it was previously decided to decrease our reliance on Nix and stop using it on CI, leaving it as optional and only for local development, which mostly happened [in February](#4713). However, the engines size dashboard was still powered by Nix because we ran out of the allocated time for the tech debt task. After the Nix flake was updated last time, the workflow was broken because `wasm-bindgen-cli` in the flake was at 0.2.95 while we are currently pinned to 0.2.93 and are blocked from upgrading to a newer version at the moment. Rather than pinning `wasm-bindgen-cli` to 0.2.93 in the flake by taking it from a different nixpkgs commit, it's a good opportunity to start using the same infrastructure we use for other GitHub Actions jobs instead. With that, and given the fact that our workflows and build scripts are heavily dependent on rustup and we even used rustup within the dev shell instead of the toolchain from `rust-overlay`, there's not much benefit for the local dev shell for Nix users to be a flake, a classic `shell.nix` is more appropriate: pinning the state of the environment in `flake.lock` is no longer useful and only gets in the way. As an added bonus, classic Nix doesn't require copying the sources to the store, which makes the shell startup a bit faster. Fixes: prisma/team-orm#1444 Closes: #5072
…5095) Due to the lack of Nix buy-in from the team and with most of Nix users leaving, and given the increased overhead of keeping multiple separate build systems and workflows in sync after the introduction of the WebAssembly tooling and difficulties in making changes in Nix code for team members who don't use it, it was previously decided to decrease our reliance on Nix and stop using it on CI, leaving it as optional and only for local development, which mostly happened [in February](#4713). However, the engines size dashboard was still powered by Nix because we ran out of the allocated time for the tech debt task. After the Nix flake was updated last time, the workflow was broken because `wasm-bindgen-cli` in the flake was at 0.2.95 while we are currently pinned to 0.2.93 and are blocked from upgrading to a newer version at the moment. Rather than pinning `wasm-bindgen-cli` to 0.2.93 in the flake by taking it from a different nixpkgs commit, it's a good opportunity to start using the same infrastructure we use for other GitHub Actions jobs instead. With that, and given the fact that our workflows and build scripts are heavily dependent on rustup and we even used rustup within the dev shell instead of the toolchain from `rust-overlay`, there's not much benefit for the local dev shell for Nix users to be a flake, a classic `shell.nix` is more appropriate: pinning the state of the environment in `flake.lock` is no longer useful and only gets in the way. As an added bonus, classic Nix doesn't require copying the sources to the store, which makes the shell startup a bit faster. Fixes: prisma/team-orm#1444 Closes: #5072
Closes https://github.com/prisma/team-orm/issues/921