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

Avoid building all three wasm engines for production use #4358

Open
matklad opened this issue Jun 9, 2021 · 8 comments
Open

Avoid building all three wasm engines for production use #4358

matklad opened this issue Jun 9, 2021 · 8 comments
Labels
A-build Area: Anything related to the build and configuration process for nearcore. A-CI Area: Continuous Integration C-good-first-issue Category: issues that are self-contained and easy for newcomers to work on. C-housekeeping Category: Refactoring, cleanups, code quality T-contract-runtime Team: issues relevant to the contract runtime team

Comments

@matklad
Copy link
Contributor

matklad commented Jun 9, 2021

At the moment, we enable all three vms using default features in near-vm-runner:

default = ["wasmer0_vm", "wasmtime_vm", "wasmer1_vm"]

The problem with default features is that they are impossible to disable. Our current setup is more or less equivalent to just always using all three vm. Indeed, if you remove this default feature, you'll notice that near-vm-runner doesn't even compile, as it misses some important cfgs.

At the same time, wasm runtimes are very heavy dependencies (take long time to compile, and often use global resources like #<span class="error">[no_mangle]</span> functions or signal handlers), so using conditional compilation here makes sense.

I think to fix this we need:

  • change nightly CI setup to run cargo test --workspace --features nightly_protocol,nightly_protocol_features,protocol_feature_evm,wasmer0_vm,wasmer1_vm,wasmtime_vm
  • change to default = <span class="error">["wasmer0_vm"]</span> only
  • fix compilation time errors
@matklad matklad added the C-housekeeping Category: Refactoring, cleanups, code quality label Jun 9, 2021
@matklad
Copy link
Contributor Author

matklad commented Jun 9, 2021

cc @olonho @ailisp

@bowenwang1996 bowenwang1996 added A-CI Area: Continuous Integration A-build Area: Anything related to the build and configuration process for nearcore. labels Jun 28, 2021
@bowenwang1996
Copy link
Collaborator

@matklad does the contract runtime team want to work on this issue or do you want someone else to work on it?

@ailisp
Copy link
Member

ailisp commented Jul 1, 2021

we haven't reach consensus on it at last meeting, @olonho @matklad let's make a conclusion on this today

@matklad matklad added the T-contract-runtime Team: issues relevant to the contract runtime team label Jul 8, 2021
@matklad
Copy link
Contributor Author

matklad commented Jul 8, 2021

Discussed in today's meeting. Summary:

  • for contract runtime team, it's more convenient if all vms are enabled by default
  • for other teams, this creates extra compilation time tax (b/c vm deps are heavy)
  • a nice middleground is to ensure that we test all vms on CI, but ship only one

Specific proposal:

  • remove wasmer1_vm and wasmtime_vm from the set of default features in Cargo.toml
  • add those features to the nightly tests instead.

@stale
Copy link

stale bot commented Oct 6, 2021

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months.
It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the S-stale label Oct 6, 2021
@matklad matklad removed the S-stale label Oct 6, 2021
@stale
Copy link

stale bot commented Jan 4, 2022

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months.
It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the S-stale label Jan 4, 2022
@stale
Copy link

stale bot commented Apr 7, 2022

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months.
It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the S-stale label Apr 7, 2022
@akhi3030 akhi3030 removed the S-stale label Jul 8, 2022
@matklad matklad added the C-good-first-issue Category: issues that are self-contained and easy for newcomers to work on. label Aug 18, 2022
@matklad
Copy link
Contributor Author

matklad commented Aug 18, 2022

cc @akhi3030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Area: Anything related to the build and configuration process for nearcore. A-CI Area: Continuous Integration C-good-first-issue Category: issues that are self-contained and easy for newcomers to work on. C-housekeeping Category: Refactoring, cleanups, code quality T-contract-runtime Team: issues relevant to the contract runtime team
Projects
None yet
Development

No branches or pull requests

4 participants