Skip to content

Commit

Permalink
chore: minor fixes in readme and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth committed Mar 23, 2024
1 parent 6b94be4 commit 4200844
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
31 changes: 16 additions & 15 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cargo Makefile

# linting
# -- linting --------------------------------------------------------------------------------------
[tasks.format]
toolchain = "nightly"
command = "cargo"
Expand Down Expand Up @@ -35,16 +35,19 @@ args = ["fix", "--allow-staged", "--allow-dirty", "--all-targets", "--all-featur
description = "Runs all linting tasks (Clippy, fixing, formatting)"
run_task = { name = ["format", "format-check", "clippy", "docs"] }

# testing
[tasks.test]
disabled = true
# --- docs ----------------------------------------------------------------------------------------
[tasks.doc]
env = { "RUSTDOCFLAGS" = "-D warnings" }
command = "cargo"
args = ["doc", "--all-features", "--keep-going", "--release"]

[tasks.test-default-serde]
description = "Run tests with default features and serde"
# --- testing -------------------------------------------------------------------------------------
[tasks.test]
description = "Run tests with default features"
env = { "RUSTFLAGS" = "-C debug-assertions -C overflow-checks -C debuginfo=2" }
workspace = false
command = "cargo"
args = ["test", "--release", "--features", "default,serde"]
args = ["test", "--release"]

[tasks.test-no-default-features]
description = "Run tests with no-default-features"
Expand All @@ -56,20 +59,18 @@ args = ["test", "--release", "--no-default-features"]
[tasks.test-all]
description = "Run all tests"
workspace = false
env = { "RUSTFLAGS" = "-C debug-assertions -C overflow-checks -C debuginfo=2" }
run_task = { name = ["test-default-serde", "test-no-default-features"], parallel = true }
run_task = { name = ["test", "test-no-default-features"], parallel = true }

# documenting
[tasks.doc]
env = { "RUSTDOCFLAGS" = "-D warnings" }
# --- building ------------------------------------------------------------------------------------
[tasks.build]
description = "Build in release mode"
command = "cargo"
args = ["doc", "--verbose", "--all-features", "--keep-going", "--release"]
args = ["build", "--release"]

# building
[tasks.build-no-std]
description = "Build using no-std"
command = "cargo"
args = ["build", "--no-default-features", "--target", "wasm32-unknown-unknown", "--workspace", "--exclude", "miden-mock"]
args = ["build", "--release", "--no-default-features", "--target", "wasm32-unknown-unknown"]

[tasks.build-avx2]
description = "Build using AVX2 acceleration"
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Miden Crypto
<a href="https://github.com/0xPolygonMiden/miden-crypto/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="https://github.com/0xPolygonMiden/crypto/actions/workflows/ci.yml"><img src="https://github.com/0xPolygonMiden/crypto/actions/workflows/ci.yml/badge.svg?branch=main"></a>
<img src="https://img.shields.io/badge/rustc-1.75+-lightgray.svg">
<a href="https://crates.io/crates/miden-crypto"><img src="https://img.shields.io/crates/v/miden-crypto"></a>

[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/0xPolygonMiden/crypto/blob/main/LICENSE)
[![RUST_VERSION](https://img.shields.io/badge/rustc-1.75+-lightgray.svg)]()
[![CRATE](https://img.shields.io/crates/v/miden-crypto)](https://crates.io/crates/miden-crypto)
[![test](https://github.com/0xPolygonMiden/crypto/actions/workflows/test.yml/badge.svg)](https://github.com/0xPolygonMiden/crypto/actions/workflows/test.yml)

This crate contains cryptographic primitives used in Polygon Miden.

Expand Down Expand Up @@ -71,9 +72,9 @@ The best way to test the library is using our `Makefile.toml` and [cargo-make](h
cargo make test-all
```

As an example some of the functions are heavy and might take a while for the tests to complete if using simply `cargo test`. In order to test in release and optimized mode, we have to replicate the test conditions of the development mode so all debug assertions can be verified.
For example, some of the functions are heavy and might take a while for the tests to complete if using simply `cargo test`. In order to test in release and optimized mode, we have to replicate the test conditions of the development mode so all debug assertions can be verified.

We do that by enabling some special [flags](https://doc.rust-lang.org/cargo/reference/profiles.html) for the compilation (which we have set as a default in our [Makefile.toml](Makefile.toml):
We do that by enabling some special [flags](https://doc.rust-lang.org/cargo/reference/profiles.html) for the compilation (which we have set as a default in our [Makefile.toml](Makefile.toml)):

```shell
RUSTFLAGS="-C debug-assertions -C overflow-checks -C debuginfo=2" cargo test --release
Expand Down

0 comments on commit 4200844

Please sign in to comment.