Skip to content

Commit

Permalink
feat: use make install-slim to speed up (ci) build (#4218)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 authored Apr 18, 2024
1 parent 87dffb2 commit c4fc0b2
Show file tree
Hide file tree
Showing 7 changed files with 541 additions and 458 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/forest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ jobs:
run: |
sudo make install-deps
- name: Cargo Install
run: make install
env:
# To minimize compile times: https://nnethercote.github.io/perf-book/build-configuration.html#minimizing-compile-times
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
run: make install-slim-quick
- uses: actions/upload-artifact@v4
with:
name: 'forest-${{ runner.os }}'
Expand Down
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 22 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ bls-signatures = { version = "0.15", default-features = false, features = [
"blst-portable",
] } # prevent SIGINT on CI runners by using portable assembly
blstrs = { version = "0.7", features = ["portable"] }
boa_engine = "0.18"
boa_interner = "0.18"
boa_parser = "0.18"
boa_runtime = "0.18"
byteorder = "1.5.0"
bytes = "1.2"
cbor4ii = { version = "0.2.14", default-features = false, features = ["use_alloc", "use_std"] }
Expand All @@ -40,8 +36,6 @@ chrono = { version = "0.4", default-features = false, features = ["clock"] }
cid = { version = "0.10", default-features = false, features = ["std"] }
clap = { version = "4.5", features = ["derive"] }
colored = "2.0"
# memory leak, see https://github.com/tokio-rs/console/pull/501
console-subscriber = { version = "0.2", features = ["parking_lot"] }
convert_case = "0.6.0"
crypto_secretbox = "0.1.1"
daemonize-me = "2.0"
Expand Down Expand Up @@ -130,7 +124,6 @@ libsecp256k1 = "0.7"
lru = "0.12"
memmap2 = "0.9"
memory-stats = "1.1"
mimalloc = { version = "0.1.39", optional = true, default-features = false }
multiaddr = "0.18"
multimap = "0.10.0"
nom = "7.1.3"
Expand Down Expand Up @@ -191,23 +184,32 @@ tar = "0.4"
tempfile = "3.10"
thiserror = "1.0"
ticker = "0.1"
tikv-jemallocator = { version = "0.5", optional = true }
tokio = { version = "1", features = ['full'] }
tokio-stream = { version = "0.1", features = ["fs", "io-util"] }
tokio-util = { version = "0.7.9", features = ["compat", "io-util"] }
toml = "0.8"
tower = { version = "0.4", features = ["full"] }
tracing = "0.1"
tracing-appender = "0.2"
tracing-chrome = "0.7"
tracing-loki = { version = "0.2", default-features = false, features = ["compat-0-2-1", "rustls"] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
unsigned-varint = { version = "0.8", features = ["codec"] }
url = { version = "2.3", features = ["serde"] }
uuid = { version = "1.7", features = ["v4", "serde"] }
walkdir = "2"
zstd = "0.13"

# Optional deps
boa_engine = { version = "0.18", optional = true }
boa_interner = { version = "0.18", optional = true }
boa_parser = { version = "0.18", optional = true }
boa_runtime = { version = "0.18", optional = true }
## memory leak, see https://github.com/tokio-rs/console/pull/501
console-subscriber = { version = "0.2", features = ["parking_lot"], optional = true }
mimalloc = { version = "0.1.39", optional = true, default-features = false }
tikv-jemallocator = { version = "0.5", optional = true }
tracing-chrome = { version = "0.7", optional = true }
tracing-loki = { version = "0.2", default-features = false, features = ["compat-0-2-1", "rustls"], optional = true }

[target.'cfg(unix)'.dependencies]
termios = "0.3"

Expand Down Expand Up @@ -258,15 +260,22 @@ overflow-checks = true

# These should be refactored (probably removed) in #2984
[features]
default = ["jemalloc"]
doctest-private = [] # see lib.rs::doctest_private
benchmark-private = [] # see lib.rs::benchmark_private
default = ["jemalloc", "tokio-console", "tracing-loki", "tracing-chrome", "attach"]
slim = ["rustalloc", "attach"]
doctest-private = [] # see lib.rs::doctest_private
benchmark-private = [] # see lib.rs::benchmark_private

# Allocator
rustalloc = []
jemalloc = ["dep:tikv-jemallocator"]
mimalloc = ["dep:mimalloc"]

tokio-console = ["dep:console-subscriber"]
tracing-loki = ["dep:tracing-loki"]
tracing-chrome = ["dep:tracing-chrome"]

attach = ["dep:boa_engine", "dep:boa_interner", "dep:boa_parser", "dep:boa_runtime"]

[[bench]]
name = "example-benchmark"
harness = false
Expand Down
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ install-daemon:
install:
cargo install --locked --path . --force


install-quick:
cargo install --profile quick --locked --path . --force

install-slim:
cargo install --no-default-features --features slim --locked --path . --force

install-slim-quick:
cargo install --profile quick --no-default-features --features slim --locked --path . --force

install-minimum:
cargo install --no-default-features --locked --path . --force

install-minimum-quick:
cargo install --profile quick --no-default-features --locked --path . --force

# Installs Forest binaries with default rust global allocator
install-with-rustalloc:
cargo install --locked --path . --force --no-default-features --features rustalloc
Expand Down Expand Up @@ -66,8 +82,9 @@ lint: license clean lint-clippy
# This should be simplified in #2984
# --quiet: don't show build logs
lint-clippy:
cargo clippy --quiet --no-deps -- --deny=warnings
cargo clippy --tests --quiet --no-deps -- --deny=warnings
cargo clippy --all-targets --quiet --no-deps -- --deny=warnings
cargo clippy --all-targets --no-default-features --features slim --quiet --no-deps -- --deny=warnings
cargo clippy --all-targets --no-default-features --quiet --no-deps -- --deny=warnings
cargo clippy --benches --features benchmark-private --quiet --no-deps -- --deny=warnings

DOCKERFILES=$(wildcard Dockerfile*)
Expand Down
Loading

0 comments on commit c4fc0b2

Please sign in to comment.