Skip to content

Commit

Permalink
sort build rules lexicographically in folly/algorithm/simd/
Browse files Browse the repository at this point in the history
Summary:
Here are some ways to order the build rules:
* Lexicographically, by alphabetical name.
* Topographically, by dependencies.
* Ad-hoc, by other rules.
* Randomly.

If we want some order, then lexicographically by alphabetical name is the most straightforward. Ordering topographically by dependencies is: (1) unnecessary in the buck ecosystem, (2) difficult on maintainers, (3) not facilitated with tools, (4) non-deterministic. In contrast, ordering alphabetically by name is simpler to do with or without tools and is deterministic.

(Deterministic here means that a problem has either no solution or exactly one solution.)

Reviewed By: Orvid

Differential Revision: D64113352

fbshipit-source-id: 689286013b7cbc9bfcf33699ce57daec42d78386
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Oct 9, 2024
1 parent d05f99e commit 79c1a00
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
38 changes: 19 additions & 19 deletions folly/algorithm/simd/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@ load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
oncall("fbcode_entropy_wardens_folly")

cpp_library(
name = "ignore",
headers = ["Ignore.h"],
exported_deps = [
"//folly/lang:bits",
name = "contains",
srcs = ["Contains.cpp"],
headers = ["Contains.h"],
deps = [
"//folly/algorithm/simd/detail:simd_contains_impl",
],
)

cpp_library(
name = "movemask",
headers = ["Movemask.h"],
exported_deps = [
":ignore",
"//folly:portability",
"//folly/lang:bits",
"//folly:c_portability",
"//folly/algorithm/simd/detail:traits",
],
)

Expand All @@ -34,14 +29,19 @@ cpp_library(
)

cpp_library(
name = "contains",
srcs = ["Contains.cpp"],
headers = ["Contains.h"],
deps = [
"//folly/algorithm/simd/detail:simd_contains_impl",
name = "ignore",
headers = ["Ignore.h"],
exported_deps = [
"//folly/lang:bits",
],
)

cpp_library(
name = "movemask",
headers = ["Movemask.h"],
exported_deps = [
"//folly:c_portability",
"//folly/algorithm/simd/detail:traits",
":ignore",
"//folly:portability",
"//folly/lang:bits",
],
)
38 changes: 19 additions & 19 deletions folly/algorithm/simd/test/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
oncall("fbcode_entropy_wardens_folly")

cpp_unittest(
name = "momemask_test",
srcs = ["MovemaskTest.cpp"],
name = "contains_test",
srcs = ["ContainsTest.cpp"],
headers = [],
deps = [
"//folly:portability",
"//folly/algorithm/simd:movemask",
"//folly/algorithm/simd:contains",
"//folly/algorithm/simd/detail:simd_contains_impl",
"//folly/portability:gtest",
],
)

cpp_unittest(
name = "find_fixed_test",
srcs = ["FindFixedTest.cpp"],
headers = [],
cpp_benchmark(
name = "find_fixed_bench",
srcs = ["FindFixedBenchmark.cpp"],
deps = [
"fbsource//third-party/fmt:fmt",
"//folly:portability",
"//folly:benchmark",
"//folly/algorithm/simd:find_fixed",
"//folly/portability:gtest",
"//folly/init:init",
],
)

cpp_benchmark(
name = "find_fixed_bench",
srcs = ["FindFixedBenchmark.cpp"],
cpp_unittest(
name = "find_fixed_test",
srcs = ["FindFixedTest.cpp"],
headers = [],
deps = [
"fbsource//third-party/fmt:fmt",
"//folly:benchmark",
"//folly:portability",
"//folly/algorithm/simd:find_fixed",
"//folly/init:init",
"//folly/portability:gtest",
],
)

cpp_unittest(
name = "contains_test",
srcs = ["ContainsTest.cpp"],
name = "momemask_test",
srcs = ["MovemaskTest.cpp"],
headers = [],
deps = [
"//folly/algorithm/simd:contains",
"//folly/algorithm/simd/detail:simd_contains_impl",
"//folly:portability",
"//folly/algorithm/simd:movemask",
"//folly/portability:gtest",
],
)

0 comments on commit 79c1a00

Please sign in to comment.