Skip to content

Conversation

@chungquantin
Copy link
Contributor

@chungquantin chungquantin commented Apr 3, 2025

  • The PR implements a feature to build only the runtime when the user is in the /runtime folder of the parachain project. Tackling the issue fix: run pop build in a runtime throwing manifest error #504.
  • Implements pop build --deterministic to build a runtime deterministically. feat: pop build --deterministic #478
  • If --only-runtime is provided and the command is run at the parachain project root, it prompts user to select the runtime to build if there're multiple. If there is only one runtime, it builds the runtime instead of a parachain.
pop build --only-runtime

Or

pop build --deterministic --only-runtime

@chungquantin chungquantin marked this pull request as ready for review April 3, 2025 15:14
@chungquantin chungquantin force-pushed the chungquantin/feat-pop_build_runtime branch from 6c4971f to e85ea1e Compare April 3, 2025 15:37
@codecov
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

Attention: Patch coverage is 62.67806% with 131 lines in your changes missing coverage. Please review.

Project coverage is 78.84%. Comparing base (90842a2) to head (10b54bb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-cli/src/common/runtime.rs 55.17% 33 Missing and 19 partials ⚠️
crates/pop-cli/src/commands/build/runtime.rs 70.24% 23 Missing and 13 partials ⚠️
crates/pop-cli/src/commands/build/mod.rs 61.29% 24 Missing ⚠️
crates/pop-cli/src/commands/build/spec.rs 0.00% 10 Missing ⚠️
crates/pop-parachains/src/build/runtime.rs 75.00% 0 Missing and 9 partials ⚠️
@@            Coverage Diff             @@
##             main     #510      +/-   ##
==========================================
- Coverage   78.87%   78.84%   -0.04%     
==========================================
  Files          98       99       +1     
  Lines       22777    23060     +283     
  Branches    22777    23060     +283     
==========================================
+ Hits        17966    18182     +216     
- Misses       2663     2689      +26     
- Partials     2148     2189      +41     
Files with missing lines Coverage Δ
crates/pop-cli/src/commands/bench/overhead.rs 85.39% <100.00%> (ø)
crates/pop-cli/src/commands/bench/pallet.rs 79.47% <100.00%> (+0.01%) ⬆️
crates/pop-cli/src/commands/build/parachain.rs 76.76% <100.00%> (ø)
crates/pop-cli/src/common/try_runtime.rs 92.08% <100.00%> (ø)
crates/pop-common/src/manifest.rs 93.55% <100.00%> (ø)
crates/pop-parachains/src/build/runtime.rs 84.37% <75.00%> (-3.51%) ⬇️
crates/pop-cli/src/commands/build/spec.rs 76.30% <0.00%> (+2.30%) ⬆️
crates/pop-cli/src/commands/build/mod.rs 68.00% <61.29%> (+0.16%) ⬆️
crates/pop-cli/src/commands/build/runtime.rs 70.24% <70.24%> (ø)
crates/pop-cli/src/common/runtime.rs 73.02% <55.17%> (-3.03%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chungquantin chungquantin force-pushed the chungquantin/feat-pop_build_runtime branch from 9561b97 to d2528a8 Compare April 4, 2025 05:14
@chungquantin chungquantin requested a review from AlexD10S April 4, 2025 06:18
@chungquantin chungquantin added the ready-for-final-review The PR is ready for final review label Apr 4, 2025
Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on ,super cool feature!
I’ve left a few comments.

I know it wasn’t introduced in this PR, but it might be a good time to update the build runtime(https://github.com/r0gue-io/pop-cli/pull/510/files#diff-da16676d7c7c76d5651d4ae3e7c5b280b9f0efe86ba0068272d593577ab8dd60R83) command to handle errors using handle_command_error, similar to how we refactored benchmarking and other feats that invoke commands:
https://github.com/r0gue-io/pop-cli/blob/main/crates/pop-parachains/src/errors.rs#L102

Also, once this is merged, it’d be great to update the docs to include how to build the runtime deterministically:
https://learn.onpop.io/appchains/guides/build-your-parachain/build-deterministic-runtime

@chungquantin chungquantin requested a review from AlexD10S April 7, 2025 04:16
@chungquantin chungquantin self-assigned this Apr 7, 2025
Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing all the feedback

@AlexD10S AlexD10S self-requested a review April 7, 2025 10:29
@chungquantin chungquantin merged commit 52d1dc2 into main Apr 7, 2025
18 of 20 checks passed
@chungquantin chungquantin deleted the chungquantin/feat-pop_build_runtime branch April 7, 2025 10:30
chungquantin added a commit that referenced this pull request Apr 7, 2025
* feat: pop build runtime

* fix: test

* chore: reformat

* chore: feature gating

* chore: add test for collect features

* feat: select runtime if multiple

* chore: resolve review comments

* chore: fix cargo deny

* chore: clippy warnings

* fix: cargo deny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-final-review The PR is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants