Skip to content

Commit 5e9f0a2

Browse files
committed
Option to build oss faster until we remove these
`controller` and `process_allocator` really are no longer needed to develop oss stuff, but we have to remove important testing, etc. For now, I just to be able to compile locally. This is a 3x build speed improvement because each of these binaries uses different flags for the underlying crates and causes recompiles. Differential Revision: [D86880713](https://our.internmc.facebook.com/intern/diff/D86880713/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86880713/)! ghstack-source-id: 322762604 Pull Request resolved: #1880
1 parent b68c7fc commit 5e9f0a2

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

setup.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,35 @@ def run(self):
161161
cur = os.environ.get("RUSTFLAGS", "")
162162
os.environ["RUSTFLAGS"] = (cur + " " + " ".join(flags)).strip()
163163

164+
# Check if MONARCH_BUILD_MESH_ONLY=1 to skip legacy builds
165+
SKIP_LEGACY_BUILDS = os.environ.get("MONARCH_BUILD_MESH_ONLY", "0") == "1"
164166

165-
rust_extensions = [
166-
RustBin(
167-
target="process_allocator",
168-
path="monarch_hyperactor/Cargo.toml",
169-
debug=False,
170-
),
167+
rust_extensions = []
168+
169+
# Legacy builds (kept for tests that still depend on them)
170+
if not SKIP_LEGACY_BUILDS:
171+
rust_extensions.append(
172+
RustBin(
173+
target="process_allocator",
174+
path="monarch_hyperactor/Cargo.toml",
175+
debug=False,
176+
)
177+
)
178+
179+
# Main extension (always built)
180+
rust_extensions.append(
171181
RustExtension(
172182
"monarch._rust_bindings",
173183
binding=Binding.PyO3,
174184
path="monarch_extension/Cargo.toml",
175185
debug=False,
176186
features=["tensor_engine"] if USE_TENSOR_ENGINE else [],
177187
args=[] if USE_TENSOR_ENGINE else ["--no-default-features"],
178-
),
179-
]
188+
)
189+
)
180190

181-
if USE_TENSOR_ENGINE:
191+
# Legacy controller bin (kept for tests that still depend on it)
192+
if USE_TENSOR_ENGINE and not SKIP_LEGACY_BUILDS:
182193
rust_extensions.append(
183194
RustExtension(
184195
{"controller_bin": "monarch.monarch_controller"},

0 commit comments

Comments
 (0)