From 91d9be5194041406854875b3a653a151613241d4 Mon Sep 17 00:00:00 2001 From: Toastconcern Date: Sat, 24 Oct 2026 16:40:40 -0500 Subject: [PATCH] Frame Home release builds keep libdeflate and load only what SteamOS has; Studio builds without a payload outside CI - CI installs libdeflate-dev and CMake prefers its static library: APK homes unpack as fast as with the headset-built programs, with no new dependency. - build-frame-home.sh --ci fails when a headset program needs a library beyond libc/libm/libdl/libpthread/libstdc++/libgcc_s. - Studio's CMake requires a complete payload only in CI (or with FRAME_HOME_REQUIRE_PAYLOAD); a developer build without one warns, leaves out frame/, and Install on Steam Frame says the headset files are missing. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 5 +++-- scripts/build-frame-home.sh | 9 +++++++++ studio/CMakeLists.txt | 20 +++++++++++++++++--- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81a0339..8294fb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,7 +197,7 @@ jobs: sudo mkdir -p "$APT_CACHE_DIR/archives/partial" sudo chown _apt:root "$APT_CACHE_DIR/archives/partial" sudo apt-get update - sudo apt-get -o Dir::Cache::archives="$APT_CACHE_DIR/archives" install -y ccache cmake ninja-build gcc-13 g++-13 glslc zip + sudo apt-get -o Dir::Cache::archives="$APT_CACHE_DIR/archives" install -y ccache cmake ninja-build gcc-13 g++-13 glslc zip libdeflate-dev sudo chown -R "$(id -u):$(id -g)" "$APT_CACHE_DIR/archives" - name: Build payload and installer run: sh scripts/build-frame-home.sh --ci diff --git a/CMakeLists.txt b/CMakeLists.txt index 50df305..ae18578 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set_source_files_properties("${TP}/qhe/cook/hzanim_acl.cpp" PROPERTIES COMPILE_OPTIONS "-flax-vector-conversions") endif() target_link_libraries(frame-scene PUBLIC miniz lzma smolv ${ASTCENC_LIB} pthread) -# libdeflate when the system has it (the Frame): APK scene.zips inflate several times faster than with miniz. -find_library(LIBDEFLATE_LIB deflate) +# libdeflate when the system has it (the Frame, CI): APK scene.zips inflate several times faster than with miniz. Its +# static library first, so a release build doesn't need it installed on the headset. +find_library(LIBDEFLATE_LIB NAMES libdeflate.a deflate) find_path(LIBDEFLATE_INC libdeflate.h) if(LIBDEFLATE_LIB AND LIBDEFLATE_INC) target_compile_definitions(frame-scene PUBLIC QHE_HAVE_LIBDEFLATE) diff --git a/scripts/build-frame-home.sh b/scripts/build-frame-home.sh index 5072822..a7f9ee3 100755 --- a/scripts/build-frame-home.sh +++ b/scripts/build-frame-home.sh @@ -66,6 +66,15 @@ for binary in "$PAYLOAD/bin/"* "$PAYLOAD/layer/libframe_home_layer.so"; do echo "$binary requires $highest, newer than the glibc 2.39 baseline" >&2 exit 1 fi + # Release builds load only what every SteamOS has (OpenVR and Vulkan are found at run time, libdeflate is linked in). + if [ "$MODE" = ci ]; then + extra=$(readelf -d "$binary" | sed -n 's/.*(NEEDED).*\[\(.*\)\]/\1/p' | + grep -vxE 'libc\.so\.6|libm\.so\.6|libdl\.so\.2|libpthread\.so\.0|libstdc\+\+\.so\.6|libgcc_s\.so\.1|ld-linux-aarch64\.so\.1' || true) + if [ -n "$extra" ]; then + echo "$binary needs libraries a headset may not have: $(echo $extra)" >&2 + exit 1 + fi + fi done { diff --git a/studio/CMakeLists.txt b/studio/CMakeLists.txt index 1647320..d2d1255 100644 --- a/studio/CMakeLists.txt +++ b/studio/CMakeLists.txt @@ -22,11 +22,23 @@ set(FRAME_HOME_PAYLOAD_DIR "$ENV{FRAME_HOME_PAYLOAD_DIR}" CACHE PATH "Built Fram if(NOT FRAME_HOME_PAYLOAD_DIR) set(FRAME_HOME_PAYLOAD_DIR "${ROOT}/frame/payload") endif() +# A release must carry it (CI: GitHub sets CI); a developer's build without one still builds, and its Install on Steam +# Frame says the headset files are missing. +option(FRAME_HOME_REQUIRE_PAYLOAD "Fail when the Frame Home payload is incomplete" "$ENV{CI}") +set(FRAME_HOME_PAYLOAD_COMPLETE ON) foreach(FRAME_HOME_FILE install.sh bin/frame-home bin/frame-switcher bin/fenv-tool layer/libframe_home_layer.so layer/env_ps.spv) if(NOT EXISTS "${FRAME_HOME_PAYLOAD_DIR}/${FRAME_HOME_FILE}") - message(FATAL_ERROR "Frame Home payload is incomplete; build or download it and set FRAME_HOME_PAYLOAD_DIR (${FRAME_HOME_FILE} missing)") + set(FRAME_HOME_PAYLOAD_COMPLETE OFF) + set(FRAME_HOME_MISSING "${FRAME_HOME_FILE}") endif() endforeach() +if(NOT FRAME_HOME_PAYLOAD_COMPLETE) + set(FRAME_HOME_PAYLOAD_HELP "build or download it and set FRAME_HOME_PAYLOAD_DIR (${FRAME_HOME_MISSING} missing)") + if(FRAME_HOME_REQUIRE_PAYLOAD) + message(FATAL_ERROR "Frame Home payload is incomplete; ${FRAME_HOME_PAYLOAD_HELP}") + endif() + message(WARNING "Frame Home payload is incomplete, so this Studio can't install Frame Home; ${FRAME_HOME_PAYLOAD_HELP}") +endif() if(WIN32) add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS VK_USE_PLATFORM_WIN32_KHR) @@ -166,8 +178,10 @@ if(APPLE) set_target_properties(frame-studio PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Frame Studio" MACOSX_BUNDLE_GUI_IDENTIFIER "com.framestudio.app") endif() # Frame Home's headset side (arm64 binaries + install.sh) ships beside the exe, in frame\: Frame > Install on Steam Frame. -add_custom_command(TARGET frame-studio POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${FRAME_HOME_PAYLOAD_DIR}" "$/frame") +if(FRAME_HOME_PAYLOAD_COMPLETE) + add_custom_command(TARGET frame-studio POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${FRAME_HOME_PAYLOAD_DIR}" "$/frame") +endif() if(MINGW) # MinGW builds (x64, x86 and ARM64): wWinMain entry point, no runtime DLLs to ship target_link_options(frame-studio PRIVATE -municode -static) endif()