Skip to content

Add local LCM source mode workflow#762

Open
johnml1135 wants to merge 2 commits intomainfrom
liblcm_debug
Open

Add local LCM source mode workflow#762
johnml1135 wants to merge 2 commits intomainfrom
liblcm_debug

Conversation

@johnml1135
Copy link
Contributor

@johnml1135 johnml1135 commented Mar 13, 2026

Summary

  • replace the old local liblcm overlay flow with an explicit local-source workflow rooted at Localizations/LCM
  • add FieldWorks.LocalLcm.sln, repo-wide UseLocalLcmSource wiring, and build.ps1 -LcmMode Auto|Package|Local
  • add VS Code package/local launchers plus a prelaunch wrapper that skips rebuilds when no relevant saved files changed
  • refresh local LCM runtime outputs into Output/Debug for VS Code symbol loading and keep portable PDBs for the clr debugger path
  • update setup and architecture docs to describe the nested-checkout workflow and remove the old overlay script

Review findings addressed

  • fixed a local-source bootstrap deadlock by bootstrapping SIL.LCModel.Build.Tasks.dll from source when local artifacts are missing
  • fixed the VS Code prelaunch change detector so directory-level deletes and renames trigger rebuilds instead of launching stale binaries

Validation

  • ./build.ps1 -LcmMode Local -ManagedDebugType portable -SkipDependencyCheck
  • ./Build/Agent/Invoke-VsCodeDebugBuild.ps1 -LcmMode Local -ManagedDebugType portable

This change is Reviewable

Copilot AI review requested due to automatic review settings March 13, 2026 19:07
@github-actions

This comment has been minimized.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the previous “overlay/copy local liblcm outputs” approach with an explicit, repo-wide local-source mode rooted at Localizations/LCM, including dedicated build entrypoints and improved VS Code debugging ergonomics.

Changes:

  • Introduces -LcmMode Auto|Package|Local and -ManagedDebugType into build.ps1, plus local-source detection/state reporting and runtime-output syncing for VS Code symbols.
  • Adds FieldWorks.LocalLcm.sln and MSBuild wiring (UseLocalLcmSource, package→project reference switching, build-task bootstrapping).
  • Updates developer setup + VS Code tasks/launchers, and improves toolchain discovery (MSVC path selection).

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/Agent/Copy-LocalLcm.ps1 Removes the old “copy locally-built LCM DLLs over NuGet outputs” flow.
build.ps1 Adds LcmMode + ManagedDebugType, local-source selection, and symbol/runtime-output refresh.
Src/Common/SimpleRootSite/EditingHelper.cs Disposes VwPropertyStoreManaged via using.
Src/Common/FwUtils/FwUtilsTests/TestFwStylesheetTests.cs Disposes VwPropertyStoreManaged in tests via using.
Src/Common/FieldWorks/FieldWorks.csproj Enables unmanaged debugging for the FieldWorks project.
Src/Common/Controls/Widgets/FontHeightAdjuster.cs Disposes VwPropertyStoreManaged via using.
Setup-Developer-Machine.ps1 Installs .NET SDK 8.x when missing; adjusts helper-repo cloning/junction behavior for worktrees; clones liblcm nested.
FieldWorks.LocalLcm.sln Adds a dedicated solution that includes local liblcm projects for local-source mode.
Docs/architecture/liblcm-local-source-checklist.md Documents the migration checklist and expectations for local-source mode.
Docs/architecture/liblcm-debugging.md Adds detailed debugging guidance for package vs local-source liblcm workflows.
Docs/architecture/dependencies.md Points dependency debugging guidance to the new liblcm debugging doc and summarizes the workflow.
DistFiles/Parts/StandardParts.xml Adds new part definitions (ImportResidue/Pictures).
Directory.Build.targets Adds package→project reference switching for LCM + build-task bootstrapping/validation targets.
Directory.Build.props Adds UseLocalLcmSource defaults for FieldWorks.LocalLcm and redirects LCM paths/artifacts to nested checkout.
Build/Src/FwBuildTasks/Make.cs Improves MSVC tool path detection under modern VS layouts.
Build/Agent/Invoke-VsCodeDebugBuild.ps1 Adds VS Code prelaunch build wrapper with change detection + mode/debug-type stamping.
Build/Agent/FwBuildEnvironment.psm1 Prefers HostX64\x64 MSVC bin path early in PATH.
.vscode/tasks.json Adds explicit package/local build tasks and “prepare debug” tasks; defaults Build to -LcmMode Auto.
.vscode/launch.json Adds package vs local-LCM launch configs with prelaunch tasks + symbol search paths.
.vscode/extensions.json Recommends the official C# extension while keeping Dev Kit unwanted (ReSharper-first).
.serena/project.yml Adds Serena config keys for line ending and read-only memory patterns.

Comment on lines +29 to +32
<part id="CmObject-Detail-ImportResidue" type="detail">
</part>
<part id="CmObject-Detail-Pictures" type="detail">
</part>
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

NUnit Tests

    1 files  ±  0      1 suites  ±0   6m 34s ⏱️ +21s
4 058 tests  - 356  3 987 ✅  - 340  71 💤  - 16  0 ❌ ±0 
4 067 runs   - 356  3 996 ✅  - 340  71 💤  - 16  0 ❌ ±0 

Results for commit d5ae8e7. ± Comparison against base commit dc5f62b.

This pull request removes 382 and adds 26 tests. Note that renamed tests count towards both.
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedHeading
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedList
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedProperName_NotParaStart
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedProperName_ParaStart
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedTableCellHead
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedTitle
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ Footnotes_TreatedSeparately
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ GetLengthOfChar
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ LCaseInRunAfterNote
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ LCaseInRunAfterPicture
…
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ BasicAscii_EachCharSeparate
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ CombiningDiacriticFollowsBase_GroupedWithBase
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ DiacriticsPrecedeBase_DiacriticBeforeBase_ThenAnotherBase
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ DiacriticsPrecedeBase_DiacriticSeparateFromFollowingBase
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ DiacriticsPrecedeBase_MultipleDiacritics_EachSeparate
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ Digits_EachSeparate
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ EmptyString_ReturnsEmpty
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ GetReferences_EmptyLines_Skipped
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ GetReferences_ReturnsCorrectOffsetsAndLengths
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ GetReferences_SupplementaryCharacters_CorrectOffsets
…

♻️ This comment has been updated with latest results.

@johnml1135
Copy link
Contributor Author

Cleaned up this PR to match the review feedback and the split described in the local-source plan.

What changed:

  • split the Windows build-toolchain work into a separate PR: Improve Visual Studio toolchain detection for Windows builds #766
  • removed the toolchain-only files from this branch:
    • Build/Agent/FwBuildEnvironment.psm1
    • Build/Agent/Verify-FwDependencies.ps1
    • Build/Src/FwBuildTasks/Make.cs
  • removed the unrelated DistFiles/Parts/StandardParts.xml change from this branch
  • removed the planning/checklist markdown that was only used to drive the implementation:
    • Docs/architecture/liblcm-local-source-plan.md
    • Docs/architecture/liblcm-local-source-checklist.md
  • squashed the remaining liblcm workflow work on this branch down to one commit for easier review

What remains in this PR is the local liblcm source-mode implementation and the supporting docs/debugger/build-flow changes that are directly part of that workflow.

The split toolchain PR is here for separate review: #766

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.

2 participants