Skip to content

Commit 2379dea

Browse files
committed
[Setup] Handle env variable DEBUG = ""
Summary: This was not handled and run into `int("")` failing. Test Plan: Locally tested installing with `export DEBUG=""`. Reviewers: Subscribers: Tasks: Resolves #8311 Tags:
1 parent 78752a0 commit 2379dea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def write_to_python_file(cls, path: str) -> None:
169169
# set to a non-empty value, the build type is Debug. Otherwise, the build type
170170
# is Release.
171171
def get_build_type(is_debug=None) -> str:
172-
debug = int(os.environ.get("DEBUG", 0)) if is_debug is None else is_debug
172+
debug = int(os.environ.get("DEBUG", 0) or 0) if is_debug is None else is_debug
173173
cfg = "Debug" if debug else "Release"
174174
return cfg
175175

@@ -239,11 +239,11 @@ def src_path(self, installer: "InstallerBuildExt") -> Path:
239239
srcs = tuple(cmake_cache_dir.glob(self.src))
240240
if len(srcs) != 1:
241241
raise ValueError(
242-
f"""Expected exactly one file matching '{self.src}'; found {repr(srcs)}.
242+
f"""Expected exactly one file matching '{self.src}'; found {repr(srcs)}.
243243
244244
If that file is a CMake-built extension module file, and we are installing in editable mode, please disable the corresponding build option since it's not supported yet.
245245
246-
Try:
246+
Try:
247247
248248
EXECUTORCH_BUILD_FLATC=OFF EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=OFF pip install -e .
249249
"""

0 commit comments

Comments
 (0)