-
Notifications
You must be signed in to change notification settings - Fork 18
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
cargo-near build whole workspace with one docker instance #301
Comments
@frolvanya would it be simpler to run builds in parallel in ci with |
@dj8yfo I tried running it parallel using |
Are there any technical challenges on implementing the same workflow as |
@frolvanya sure there are. Right now it sounds more like a random collection of words + phantasy, than a technical way to solve it. There might be a way to do it while preserving reproducubility, and there might not. |
I think there's a misunderstanding, where did I say that I need a reproducible build for local development? We're using it in a workflow to update releases page where we store our contracts |
I suggested not running in parallel on one vm, but splitting it in ci to multiple vm-s with |
Oh, yes, this will work, but it looks more like a workaround instead of a solution to me |
Well, I just proposed a feature (@frol suggested me to do this), it's up to |
@frolvanya you could throw in an rfc on how nep-330 1.3.0 would look like, or how it alternatively could be fitted to fully comply with with 1.2.0 |
k |
Without a ready technical solution on how to solve it, it's just a speculation that it's a waste of ton of resources |
@dj8yfo It is not a speculation, it is obvious that incremental compilation is not leveraged if you build contracts individually on the same machine using fresh Docker container for each. Having 8+ contracts in the project it becomes really noticeable. I can imagine cargo-near taking care of workspaces support and compile each individual package inside the workspace as if it is built separately and thus no changes to the Contract Metadata is needed. However, the challenge is to think through the potential side-effects of one contract compilation on the other, and I think in the general case we cannot guarantee that building the first contract won't affect the byte-to-byte matching result of second contract compilation. Nevertheless, Incremental compilation with sccache support that only takes the incremental compilation artifacts would be nice option to explore that would not only help to address this case, but also speed up CI/CD for single-contract projects if the cache layer is persisted. I believe there is little to no risk in using incremental compilation caching and affecting reproducibility, but the productivity gains will be noticeable. |
@frol, how does sccache work when doing a push to , say , a For this build in near-sdk here in
I had some ideas how to do |
After upgrading near/near-sdk-rs#1323 rust-cache starting picking up cache for branch pushes too (not only multiple iterations inside of a single pr), so mentioning that aspect probably was not important |
Add a support to build reproducible-wasm files for all workspace at once. Right now if we have multiple contracts sharing the same dependecies we need to rebuild all of them multiple times from scratch since every build uses clean docker state. It would be great to be able to run
cargo near build reproducible-wasm
at the root of workspace and if project has a reproducible build info in toml file it would be automatically included to the build process and use only one docker instance to build all contracts at onceHere's an example where it can drastically improve build time: https://github.com/Near-One/omni-bridge/actions/runs/13065597964/job/36457334849
The text was updated successfully, but these errors were encountered: