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

Customize cargo profiles #401

Merged
merged 8 commits into from Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generate_calamari_weights_files.yml
Expand Up @@ -84,7 +84,7 @@ jobs:
CARGO_TERM_COLOR: always
run: |
source ${HOME}/.cargo/env
CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C codegen-units=1" cargo build --release --verbose --features=runtime-benchmarks
Dengjianping marked this conversation as resolved.
Show resolved Hide resolved
cargo build --profile production --verbose --features=runtime-benchmarks
-
name: stop sccache server
run: sccache --stop-server || true
Expand All @@ -93,7 +93,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: manta
path: target/release/manta
path: target/production/manta

run-benchmark:
name: benchmark (${{ matrix.benchmark.pallet.name }} ${{ matrix.benchmark.extrinsic.name }})
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate_manta_weights_files.yml
Expand Up @@ -84,7 +84,7 @@ jobs:
CARGO_TERM_COLOR: always
run: |
source ${HOME}/.cargo/env
CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C codegen-units=1" cargo build --release --verbose --features=runtime-benchmarks
cargo build --profile production --verbose --features=runtime-benchmarks
-
name: stop sccache server
run: sccache --stop-server || true
Expand All @@ -93,7 +93,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: manta
path: target/release/manta
path: target/production/manta

run-benchmark:
name: benchmark (${{ matrix.benchmark.pallet.name }} ${{ matrix.benchmark.extrinsic.name }})
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-draft-releases.yml
Expand Up @@ -155,20 +155,20 @@ jobs:
SCCACHE_DIR: /home/runner/.cache/sccache
run: |
source ${HOME}/.cargo/env
CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C codegen-units=1" cargo build --release --verbose
cargo build --profile production --verbose
-
name: stop sccache server
run: sccache --stop-server || true
-
name: strip
run: |
strip target/release/manta
strip target/production/manta
-
name: upload
uses: actions/upload-artifact@v2
with:
name: manta
path: target/release/manta
path: target/production/manta
-
name: upload
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
SCCACHE_DIR: /home/runner/.cache/sccache
run: |
source ${HOME}/.cargo/env
cargo build --verbose --release
cargo build --profile production --verbose
-
if: ${{ needs.check-for-runtime-upgrade.outputs.do-versions-match == 'false' }}
name: stop sccache server
Expand All @@ -259,14 +259,14 @@ jobs:
if: ${{ needs.check-for-runtime-upgrade.outputs.do-versions-match == 'false' }}
name: strip
run: |
strip target/release/manta
strip target/production/manta
-
if: ${{ needs.check-for-runtime-upgrade.outputs.do-versions-match == 'false' }}
name: upload
uses: actions/upload-artifact@v2
with:
name: manta-base
path: target/release/manta
path: target/production/manta
-
name: upload
uses: actions/upload-artifact@v2
Expand Down
10 changes: 9 additions & 1 deletion Cargo.toml
Expand Up @@ -8,5 +8,13 @@ members = [
'runtime/dolphin',
]

[profile.production]
inherits = "release"
codegen-units = 1
lto = true

[profile.release]
panic = "unwind"
panic = "unwind"

[profile.test]
debug = true
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -12,11 +12,12 @@
Manta is a privacy preserving DeFi stack on Polkadot/Substrate. The code currently hasn't been properly security audited (work in progress), use it at your own risk.

## Build Manta/Calamari Node
```
```bash
chmod u+x ./scripts/init.sh
./scripts/init.sh
cargo build --release
cargo b --profile production
```
> Tips: The binary will be generated under `target/production/manta`.

## Manta Developement
Currently, there are two developing branches:
Expand Down Expand Up @@ -73,4 +74,4 @@ now you can watch the ci build your awesome feature and publish your draft relea

## Minimum supported rust compiler

This project's MSRV is `rustc 1.56`
This project's MSRV is `rustc 1.57`
1 change: 1 addition & 0 deletions node/Cargo.toml
Expand Up @@ -3,6 +3,7 @@ authors = ['Manta Network']
build = 'build.rs'
description = 'Manta Parachain Node.'
edition = '2021'
rust-version = '1.57'
homepage = 'https://manta.network'
license = 'GPL-3.0'
name = 'manta'
Expand Down