Skip to content

Fix BUILD_GUI_VIEWERS ignoring HABITAT_BUILD_GUI_VIEWERS env var#2641

Open
Functionhx wants to merge 1 commit into
facebookresearch:mainfrom
Functionhx:fix/gui-viewers-env-var
Open

Fix BUILD_GUI_VIEWERS ignoring HABITAT_BUILD_GUI_VIEWERS env var#2641
Functionhx wants to merge 1 commit into
facebookresearch:mainfrom
Functionhx:fix/gui-viewers-env-var

Conversation

@Functionhx

Copy link
Copy Markdown

Fixes #2620

Problem

Building from source via pip install ignores the HABITAT_BUILD_GUI_VIEWERS environment variable. The pyproject.toml declares BUILD_GUI_VIEWERS = {env = "HABITAT_BUILD_GUI_VIEWERS", default = "ON"} via scikit-build-core's cmake.define, but under --no-build-isolation the resolution does not always propagate the value to CMake, leaving the cached default OFF.

Fix

Add a direct $ENV{HABITAT_BUILD_GUI_VIEWERS} check in CMakeLists.txt before the option() call so the variable is picked up unconditionally, regardless of how scikit-build-core handles cmake.define propagation. This means:

  • HABITAT_BUILD_GUI_VIEWERS=ON pip install . correctly sets BUILD_GUI_VIEWERS=ON
  • HABITAT_BUILD_GUI_VIEWERS=OFF pip install . correctly sets BUILD_GUI_VIEWERS=OFF
  • Default (no env var) still uses BUILD_GUI_VIEWERS=ON as before

Test Plan

HABITAT_BUILD_GUI_VIEWERS=ON pip install . --no-build-isolation
cat build/*/CMakeCache.txt | grep BUILD_GUI_VIEWERS  # should show ON

…ebookresearch#2620)

Building from source via pip install defaults to headless mode because
the HABITAT_BUILD_GUI_VIEWERS environment variable is ignored.  The
pyproject.toml declares BUILD_GUI_VIEWERS = {env =
"HABITAT_BUILD_GUI_VIEWERS", default = "ON"} via scikit-build-core's
cmake.define, but under --no-build-isolation the resolution does not
always propagate the value to CMake, leaving the cached default OFF.

Add a direct {HABITAT_BUILD_GUI_VIEWERS} check in CMakeLists.txt
before the option() call so the variable is picked up unconditionally,
regardless of how scikit-build-core handles cmake.define propagation.

Fixes facebookresearch#2620

Test Plan:
  HABITAT_BUILD_GUI_VIEWERS=ON pip install . --no-build-isolation
  cmake -L build/... | grep BUILD_GUI_VIEWERS  # should show ON
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.3.3 Building from source now defaults to HEADLESS and can not be set by HABITAT_BUILD_GUI_VIEWERS

1 participant