Skip to content

ci: fix the Windows MFC build, the branch triggers, and the placeholder test job - #56

Closed
nhatvu148 wants to merge 2 commits into
port/cross-platformfrom
ci/fix-windows-build
Closed

nhatvu148 wants to merge 2 commits into
port/cross-platformfrom
ci/fix-windows-build

Conversation

@nhatvu148

Copy link
Copy Markdown
Collaborator

The pipeline was red on every branch, including the untouched master commit — this is pre-existing breakage, not fallout from the port work. Three independent problems.

1. windows-latest no longer ships MFC

error MSB8041: MFC libraries are required for this project.

windows-latest has rolled to VS 18 (C:\Program Files\Microsoft Visual Studio\18\Enterprise), and that image doesn't include MFC/ATL. The project is <UseOfMfc>Dynamic</UseOfMfc> on PlatformToolset v143, so it can't build there at all.

Pinned to windows-2022, which matches v143, plus a vswhere check that installs Microsoft.VisualStudio.Component.VC.ATLMFC on demand if a future image drops it — so this fails with a clear message instead of MSB8041 deep inside the build.

2. The triggers didn't do what they looked like

branches-ignore: ['*'] was meant to disable push builds. It doesn't: * does not match /, so port/cross-platform and phase*/ branches triggered runs while master did not — the exact inverse of the intent. And pull_request only fired for PRs into master, so PRs into the port branch (#54, #55) got no checks at all.

Both are now explicit, and cover master and the port branches.

3. std::locale::empty() broke the build on current toolsets

src/PathUtil.cpp(925,37): error C4996: 'std::locale::empty'  [STL4048]

A non-Standard Microsoft extension, now deprecated. Because the project sets <SDLCheck>true</SDLCheck>, /sdl escalates C4996 from warning to error — so the build breaks on any toolset newer than whatever the team has locally.

Added _SILENCE_LOCALE_EMPTY_DEPRECATION_WARNING to the four ClCompile configurations. That's Microsoft's documented macro for this case and changes no behaviour.

Deliberately not fixing the call site. The obvious rewrites are not equivalent — locale::empty() yields a locale with no facets, locale() copies the current global locale, locale::classic() is the C locale. This sits inside FileContentToUtf8, so choosing wrong changes how files decode: a data-correctness bug in a text editor. That needs someone who can actually run the app.

It has a deadline — the extension is slated for removal, not just deprecation. Worth a follow-up issue.

Only locale::empty() is affected. The codecvt_utf8 deprecations in PathUtil.cpp, AppUtil.cpp and VinaTextApp.cpp are C++17-only and the project builds stdcpp14, so they don't fire yet — they will if the standard is ever raised.

4. Replaced the placeholder test job

The old test job pulled in a third-party VSTest action and then ran echo Tests succeeded. Replaced with two real jobs:

Job What it does
data-verify Round-trips Packages/data-packages/*.json against the C++ tables in src/EditorColor{Light,Dark}.h
core-tests Builds and runs core/tests on ubuntu + macos with -Wall -Wextra -Werror

Both probe for their inputs and skip cleanly on branches that don't have them, so this PR is safe to merge ahead of #55, which is what adds core/ and tools/.

Result

All four jobs green, and the Windows job produces a real VinaText.exe artifact (2.3 MB), so it's building rather than silently no-op'ing.

success  MFC build (Release|x64)          2m08s
success  Verify extracted language data     11s
success  core/ tests (ubuntu-latest)         7s
success  core/ tests (macos-latest)         10s

Why this matters beyond going green

Per D5 the MFC frontend must keep building throughout the port, and per D4 that work now lives on a long-lived branch rather than master. The Windows job is the only thing checking that. Until it existed, every Phase 1–2 task was unverifiable for anyone not on Windows — which is the whole team's constraint on this port.

Suggest merging this first, then rebasing #54 and #55 onto it so they pick up real checks.

The pipeline was red on every branch, including the untouched master commit.
Three separate problems:

1. windows-latest has rolled to VS 18, whose image no longer ships MFC/ATL.
   The project is <UseOfMfc>Dynamic</UseOfMfc> on toolset v143, so the build
   died with 'error MSB8041: MFC libraries are required for this project'.
   Pinned to windows-2022, which matches v143, plus a vswhere check that
   installs the ATLMFC component on demand if a future image drops it.

2. 'branches-ignore: [*]' was meant to disable push builds but '*' does not
   match '/', so port/cross-platform and phase*/ branches triggered runs while
   master did not. And pull_request only fired for PRs into master, so PRs into
   the port branch got no checks at all. Both triggers are now explicit.

3. The 'test' job only echoed 'Tests succeeded' and pulled in a third-party
   VSTest action to do it. Replaced with two real jobs:

     data-verify  round-trips Packages/data-packages/*.json against the C++
                  tables in src/EditorColor{Light,Dark}.h
     core-tests   builds and runs core/tests on ubuntu and macos with
                  -Wall -Wextra -Werror

   Both probe for their inputs and skip cleanly on branches that lack them, so
   this workflow is safe to merge ahead of the branches that add core/.

The Windows build is the regression test that matters: D5 requires the MFC
frontend to keep building throughout the port, and on a long-lived branch (D4)
this job is the only thing checking it.
src/PathUtil.cpp:925 calls std::locale::empty(), a non-Standard Microsoft
extension. Newer MSVC STL versions deprecate it (STL4048), and because the
project builds with <SDLCheck>true</SDLCheck>, /sdl escalates C4996 from a
warning to an error - so the build fails on any toolset newer than the one the
team happens to have locally:

  PathUtil.cpp(925,37): error C4996: 'std::locale::empty'

Added _SILENCE_LOCALE_EMPTY_DEPRECATION_WARNING to the four ClCompile
configurations. This is the suppression macro Microsoft documents for exactly
this case and it changes no behaviour.

Deliberately NOT changing the call site. The obvious rewrites are not
equivalent: locale::empty() yields a locale with no facets, locale() copies the
current global locale, and locale::classic() is the C locale. This sits in
FileContentToUtf8, so getting it wrong changes how files decode - a
data-correctness risk in a text editor. That needs someone who can run the app
to decide, which is a follow-up, not a CI fix.

Note the extension is slated for removal, not just deprecation, so the real fix
has a deadline.

Only locale::empty() is affected. The codecvt_utf8 deprecations elsewhere in
PathUtil.cpp, AppUtil.cpp and VinaTextApp.cpp are C++17-only and the project
builds as stdcpp14, so they do not fire.
@nhatvu148

Copy link
Copy Markdown
Collaborator Author

Closing — this work has moved to a fork at https://github.com/nhatvu148/VinaText while the port is in progress, so that automated review tooling can run against it.

Nothing is lost; the equivalent PRs there are:

A single consolidated PR will be opened against vinadevs/VinaText once the work is ready for upstream review. The branch created here is being deleted; master and the release_1.x branches are untouched.

Worth flagging independently of the port, since it affects the shipping build today: CI on master is currently red. windows-latest has rolled to VS 18, which no longer ships MFC/ATL (error MSB8041), and src/PathUtil.cpp:925 uses std::locale::empty(), which newer MSVC toolsets deprecate and <SDLCheck>true</SDLCheck> escalates to an error. Both fixes are in nhatvu148#1.

@nhatvu148 nhatvu148 closed this Jul 27, 2026
@nhatvu148
nhatvu148 deleted the ci/fix-windows-build branch July 27, 2026 04:35
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