Skip to content

Commit

Permalink
Disable LTO for CLI in Makefile (CI and local builds) (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcharles authored Jul 13, 2023
1 parent a9083dc commit 0e1d3b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ bench: cli
check-bench:
cargo check --package=javy-cli --release --benches

# Disabling LTO substantially improves compile time
cli: core
cargo build --package=javy-cli --release
CARGO_PROFILE_RELEASE_LTO=off cargo build --package=javy-cli --release

core:
cargo build --package=javy-core --release --target=wasm32-wasi --features=$(CORE_FEATURES)
Expand All @@ -37,8 +38,9 @@ test-core:

# Test in release mode to skip some debug assertions
# Note: to make this faster, the engine should be optimized beforehand (wasm-strip + wasm-opt).
# Disabling LTO substantially improves compile time
test-cli: core
cargo test --package=javy-cli --release --features=$(CLI_FEATURES) -- --nocapture
CARGO_PROFILE_RELEASE_LTO=off cargo test --package=javy-cli --release --features=$(CLI_FEATURES) -- --nocapture

# WPT requires a Javy build with the experimental_event_loop feature to pass
test-wpt: export CORE_FEATURES ?= experimental_event_loop
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ $ cargo build -p javy-core --target=wasm32-wasi -r
$ cargo install --path crates/cli
```

If you are going to recompile frequently, you may want to prepend `CARGO_PROFILE_RELEASE_LTO=off` to cargo build for the CLI to speed up the build.

## Using Javy

Pre-compiled binaries of the Javy CLI can be found on [the releases page](https://github.com/bytecodealliance/javy/releases).
Expand Down

0 comments on commit 0e1d3b7

Please sign in to comment.