From 7f730e82c50d5f3072cc48d498bf3f9cc66420ab Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 25 Oct 2021 16:24:28 +0300 Subject: [PATCH 1/2] doc: refresh build instructions Notably, explain how to compile nearcore on M1 closes #3803 --- CONTRIBUTING.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 59cd4154c31..6fa6b08a0ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,7 +49,7 @@ The `test plan` should describe in detail what tests are presented, and what cas ### After the PR is submitted 1. We have a CI process configured to run all the sanity tests on each PR. If the CI fails on your PR, you need to fix it before it will be reviewed. -2. Once the CI passes, you should expect the first feedback to appear within 48 hours. +2. Once the CI passes, you should expect the first feedback to appear within 48 hours. The reviewers will first review your tests, and make sure that they can convince themselves the test coverage is adequate before they even look into the change, so make sure you tested all the corner cases. If you would like to request review from a specific review, feel free to do so [through the github UI](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review). 3. Once you address all the comments, and your PR is accepted, we will take care of merging it. @@ -61,11 +61,21 @@ If you want to propose an idea or a feature and work on it, create a new issue i You should expect someone to comment on the issue within 48 hours after it is created. If the proposal in the issue is accepted, you should then follow the process for `Working on current tasks` above. -# Setting up the environment +# Build Process -We use nightly Rust features, so you will need nightly rust installed. If you use [rustup](https://rust-lang.github.io/rustup/index.html) the appropriate nightly is picked automatically from the `rust-toolchain` file. +Nearcore is a reasonably standard Rust project, so `cargo test` most likely will just work. +There are couple of specifics though: -Building `nearcore` requires `libclang`, see [`bindgen` documentation](https://rust-lang.github.io/rust-bindgen/requirements.html#clang) for installation instructions. +* `nearcore` assumes UNIX-like environment. + You can compile and run it on Linux or Mac, but windows is supported yet. +* `nearcore` build process includes generating bindings to RocksDB via `bindgen`, which requires `libclang`. + See [`bindgen` documentation](https://rust-lang.github.io/rust-bindgen/requirements.html#clang) for installation instructions. +* At the moment, `nearcore` only supports compiling for x86_64 architecture + (for technical reasons, we have to care about CPU architecture, and supporting one is easier). + To compile to x86_64 on Apple silicon, use `rustup set default-host x86_64-apple-darwin` command. + That is, cross-compilation sadly doesn't work at the time of writing, although the fix is in the pipeline. + +## Editors and IDEs Majority of NEAR developers use CLion with Rust plugin as their primary IDE. From 8fafa47374b589718db2676e5df9302f9ee23217 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 25 Oct 2021 18:16:50 +0300 Subject: [PATCH 2/2] Update CONTRIBUTING.md Co-authored-by: Bowen Wang --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6fa6b08a0ea..db7c0ca7728 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,7 @@ Nearcore is a reasonably standard Rust project, so `cargo test` most likely will There are couple of specifics though: * `nearcore` assumes UNIX-like environment. - You can compile and run it on Linux or Mac, but windows is supported yet. + You can compile and run it on Linux or Mac, but windows is not supported yet. * `nearcore` build process includes generating bindings to RocksDB via `bindgen`, which requires `libclang`. See [`bindgen` documentation](https://rust-lang.github.io/rust-bindgen/requirements.html#clang) for installation instructions. * At the moment, `nearcore` only supports compiling for x86_64 architecture