Skip to content

Commit

Permalink
Remove custom sets implementation
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/folly#2323

Buck2's Starlark now natively supports this

Reviewed By: ckwalsh

Differential Revision: D64765124

fbshipit-source-id: ed5283e3d194aefebd7728c7a6a7534eaea7b162
  • Loading branch information
bigfootjon authored and facebook-github-bot committed Oct 22, 2024
1 parent 4aac336 commit f7ebd02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 240 deletions.
236 changes: 0 additions & 236 deletions shim/lib/new_sets.bzl

This file was deleted.

7 changes: 3 additions & 4 deletions shim/shims.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@bazel_skylib//lib:new_sets.bzl", "sets")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@prelude//utils:selects.bzl", "selects")
# @lint-ignore-every FBCODEBZLADDLOADS
Expand Down Expand Up @@ -100,7 +99,7 @@ def _update_headers_with_src_headers(src_headers, out_headers):
"""
Helper function to update raw headers with headers from srcs
"""
src_headers = sets.to_list(sets.difference(src_headers, sets.make(out_headers)))
src_headers = list(src_headers.difference(out_headers))

# Looks simple, right? But if a header is explicitly added in, say, a
# dictionary mapping, we want to make sure to keep the original mapping
Expand Down Expand Up @@ -167,9 +166,9 @@ def cpp_library(
)
auto_headers = get_auto_headers(auto_headers)
if auto_headers == AutoHeaders.SOURCES and not is_select(srcs):
src_headers = sets.make(_get_headers_from_sources(srcs))
src_headers = set(_get_headers_from_sources(srcs))
if private_headers:
src_headers = sets.difference(src_headers, sets.make(private_headers))
src_headers = src_headers.difference(set(private_headers))

headers = selects.apply(
headers,
Expand Down

0 comments on commit f7ebd02

Please sign in to comment.