-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir2][toolchain] reorganize third-party deps to match expectations
Summary: Reorganize deps to match the expectations of the standard fbsource machinery (see the following diff) Test Plan: ``` ❯ buck2 test fbcode//antlir/distro/toolchain/cxx/tests: fbcode//antlir/distro/toolchain/rust/tests: Buck UI: https://www.internalfb.com/buck2/868bffa6-ae4a-4a6a-93dd-0b15a29605ad Test UI: https://www.internalfb.com/intern/testinfra/testrun/5066549837190240 Network: Up: 19MiB Down: 531MiB (reSessionID-c31c7c23-abf7-4d35-a50b-619a335301a8) Jobs completed: 324844. Time elapsed: 1:20.6s. Cache hits: 0%. Commands: 97 (cached: 0, remote: 0, local: 97) Tests finished: Pass 20. Fail 0. Fatal 0. Skip 0. Build failure 0 ``` Reviewed By: naveedgol Differential Revision: D66893437 fbshipit-source-id: ba61b20f4f2c29a1e518a488a0719b4084b47996
- Loading branch information
1 parent
25522ca
commit 87a4de8
Showing
9 changed files
with
108 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
load("//antlir/distro/deps:sysroot.bzl", "sysroot_dep") | ||
|
||
oncall("antlir") | ||
|
||
sysroot_dep( | ||
name = "c", | ||
) | ||
|
||
sysroot_dep( | ||
name = "m", | ||
) | ||
|
||
sysroot_dep( | ||
name = "dl", | ||
) | ||
|
||
sysroot_dep( | ||
name = "pthread", | ||
) |
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,8 @@ | ||
load("//antlir/distro/deps:pkgconfig.bzl", "image_pkgconfig_library") | ||
|
||
oncall("antlir") | ||
|
||
image_pkgconfig_library( | ||
name = "jsoncpp", | ||
visibility = ["PUBLIC"], | ||
) |
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,29 @@ | ||
load("//antlir/distro/deps:sysroot.bzl", "sysroot_dep") | ||
|
||
oncall("antlir") | ||
|
||
prelude = native | ||
|
||
prelude.prebuilt_cxx_library( | ||
name = "stdc++", | ||
exported_linker_flags = [ | ||
"-std=c++20", | ||
"-lstdc++", | ||
], | ||
exported_preprocessor_flags = ["-std=c++20"], | ||
visibility = ["PUBLIC"], | ||
) | ||
|
||
prelude.prebuilt_cxx_library( | ||
name = "stdc++-legacy", | ||
exported_preprocessor_flags = ["-I$(location //antlir/distro/deps:sysroot)/usr/include/c++/11/backward"], | ||
visibility = ["PUBLIC"], | ||
) | ||
|
||
sysroot_dep( | ||
name = "gcc_s", | ||
) | ||
|
||
sysroot_dep( | ||
name = "atomic", | ||
) |
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,11 @@ | ||
oncall("antlir") | ||
|
||
prelude = native | ||
|
||
# This exists only because it's an implicit dep added on every cxx target. If it | ||
# becomes needed by any binaries using the antlir toolchain, someone will need | ||
# to figure out how to present it. | ||
prelude.prebuilt_cxx_library( | ||
name = "headers", | ||
visibility = ["PUBLIC"], | ||
) |
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,11 @@ | ||
load("//antlir/distro/deps:pkgconfig.bzl", "image_pkgconfig_library") | ||
|
||
oncall("antlir") | ||
|
||
image_pkgconfig_library( | ||
# Existing third-party copies of rpm are named 'librpm', so to be consistent | ||
# we use 'pkgconfig(rpm)' but name it 'librpm' | ||
name = "librpm", | ||
pkgconfig_name = "rpm", | ||
visibility = ["PUBLIC"], | ||
) |
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,21 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
def sysroot_dep( | ||
*, | ||
name: str, | ||
link: str | None = None, | ||
visibility: list[str] = ["PUBLIC"]): | ||
""" | ||
A cxx_library target that links against a library that exists in the | ||
sysroot, but does not have any pkg-config definition, just a linker flag. | ||
""" | ||
native.prebuilt_cxx_library( | ||
name = name, | ||
exported_linker_flags = [ | ||
"-l" + (link or name), | ||
], | ||
visibility = visibility, | ||
) |
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