Skip to content

Commit 654eb34

Browse files
ahornbymeta-codesync[bot]
authored andcommitted
rename SystemdBuilder to MesonBuilder
Summary: Tidy up. Rename to MesonBuilder as builders are meant to be per orchestrated build system, not per project using them SystemD is missing a lot of currently implicit deps but not tackling that here Reviewed By: bigfootjon Differential Revision: D89555877 fbshipit-source-id: c7d579310e61d09a17ef641b6c020b31cc95da8f
1 parent e9097b0 commit 654eb34

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

build/fbcode_builder/getdeps/builder.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ def _build(self, reconfigure) -> None:
501501
self._check_cmd(install_cmd, env=env)
502502

503503

504-
class SystemdBuilder(BuilderBase):
505-
# SystemdBuilder assumes that meson build tool has already been installed on
504+
class MesonBuilder(BuilderBase):
505+
# MesonBuilder assumes that meson build tool has already been installed on
506506
# the machine.
507507
def __init__(
508508
self,
@@ -515,7 +515,7 @@ def __init__(
515515
build_dir,
516516
inst_dir,
517517
) -> None:
518-
super(SystemdBuilder, self).__init__(
518+
super(MesonBuilder, self).__init__(
519519
loader,
520520
dep_manifests,
521521
build_opts,
@@ -532,15 +532,18 @@ def _build(self, reconfigure) -> None:
532532
if meson is None:
533533
raise Exception("Failed to find Meson")
534534

535+
setup_args = self.manifest.get_section_as_args("meson.setup_args", self.ctx)
536+
535537
# Meson builds typically require setup, compile, and install steps.
536538
# During this setup step we ensure that the static library is built and
537539
# the prefix is empty.
538540
self._check_cmd(
539541
[
540542
meson,
541543
"setup",
542-
"-Dstatic-libsystemd=true",
543-
"-Dprefix=/",
544+
]
545+
+ setup_args
546+
+ [
544547
self.build_dir,
545548
self.src_dir,
546549
]

build/fbcode_builder/getdeps/manifest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
CMakeBuilder,
1919
Iproute2Builder,
2020
MakeBuilder,
21+
MesonBuilder,
2122
NinjaBootstrap,
2223
NopBuilder,
2324
OpenSSLBuilder,
2425
SetupPyBuilder,
2526
SqliteBuilder,
26-
SystemdBuilder,
2727
)
2828
from .cargo import CargoBuilder
2929
from .expr import parse_expr
@@ -116,6 +116,7 @@
116116
"make.build_args": {"optional_section": True},
117117
"make.install_args": {"optional_section": True},
118118
"make.test_args": {"optional_section": True},
119+
"meson.setup_args": {"optional_section": True},
119120
"header-only": {"optional_section": True, "fields": {"includedir": REQUIRED}},
120121
"shipit.pathmap": {"optional_section": True},
121122
"shipit.strip": {"optional_section": True},
@@ -689,8 +690,8 @@ def create_builder( # noqa:C901
689690
inst_dir,
690691
)
691692

692-
if builder == "systemd":
693-
return SystemdBuilder(
693+
if builder == "meson":
694+
return MesonBuilder(
694695
loader,
695696
dep_manifests,
696697
build_options,

build/fbcode_builder/manifests/systemd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ name = systemd
55
systemd
66
systemd-devel
77

8-
[download]
9-
url = https://github.com/systemd/systemd/archive/refs/tags/v256.7.tar.gz
10-
sha256 = 896d76ff65c88f5fd9e42f90d152b0579049158a163431dd77cdc57748b1d7b0
118

9+
[download]
10+
url = https://github.com/systemd/systemd/archive/refs/tags/v256.7.tar.gz
11+
sha256 = 896d76ff65c88f5fd9e42f90d152b0579049158a163431dd77cdc57748b1d7b0
1212

13-
[build]
14-
builder = systemd
13+
[build.os=linux]
14+
builder = meson
1515
subdir = systemd-256.7
16+
17+
[meson.setup_args]
18+
-Dstatic-libsystemd=true
19+
-Dprefix=/

0 commit comments

Comments
 (0)