Skip to content

Default to prebuilt liblbug (fixes #12) - #13

Merged
adsharma merged 1 commit into
mainfrom
fix/issue-12-prebuilt-default
Oct 7, 2026
Merged

adsharma merged 1 commit into
mainfrom
fix/issue-12-prebuilt-default

Conversation

@adsharma

@adsharma adsharma commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #12.

Fresh clones and downstream packages previously evaluated the from-source cxx-ladybug target by default, whose ~1183 generated files under Sources/cxx-ladybug/ladybug/ are never committed, so any consumer adding the package without LBUG_USE_PREBUILT set failed at manifest load (Source files for target cxx-ladybug should be located under 'Sources/cxx-ladybug').

This PR makes the prebuilt target the default (env opt-out instead of opt-in):

  • Package.swift and its collect-ladybug-src template now treat any LBUG_USE_PREBUILT value other than 0 as prebuilt.
  • LBUG_TARGET_DIR defaults to <package>/lib derived from #filePath, so dependent packages link without extra configuration once scripts/download-liblbug.sh has run in their checkout (the old relative lib only resolved for root builds).
  • Checks in Sources/cxx-ladybug-prebuilt/include/lbug.h (v0.21.2) so the module's C API is available without running the download script; the updater refreshes it from the submodule on each version bump.
  • download-liblbug.sh header copy is compare-and-skip with a chmod fallback (package checkouts land read-only).
  • ExtensionTests ALGO-install gate matches the new default.
  • CI: desktop/example jobs exercise the zero-config default; the iOS simulator job explicitly opts into the source build (no iOS prebuilt yet); docs job downloads the prebuilt library first.
  • README documents the prebuilt default, the checkout-local download step for downstream consumers, and the LBUG_USE_PREBUILT=0 source opt-in.

Verified: root swift build / swift test with no env (108 tests, 0 failures, 1 designed ALGO-binary skip), and a fresh URL-based consumer that resolves with no env and — after the checkout-local download — builds, links, and runs a live query.

Follow-up (already noted in #12): a prebuilt XCFramework remains the proper long-term fix, especially for iOS/Xcode consumers.

…lds)

Fresh clones and downstream packages previously evaluated the from-source
cxx-ladybug target by default, whose ~1183 generated files under
Sources/cxx-ladybug/ladybug/ are never committed, so any consumer adding
the package without LBUG_USE_PREBUILT set failed at manifest load.

Make the prebuilt target the default (env opt-out instead of opt-in):
- Package.swift and its collect-ladybug-src template now treat any
  LBUG_USE_PREBUILT value other than "0" as prebuilt.
- Default LBUG_TARGET_DIR to <package>/lib derived from #filePath, so
  dependent packages link without extra configuration once
  scripts/download-liblbug.sh has run in their checkout (the old
  relative "lib" only resolved for root builds).
- Check in Sources/cxx-ladybug-prebuilt/include/lbug.h (v0.21.2) so the
  module's C API is available without running the download script; the
  updater refreshes it from the submodule on each version bump.
- Match the new default in ExtensionTests' ALGO-install gate.
- CI: desktop/example jobs exercise the zero-config default; the iOS
  simulator job explicitly opts into the source build (no iOS prebuilt
  yet); docs job downloads the prebuilt library before generating docs.
- README documents the prebuilt default, the checkout-local download
  step for downstream consumers, and the LBUG_USE_PREBUILT=0 source
  opt-in (including iOS).

Fixes #12.
@adsharma
adsharma merged commit c071a7c into main Oct 7, 2026
7 checks passed
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.

Default (non-prebuilt) cxx-ladybug target references files that aren't in the repo

1 participant