-
Notifications
You must be signed in to change notification settings - Fork 17
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: edit README.md for reproducible choice interactive change #265
doc: edit README.md for reproducible choice interactive change #265
Conversation
@@ -210,7 +210,7 @@ const NEW_PROJECT_FILES: &[NewProjectFile] = &[ | |||
}, | |||
NewProjectFile { | |||
file_path: "Cargo.toml", | |||
content: include_str!("new-project-template/Cargo.toml.template"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename helps with syntax highlighting on github:
https://github.com/near/cargo-near/blob/doc-reproducible-interactive/cargo-near/src/commands/new/new-project-template/Cargo.template.toml vs https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.toml.template
…ax highlighting in gh
5b56563
to
cb06e7a
Compare
a716ffe
to
2d7bc0a
Compare
2d7bc0a
to
eba71b8
Compare
README.md
Outdated
<details> | ||
<summary>Additional (optional) details on possible <code>[package.metadata.near.reproducible_build]</code> configuration</summary><p> | ||
|
||
1. available images can be found by this link https://hub.docker.com/r/sourcescan/cargo-near/tags | ||
- [`image`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.template.toml#L18) and [`image_digest`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.template.toml#L19) are straightforward to configure: | ||
![image_and_digest_pinpoint](./docs/image_and_digest_pinpoint.png) | ||
2. build command flags can be configured, if needed, by changing [`container_build_command`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.template.toml#L29) field | ||
- base `container_build_command` for images prior to **sourcescan/cargo-near:0.13.0-rust-1.83.0** is `["cargo", "near", "build"]` | ||
- base `container_build_command` for images starting with **sourcescan/cargo-near:0.13.0-rust-1.83.0** and after it is `["cargo", "near", "build", "non-reproducible-wasm", "--locked"]`, where the `--locked` flag is required | ||
- additional flags, if needed, can be looked up on | ||
- `cargo near build non-reproducible-wasm --help` for newer/latest images | ||
- `cargo near build --help` for older ones | ||
- running `docker run -it sourcescan/cargo-near:0.11.0-rust-1.82.0` (or another specific image) and checking the `--help` message of exact `cargo-near` in container may be helpful when in doubt | ||
3. `cargo near` allows parameterizing build with values of environment variables, present at the time of the build and not present in a contract's source code, | ||
by specifying their names in [`passed_env`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.template.toml#L24) array | ||
- supported by `sourcescan/cargo-near:0.10.1-rust-1.82.0` image or later images | ||
- SourceScan/Nearblocks does not support verifying such contracts yet. | ||
|
||
</p></details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
1. runs against source code version, committed to git, ignoring any uncommitted changes | ||
2. requires that `Cargo.lock` of project is created (e.g. via `cargo update`) and added to git. | ||
- this enables `--locked` build by downstream `cargo` command. | ||
3. will use configuration in [`[package.metadata.near.reproducible_build]`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.toml.template#L14-L25) | ||
section of contract's `Cargo.toml` and [`package.repository`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.toml.template#L9) field | ||
3. will use configuration in [`[package.metadata.near.reproducible_build]`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.template.toml#L14-L25) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to rename, all of the links in README are currently broken, but point to target location in main
fe57dd0
to
7dc1bdb
Compare
7dc1bdb
to
4753446
Compare
referencing SourceScan/verification-guide#1 |
@race-of-sloths include |
@dj8yfo Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: waiting for finalizationThe pull request is merged, you have 24 hours to finalize your scoring. The scoring ends Thu Dec 12 12:30:03 2024
Your contribution is much appreciated with a final score of 5! @frol received 25 Sloth Points for reviewing and scoring this pull request. What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@race-of-sloths score 5
this will look now like the following ```bash ❯ : cargo near build non-reproducible-wasm --help Runs on current filesystem state without many restrictions Usage: cargo-near near build non-reproducible-wasm [OPTIONS] Options: --locked --no-release --no-abi --no-embed-abi --no-doc --no-wasmopt --out-dir <OUT_DIR> --manifest-path <MANIFEST_PATH> --features <FEATURES> --no-default-features --color <COLOR> [possible values: auto, always, never] --env <ENV> -h, --help Print help -V, --version Print version ``` ```bash ❯ : cargo near build reproducible-wasm --help Requires `docker` config added and (git)committed to Cargo.toml, runs on clean (git)working tree state Usage: cargo-near near build reproducible-wasm [OPTIONS] Options: --no-locked --out-dir <OUT_DIR> --manifest-path <MANIFEST_PATH> --color <COLOR> [possible values: auto, always, never] -h, --help Print help -V, --version Print version ``` --- this is pending - [x] deploy cmd dispatch in current pr - [x] logic to enforce correct `container_build_command` for newer images (ones, that will be built after release of this pr) - [x] prettier indents in interactive help msgs in current pr - [x] separate pr onto current pr as base branch with tests fixed as per api change (#263) - [x] testing of this pr on a few common cases (sample-crate, factory-rust, neardevhub-contract) (in comment #262 (comment)) - [x] separate pr onto current pr as base branch with `.github/workflows` change /testing (#264) - [x] separate pr onto current pr as base branch with docs/README update (#265) - [ ] merge --------- Co-authored-by: dj8yf0μl <[email protected]>
No description provided.