Skip to content

build(cmake): support offline source-tarball builds - #385

Open
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:feature/offline-source-build
Open

build(cmake): support offline source-tarball builds#385
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:feature/offline-source-build

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

Two things needed to build libretroshare from a self-contained source tarball, with no network and no git metadata:

  • New option 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).
  • Version stamping without git: find_package(Git) becomes optional (git is only used to stamp versions, and every execute_process already tolerated failure via RESULT_VARIABLE), and a Source_Version file next to CMakeLists.txt is used as a fallback for RS_MAJOR/MINOR/MINI/EXTRA_VERSION and RS_LIB_VERSION_HASH. The -DRS_*_VERSION command-line route still works unchanged.

No default behavior changes: without -DRS_FETCH_MISSING_DEPS=OFF and without a Source_Version file, 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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant