Skip to content

Commit

Permalink
Add constraint to disable targets known to be broken in oss
Browse files Browse the repository at this point in the history
Summary:
- Enumerate what targets are not buildable in OSS
- Unblock making OSS buck2 builds push blocking by suppressing targets that are
  known to fail

Reviewed By: bigfootjon

Differential Revision: D64738937

fbshipit-source-id: b53219ce7216136bc966205709189697da62ec7e
  • Loading branch information
ckwalsh authored and facebook-github-bot committed Oct 23, 2024
1 parent 0872efe commit 5d0aacc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shim/cfg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def get_shim_modifiers():
modifiers = []

linux_distro = read_config("linux", "distro")
pprint(linux_distro)

if linux_distro:
modifiers.append("shim//os/linux/distro/constraints:{}".format(linux_distro))

known_broken = read_config("oss", "known_broken", "disable")
modifiers.append("shim//opensource/macros/broken_in_oss/constraints:{}".format(known_broken))

return modifiers
14 changes: 14 additions & 0 deletions shim/opensource/macros/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

config_setting(
name = "broken-in-oss",
constraint_values = [
"//opensource/macros/broken_in_oss/constraints:enable",
],
visibility = ["PUBLIC"],
)
23 changes: 23 additions & 0 deletions shim/opensource/macros/broken_in_oss/constraints/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

constraint_setting(
name = "broken_in_oss",
visibility = ["PUBLIC"],
)

constraint_value(
name = "enable",
constraint_setting = ":broken_in_oss",
visibility = ["PUBLIC"],
)

constraint_value(
name = "disable",
constraint_setting = ":broken_in_oss",
visibility = ["PUBLIC"],
)

0 comments on commit 5d0aacc

Please sign in to comment.