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

doc: refresh build instructions #5077

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 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
(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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fix alluded to: wasmerio/wasmer#2635. Once that tickles down to the wasmer we use, just cargo build --target x86_64-apple-darwin should work.


## Editors and IDEs

Majority of NEAR developers use CLion with Rust plugin as their primary IDE.

Expand Down