forked from facebook/sapling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lld for mononoke on linux to fix github PR builds
During my recent reviewstack changes I noticed that mononoke links fine on macos, but github PRs are failing on linux with duplicate zstd symbols during linking. To fix this, switch to lld for the final link on linux. Regenerated the actions file to include the change with: ```./build/fbcode_builder/getdeps.py --allow-system-packages generate-github-actions --os-type=linux --src-dir=. --output-dir=.github/workflows --job-name="Mononoke " --job-file-prefix=mononoke_ mononoke ``` There was a small bug in getdeps.py regen that meant it missed the rust declaration so also included a fix for that Test plan: Run a build locally with ./build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. mononoke Before, zstd link errors like https://github.com/facebook/sapling/actions/runs/5432912652/jobs/9880272333: ``` /usr/bin/ld: /home/alex/local/tmp/toolbox/fbcode_builder_getdeps-ZhomeZalexZlocalZsaplingZbuildZfbcode_builder/build/mononoke/debug/deps/libzstd_sys-837ebc89eb1d31b6.rlib(zstd_lazy.o): in function `ZSTD_compressBlock_btlazy2_extDict': zstd_lazy.c:(.text.ZSTD_compressBlock_btlazy2_extDict+0x0): multiple definition of `ZSTD_compressBlock_btlazy2_extDict'; /home/alex/local/tmp/toolbox/fbcode_builder_getdeps-ZhomeZalexZlocalZsaplingZbuildZfbcode_builder/build/mononoke/debug/deps/libzstd_legacy_mononoke_sys-78a66a56bd363eb2.rlib(zstd_lazy.o):zstd_lazy.c:(.text.ZSTD_compressBlock_btlazy2_extDict+0x0): first defined here collect2: error: ld returned 1 exit status ``` After, works: ``` Compiling mononoke v0.1.0 (/home/alex/local/tmp/toolbox/fbcode_builder_getdeps-ZhomeZalexZlocalZsaplingZbuildZfbcode_builder/build/mononoke/source/eden/mononoke/server) Finished dev [unoptimized] target(s) in 1m 17s ```
- Loading branch information
Showing
6 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[manifest] | ||
name = lld | ||
|
||
[debs] | ||
lld | ||
|
||
[rpms] | ||
lld | ||
|
||
# We use the system lld where needed on linux and default linker elsewhere | ||
[build] | ||
builder = nop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# default ld on linux has duplicate symbol error, lld handles it fine. TODO: remove once need for https://github.com/mitrandir77/zstd-rs fork is gone | ||
[target.x86_64-unknown-linux-gnu] | ||
rustflags = ["-C", "link-arg=-fuse-ld=lld"] | ||
|