Repository navigation
build: degrade BUILD_FFI gracefully when src/ffi is absent - #1265
Merged
Merged
Conversation
The src/ffi sources were dropped from git in d62be40 but the add_subdirectory(src/ffi) hook and the BUILD_FFI=ON presets came back, so every preset failed to configure on a clean checkout. Guard the subdirectory on src/ffi actually existing: a checkout that carries the (private) FFI sources still builds winuxcore.dll, while a clean checkout configures successfully with a clear warning instead of a hard error. BUILD_FFI is also declared as a real option again (the declaration was removed in d62be40 but its comment survived). Fixes #1261
Member
Author
|
Non-blocking, for the record: the with-source posture (src/ffi restored from d62be40^) configures fine and winuxcore lands in build.ninja; its link line uses /WHOLEARCHIVE:winuxcmd-commands without the .lib suffix (unlike the main exe), harmless while FFI stays dead code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1261
Problem
BUILD_FFI=ON(set by every preset inCMakePresets.json) could not configure on a clean checkout:add_subdirectory(src/ffi)fails because thesrc/ffisources were removed from git ind62be40("build: remove dead FFI integration") while the subdirectory hook and theBUILD_FFI=ONpresets came back in2097a07. TheBUILD_FFIoption declaration itself was also dropped ind62be40— only its comment survived — so the variable only existed via preset cache entries.Fix
Ticket option 3 (private component → detect + degrade, documented):
option(BUILD_FFI ...)(default OFF) where its orphaned comment still sits.add_subdirectory(src/ffi)withEXISTS src/ffi/CMakeLists.txt:winuxcore.dllas before;CMake Warningexplaining the sources are not distributed and how to silence it, andBUILD_FFIis forced OFF for that configure.CMakePresets.jsonis unchanged — presets keepBUILD_FFI=ONso a checkout that has the sources still builds the FFI library.Verification
scripts/build-with-vs.ps1 -ConfigureOnlyon this clean worktree (nosrc/ffi): configure succeeds —FFI Library: DISABLED(same as before).-DBUILD_FFI=ON: configure succeeds, emitsCMake Warning: BUILD_FFI=ON but src/ffi is not present in this checkout (the FFI sources are not distributed with the repository). Continuing with the FFI library disabled; pass -DBUILD_FFI=OFF to silence this warning.No I18N impact: the new text is a CMake configure-time message; the catalog extractor only scans
.cpp/.cppm/.h/.hpp.