Skip to content

Support launching FW Lite on Linux in the lexicon extension#2427

Merged
imnasnainaec merged 3 commits into
developfrom
pb-ext-linux-fwlite
Jul 9, 2026
Merged

Support launching FW Lite on Linux in the lexicon extension#2427
imnasnainaec merged 3 commits into
developfrom
pb-ext-linux-fwlite

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

The lexicon extension refused to start on anything but Windows: launchFwLite hardcoded fw-lite/FwLiteWeb.exe behind a win32 guard, and task build-fw-lite published only the host RID. FW Lite already ships on Linux and Platform.Bible runs on Ubuntu, so this makes the extension's embedded FwLiteWeb backend follow.

  • Select the FwLiteWeb binary per createProcess.osData.platform and let linux through the guard. macOS stays unsupported pending MacOS dotnet publish results in NativeAOT error #1603.
  • Publish self-contained win-x64 and linux-x64 builds to public/fw-lite/<rid>/, so one extension package bundles both platforms. This roughly doubles package size — the alternative from the issue is per-platform packages; happy to switch if that's preferred.
  • No exec-bit workaround needed: paranext-core's createProcess.spawn chmods the command on POSIX before spawning (paranext-core PT-3250), which repairs the executable bit lost in the zip → extension-install path. Cross-publishing linux-x64 from a Windows host is fine because FwLiteWeb is plain self-contained (no NativeAOT/trimming/single-file).

Notes for reviewers:

  • Devs with existing publish output directly under public/fw-lite/ should delete that directory once; the new layout is public/fw-lite/{win-x64,linux-x64} and stale root-level output would still get copied into the package by webpack's CopyPlugin.
  • The stable-data-dir work in Pass stable data dir to FW Lite to survive extension version updates #2385 is not in develop yet; once it lands, its USERPROFILE + backslash path handling needs the Linux treatment too (issue point 2).
  • Still to verify on an actual Ubuntu machine: process launch, REST API on :29348, graceful shutdown (issue point 4).

Closes #2425

🤖 Generated with Claude Code

Devin: https://app.devin.ai/review/sillsdev/languageforge-lexbox/pull/2427

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ea7a61e8-52bb-4d95-9e74-53c49ca24ff4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The build task for the Platform.Bible lexicon extension now publishes FwLiteWeb separately for win-x64 and linux-x64 into distinct directories. The launch logic replaces the hardcoded Windows-only binary path with a helper that resolves the binary path based on the detected platform.

Changes

Cross-platform FW Lite build and launch

Layer / File(s) Summary
Per-platform publish output
platform.bible-extension/Taskfile.yml
build-fw-lite runs two dotnet publish commands targeting win-x64 and linux-x64, each writing to its own output directory, replacing the prior single combined publish.
Platform-based binary path resolution
platform.bible-extension/src/main.ts
Adds getFwLiteBinaryPath(platform) to select the FwLiteWeb binary for win32 or linux (throwing for unsupported platforms), and updates launchFwLite to derive binaryPath from this helper instead of a hardcoded Windows path and platform guard.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: 💻 FW Lite

Suggested reviewers: myieye

Poem

A rabbit hops on Windows snow,
then bounds to Linux, don't you know!
One build, two paths, a binary each,
now Ubuntu's within our reach. 🐧🪟
Hop, hop, hooray — cross-platform play!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning [#2425] Launch and packaging are addressed, but Linux/Windows data-dir resolution and path separator handling are not implemented. Add platform-aware home-dir and data-dir resolution, including Auth:CacheFileName path handling, then verify on Ubuntu.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changes stay within the Linux launch and FW Lite packaging scope described by the issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main change: enabling FW Lite launch support on Linux.
Description check ✅ Passed The description is directly related to the Linux support and packaging changes in the pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pb-ext-linux-fwlite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread platform.bible-extension/Taskfile.yml
@imnasnainaec imnasnainaec marked this pull request as ready for review July 8, 2026 09:47
@imnasnainaec

Copy link
Copy Markdown
Collaborator Author

@alex-rawlings-yyc Could you test out this pr?

The platform.bible-extension README (https://github.com/sillsdev/languageforge-lexbox/blob/pb-ext-linux-fwlite/platform.bible-extension/README.md#to-install) has steps for setting it up.

@alex-rawlings-yyc

Copy link
Copy Markdown

@imnasnainaec everything seems to run. Build was successful and I was able to access the FW Lite page in my browser.

Select the FwLiteWeb binary per platform instead of hardcoding the
Windows exe behind a win32 guard, and publish self-contained win-x64
and linux-x64 builds so one extension package runs on both platforms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@imnasnainaec imnasnainaec force-pushed the pb-ext-linux-fwlite branch from d6d33e2 to 1d68cfc Compare July 8, 2026 16:48
@imnasnainaec imnasnainaec requested a review from hahn-kev July 8, 2026 16:49
getFwLiteDataDir used the Windows-only USERPROFILE env var and hardcoded
backslash separators. Removing the platform guard in launchFwLite exposed
this on Linux, where launching the packaged backend would throw (no
USERPROFILE) and, if worked around, write to garbled backslash paths.

Pick the home env var by platform (HOME on Linux/Mac) and assemble all
paths, including the msal.json auth cache, with the platform separator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@imnasnainaec

Copy link
Copy Markdown
Collaborator Author

@imnasnainaec everything seems to run. Build was successful and I was able to access the FW Lite page in my browser.

@alex-rawlings-yyc There was a non-trivial merge conflict to resolve. Would you mind confirming it still works on Linux?

@alex-rawlings-yyc

Copy link
Copy Markdown

@imnasnainaec all appears to be well

@hahn-kev hahn-kev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I do think we should use a path join helper if one is available.

Comment thread platform.bible-extension/src/main.ts
Comment thread platform.bible-extension/src/main.ts
@imnasnainaec imnasnainaec merged commit 7953ad1 into develop Jul 9, 2026
7 checks passed
@imnasnainaec imnasnainaec deleted the pb-ext-linux-fwlite branch July 9, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support running the Platform.Bible lexicon extension on Ubuntu/Linux

3 participants