Bundle the native library via the code/<platform>/ extension layout#50
Merged
Merged
Conversation
Pivot to the intended way of shipping native code with an LCB extension: the
per-platform library lives INSIDE the extension under code/<platform>/, and the
engine resolves the c:box2dxt> bindings from there at load time. No loose .so,
no /usr/lib, no sudo, no LD_LIBRARY_PATH, no per-stack loader code -- one
extension carries its library, the same on Linux/macOS/Windows.
- tools/package-extension.py: assembles a ready-to-Package folder (box2dxt.lcb
+ code/<platform>/box2dxt.{so,dll,dylib} from prebuilt/). Open the result in
Extension Builder and Package -> .lce.
- src/box2dxt-kit.livecodescript: drop the Linux preload auto-call from b2kSetup
-- the code/ bundle supersedes it, and that call leaned on the c:> bindings
(which resolve against engine-exe symbols and proved unreliable).
- examples/*: re-synced embedded Kit.
- examples/box2dxt-selftest: remove stTestLoaderHelper (tested the obsolete
preload path) and bump kStHarnessV 19->20.
- .gitignore: ignore the assembled dist/box2dxt-extension/ artifact.
The b2LoadNativeLib* handlers stay as optional manual fallbacks (uncalled).
Assumes OXT honors the code/<platform>/ layout -- folder names follow current
LiveCode docs and may need tweaking for OXT (see the script header).
https://claude.ai/code/session_01EVV5fGeXqtWs8WDrmgWNku
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.
What & why
Ship the native library the intended LCB way: bundled inside the extension under
code/<platform>/, which the engine resolves thec:box2dxt>bindings from at load time. One extension carries its own library — no loose.so, no/usr/lib, no sudo, noLD_LIBRARY_PATH, no per-stack loader code, the same on Linux/macOS/Windows. This supersedes the whole preload/Kit-gating line of work (#46–#48), which was all working around not knowing about this layout.Changes
tools/package-extension.py(new) — assembles a ready-to-Package folder:box2dxt.lcb+code/<platform>/box2dxt.{so,dll,dylib}pulled fromprebuilt/. Open the result in OXT's Extension Builder → Package →.lce. Verified it assembles all five platform slots.src/box2dxt-kit.livecodescript— removed the Linux preload auto-call fromb2kSetup. Thecode/bundle replaces it, and that call leaned on thec:>bindings, which (we now know from the Windows test) resolve against the engine executable's symbols and don't reliably reach libc.examples/*— re-synced embedded Kit.examples/box2dxt-selftest.livecodescript— removedstTestLoaderHelper(it tested the obsolete preload path) and bumpedkStHarnessV19→20..gitignore— ignore the assembleddist/box2dxt-extension/artifact.The
b2LoadNativeLib*handlers stay in the.lcbas optional manual fallbacks (uncalled).The one assumption to confirm in OXT
That OXT honors the
code/<platform>/resource layout, and the folder names. I used the current LiveCode docs' spelling —linux-x86_64,linux-x86,win-x86_64,win-x86,universal-mac— but these have drifted across releases. The packager makes them easy to adjust (CODE_LAYOUT/--mac-folder). Confirm against an existing native OXT extension's layout, or the engine source.Test
Open
dist/box2dxt-extension/box2dxt.lcbin Extension Builder, Package, install the.lce, then with the.so/.dllnowhere else on the system: open a demo (orput b2Version()→4). If it loads from inside the extension, this is the clean cross-platform answer and we can retire the preload machinery entirely.https://claude.ai/code/session_01EVV5fGeXqtWs8WDrmgWNku
Generated by Claude Code