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

Feat: use zld for macOS x86 linker to reduce compile times for binaries #3470

Closed
sambacha opened this issue Oct 10, 2022 · 2 comments
Closed
Labels
T-meta Type: meta

Comments

@sambacha
Copy link
Contributor

sambacha commented Oct 10, 2022

Dramatically reduce macOS x86 compile times for binaries

Describe the feature you would like

Utilize zld for linker. macOS has recently introduced dylb improvements, you can find out more here: https://developer.apple.com/videos/play/wwdc2022/110362/?time=729

Savings of at least ~23mins

The feature I would like I have already validated. Simply use zld in CI to achieve tis.

Current compilation time for x86 MacOS

Finished release [optimized] target(s) in 31m 32s

Improved compilation time for x86 MacOS

Finished release [optimized] target(s) in 8m 34s

gh clone foundry-rs/foundry && cd foundry
RUSTFLAGS="-Clink-arg=-fuse-ld=/Users/sbacha/zld/build/Build/Products/Release/zld" cargo build --release

How to utilize this for CI?

Naive first pass

wget https://github.com/michaeleisel/zld/releases/download/1.3.8/zld.zip
unzip zld.zip
RUSTFLAGS="-Clink-arg=-fuse-ld=$PWD/zld" cargo build --release

Built Artifact

Grab the compiled binary here: https://github.com/sambacha/foundry/releases/tag/rc-macos-x86-zld-lld

Additional Information

rust-lang/rust#39915
rust-lang/compiler-team#510
https://hackmd.io/YJQSj_nLSZWl2sbI84R1qA?view

Additional context

No response

@sambacha sambacha added the T-feature Type: feature label Oct 10, 2022
@gakonst gakonst added this to Foundry Oct 10, 2022
@gakonst gakonst moved this to Todo in Foundry Oct 10, 2022
@sambacha sambacha changed the title Dramatically reduce macOS x86 compile times for binaries Feat: use zld for macOS x86 linker to reduce compile times for binaries Oct 10, 2022
@sambacha
Copy link
Contributor Author

@sambacha
Copy link
Contributor Author

Additionally

https://github.com/foundry-rs/foundry/actions/runs/3213033243/jobs/5252598883#step:6:541

https://github.com/foundry-rs/foundry/actions/runs/3213033243/jobs/5252598883#step:6:795

     Summary [ 594.568s] 478/538 tests run: 476 passed (1 slow, 3 flaky), 2 failed, 59 skipped
   FLAKY 2/4 [   7.097s]        foundry-cli::it config::can_set_solc_explicitly
   FLAKY 4/4 [  16.098s]        foundry-cli::it config::can_set_yul_optimizer
   FLAKY 2/4 [  46.243s]        foundry-cli::it script::can_broadcast_script_skipping_simulation
  TRY 4 FAIL [  11.617s]        foundry-cli::it script::can_execute_script_command_fqn
  TRY 3 FAIL [  10.304s]        foundry-cli::it script::can_execute_script_command_with_returned
error: test run failed
Error: Process completed with exit code 100.

@rkrasiuk rkrasiuk added T-meta Type: meta and removed T-feature Type: feature labels Oct 11, 2022
@gakonst gakonst closed this as completed Oct 14, 2022
Repository owner moved this from Todo to Done in Foundry Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-meta Type: meta
Projects
Archived in project
Development

No branches or pull requests

3 participants