Link the deploy binary with the default rust-lld, not BFD
Browse files at this commitc6d6abc86cf0d87261e4a1c73343ad688aa4f303Parent: 1666404- perf
- link the deploy binary with the default rust-lld, not BFD
1 changed file +9 -7
.github/workflows/main.ymlmodified+9 -7
| @@ -63,14 +63,16 @@ jobs: | |||
| 63 | run: | | 63 | run: | |
| 64 | set -euo pipefail | 64 | set -euo pipefail |
| 65 | # `topcoat asset bundle` runs its own `cargo build` and strips every | 65 | # `topcoat asset bundle` runs its own `cargo build` and strips every |
| 66 | - # CARGO_* variable from it, so neither the target nor its linker can | 66 | + # CARGO_* variable from it, so the target cannot be passed by |
| 67 | - # be passed by environment. They go into the cargo config that inner | 67 | + # environment; it goes into the cargo config that inner build reads. |
| 68 | - # build reads. This file is written in CI only; it is not committed. | 68 | + # This file is written in CI only; it is not committed. |
| 69 | mkdir -p .cargo | 69 | mkdir -p .cargo |
| 70 | - { | 70 | + printf '[build]\ntarget = "%s"\n' "$TARGET" >> .cargo/config.toml |
| 71 | - printf '[build]\ntarget = "%s"\n\n' "$TARGET" | 71 | + # The linker stays rustc's default (the bundled rust-lld): a warm |
| 72 | - printf '[target.x86_64-unknown-linux-musl]\nlinker = "musl-gcc"\n' | 72 | + # relink of this binary measured 142s under musl-gcc's BFD against |
| 73 | - } >> .cargo/config.toml | 73 | + # 23s under rust-lld, and that link was the largest single chunk of |
| 74 | + # the deploy build. musl-gcc remains the C compiler below — ring's | ||
| 75 | + # assembly needs it, and lld links the objects it produces. | ||
| 74 | # C dependencies (ring, under lettre's TLS) compile against musl too. | 76 | # C dependencies (ring, under lettre's TLS) compile against musl too. |
| 75 | echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> "$GITHUB_ENV" | 77 | echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> "$GITHUB_ENV" |
| 76 | 78 | ||