build(cmake): support offline source-tarball builds - #385
Open
jolavillette wants to merge 1 commit into
Open
Conversation
Add RS_FETCH_MISSING_DEPS (default ON) guarding every FetchContent network fallback: when OFF, a missing local dependency aborts the configure with an explicit error instead of silently downloading an unpinned upstream tip. Make git optional (it only stamps versions) and fall back to a Source_Version file for the library version and engine hash when git metadata is absent, so an unpacked source tarball configures offline. Needed for distribution packaging (e.g. Debian), where build-time network access is forbidden. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Two things needed to build libretroshare from a self-contained source tarball, with no network and no git metadata:
RS_FETCH_MISSING_DEPS(default ON = current behavior). When OFF, a dependency missing from the local tree aborts the configure with an explicit error naming it, instead of silently downloading an unpinned upstream tip via FetchContent. Guards all 8 FetchContent fallbacks (librnp, openpgpsdk, bitdht, rapidjson, restbed, udp-discovery-cpp, jni.hpp, cpptrace).find_package(Git)becomes optional (git is only used to stamp versions, and everyexecute_processalready tolerated failure viaRESULT_VARIABLE), and aSource_Versionfile next to CMakeLists.txt is used as a fallback forRS_MAJOR/MINOR/MINI/EXTRA_VERSIONandRS_LIB_VERSION_HASH. The-DRS_*_VERSIONcommand-line route still works unchanged.No default behavior changes: without
-DRS_FETCH_MISSING_DEPS=OFFand without aSource_Versionfile, the configure behaves exactly as today.Companion PR on the super-project side: RetroShare/RetroShare#ROOT1 (it also adds the script that produces such tarballs). Part of the groundwork for Debian packaging (Debian bug #659069), where builds are offline by policy.
🤖 Generated with Claude Code