Skip to content

Commit

Permalink
Always compile dependenices w/ optimizations; In debug mode, lightly …
Browse files Browse the repository at this point in the history
…optimize gossip for fast compiles
  • Loading branch information
mikedilger committed Mar 30, 2024
1 parent 8a3bbfc commit a957bb4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
23 changes: 13 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [
resolver = "2"

# Force scrypt to build with release-like speed even in dev mode
[profile.devel.package.scrypt]
[profile.dev.package.scrypt]
opt-level = 3
debug-assertions = false
overflow-checks = false
Expand All @@ -17,19 +17,22 @@ egui = { git = "https://github.com/bu5hm4nn/egui", rev = "63dde4c9b311da0cae0cb
# Use the master branch of SDL2 to include a fix related to clang (and XCode after 14.2)
sdl2 = { git = "https://github.com/Rust-SDL2/rust-sdl2", rev = "f2f1e29a416bcc22f2faf411866db2c8d9536308" }

# When compiling gossip crates themselves (in 'dev' mode), optimize a little bit
# (for fast compiles of our changes)
[profile.dev]
opt-level = 1
debug = true
debug-assertions = true
overflow-checks = true
incremental = true
codegen-units = 256

# But when compiling dependencies, even in dev mode, optimize fully
# (these rarely recompile during development, so we still get fast compiles)
[profile.dev.package."*"]
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = false
incremental = false
codegen-units = 16

[profile.devel]
inherits = "dev"
opt-level = 0
debug = true
debug-assertions = true
overflow-checks = true
incremental = true
codegen-units = 256
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

#RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable"
cargo build --features=lang-cjk --release
cargo build --features=lang-cjk

6 changes: 0 additions & 6 deletions debug.sh

This file was deleted.

3 changes: 1 addition & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

#RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable"
cargo build --features=lang-cjk,video-ffmpeg --release && \
cargo build --features=lang-cjk,video-ffmpeg && \
RUST_BACKTRACE=1 RUST_LOG="warn,gossip=info,gossip_lib=info,nostr_types=info,gossip_relay_picker=info" ./target/release/gossip "$@"

0 comments on commit a957bb4

Please sign in to comment.