chore(windows): Delphi 11/12 source compatibility#16043
Conversation
User Test ResultsTest specification and instructions ERROR: user tests have not yet been defined |
|
This pull request is from an external repo and will not automatically be built. The build must still be passed before it can be merged. Ask one of the team members to make a manual build of this PR. |
mcdurdin
left a comment
There was a problem hiding this comment.
All looks okay apart from this one thing; I don't have source of Delphi 12 to confirm but it seems precisely backwards.
| // Keyman local patch: Delphi 11/12 compat (vendored JVCL). The | ||
| // OldCreateOrder property was removed in Delphi 11; the modern semantics | ||
| // are equivalent to OldCreateOrder=True, so always call DoCreate on | ||
| // VER350+. On JVCL refresh from upstream: re-apply if not yet upstreamed. |
There was a problem hiding this comment.
This seems wrong according to the documentation for OldCreateOrder.
There was a problem hiding this comment.
Thanks for the docs link — I hadn't checked Athens's own documentation, just found somewhere that mentioned OldCreateOrder was removed and applied a defensive patch. Given the JclSynch outcome, this one falls in the same bucket. Reverted in bb05693f6e. If it does turn out to be a real issue on Delphi 12 later, I'll have an actual error message to work from.
| // Keyman local patch: Delphi 11/12 compat (vendored JCL). Explicit BOOL() casts | ||
| // added below to satisfy Delphi 12's stricter implicit-Boolean->BOOL conversion. | ||
| // Backwards-compatible with Delphi 10.3 (BOOL is an ordinal-preserving typecast). | ||
| // On JCL refresh from upstream: re-apply if upstream hasn't picked up the cast. |
There was a problem hiding this comment.
Looking at this more deeply. This seems to be total nonsense!
I even took the time to try building with an unmodified JclSynch.pas to verify this -- it is completely unnecessary.
There was a problem hiding this comment.
Fair — reverted in dcef4c29cf. Thanks for actually building without it to check. I'd applied the cast because I'd read that Delphi 12 tightened Boolean→BOOL conversions and figured JCL would need updating, but I hadn't actually seen the failure. Should have tried building first.
mcdurdin
left a comment
There was a problem hiding this comment.
It looks pretty but it's pretty wrong. Some of the simpler patches are okay but the patches to jedi code are just plain wrong.
|
Any movement on this @MattGyverLee? We're need to close stale pull requests so please let me know where you plan to take this. |
Address @mcdurdin's "redundant and incorrect information" review. Drop 836 lines. Trim scope to what this PR actually introduces (KEYMAN_DELPHI_CE=1 interactive prompt) plus the CE-specific prerequisites the standard windows.md doesn't cover: - Remove content that belongs in PR keymanapp#16043 (the source-compat patches for JCL, JVCL, mbcolor, SourceRootPath, HttpServer, FixedTrackbar, CleartypeDraw, JsonUtil). Point readers there. - Delete the pre-PR engine.groupproj / insthelper workaround section - this PR removes that reference, so the workaround no longer applies to trees on this branch. - Drop internal memory-system references ([[double-bracket-wiki]]) that would render as literal text on GitHub. - Fix the VER340->'21.0' factual error (it's Delphi 10.4's real Studio path, not a CE-license rev bump). - Collapse duplicated content: uiAccess/kmshell-path explanation, install-Keyman-19 step, revert-before-PR warning, .res file handling, engine.groupproj discussion. - Fix broken cross-references to "section 5.2 step (a)/(b)" and "BSD block" that had no matching structure. - Consolidate build order and shell workflow into one section. - Convert the a-f cross-project dependency graph into a table for scanability. Doc now ~270 lines vs. 939. Scope matches the PR: what KEYMAN_DELPHI_CE=1 does, plus the CE-only setup (Library Search Paths, Keyman 19 install requirement, dependency ordering under IDE prompts). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
53f868f to
5a88d15
Compare
- §3 registry recipe: only the first six paths mirror DELPHIINCLUDES in delphi_flags.inc.sh (verified: that variable defines exactly those six). The remaining eleven JCL/JVCL/jedi paths are IDE-only and have no equivalent in the CLI build path; my earlier claim that all seventeen mirror DELPHIINCLUDES was wrong. - Replace two "see PR keymanapp#16043" references with pointers to windows.md's Delphi requirements section, which will remain the canonical entry point after 16043 merges (PR-number cross-refs age badly). - §6 debugging: add one-line acknowledgment that the content isn't CE-specific but has no other current home, per review feedback that the section drifts from the doc's stated scope. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Changes since your review:
The |
Lets the existing tree compile under Delphi 11 (VER350) and Delphi 12 (VER360) without breaking Delphi 10.3 (VER330). CI is unchanged: with KEYMAN_DELPHI_VERSION unset, every build script keeps defaulting to Delphi 10.3 (BDS 20.0) exactly as before. This is a bridge to lower contributor friction on keymanapp#4599 (deprecate Delphi). The 10.3 build server can also be upgraded to a paid Delphi 11/12 license on top of these patches if/when that's wanted. Build-script knob: * resources/build/win/configure_environment.inc.sh, resources/build/win/delphi_environment.inc.sh: DELPHI_VERSION now reads ${KEYMAN_DELPHI_VERSION:-20.0}. * resources/builder.inc.sh: builder_describe_platform's delphi tool detection respects the same KEYMAN_DELPHI_VERSION default, so machines with only Delphi 12 installed no longer have win,delphi- gated targets silently skipped. Keyman-owned source compat (additive VER350/VER360 arms; VER330 paths untouched): * common/windows/delphi/tools/devtools/SourceRootPath.pas: teach DelphiMajorVersion about BDS 22.0 / 23.0 install dirs. * common/windows/delphi/web/Keyman.System.HttpServer.Base.pas: extend the IFNDEF VER330 tripwire to accept VER340/350/360. * common/windows/delphi/components/FixedTrackbar.pas: same tripwire extension. * common/windows/delphi/general/CleartypeDrawCharacter.pas: EnumFontFamiliesEx integer-return comparison on VER340/350/360 (was VER340-only). * common/windows/delphi/general/JsonUtil.pas: pass [] options arg to TJSONAncestor.ToChars on VER350/360 (Delphi 11+ added the parameter). Vendored third-party patches (each hunk annotated with a "Keyman local patch" comment plus refresh strategy): * developer/src/ext/jedi/jcl/jcl/source/common/JclSynch.pas: wrap Boolean args to CreateEvent / OpenEvent / CreateWaitableTimer / OpenWaitableTimer / OpenSemaphore / CreateMutex / OpenMutex in explicit BOOL() casts (Delphi 12 tightened implicit Boolean->BOOL at call sites); switch JclWin32.CreateMutex -> Winapi.Windows.CreateMutex to match the file's existing pattern for the other Winapi calls. * developer/src/ext/jedi/jvcl/jvcl/run/JvComponent.pas: on VER350+, unconditionally call DoCreate (Embarcadero removed the OldCreateOrder property in Delphi 11; modern behavior is equivalent to OldCreateOrder=True). * developer/src/ext/mbcolor/mxs.inc: add VER350/VER360 blocks defining DELPHI_5_UP through DELPHI_10_UP. Without these, HTMLColors.pas silently drops Variants from its uses clause and breaks with "Undeclared identifier: 'null'". .gitignore: add patterns for per-arch version*.res and meson wraplock files. Relates-to: keymanapp#4599
Pro-tier Delphi 11/12 users had no way to discover the env-var knob introduced by this PR - it was documented only in the PR body and in the CE-workflow doc from keymanapp#16044. Add a short paragraph to the Delphi requirements section pointing at the two Studio path values and reaffirming that the unset default preserves CI behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Per @mcdurdin's review: he built with unmodified JclSynch.pas and verified the Delphi 12 compile succeeds without the BOOL casts. The patches were defensive against a compile failure I never actually observed on this file — I assumed Delphi 12's tightened implicit-Boolean handling required them without empirically checking. Removing. If a real compile failure on JclSynch shows up later, address it then with a specific error to fix rather than a preemptive patch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Per @mcdurdin's review: the OldCreateOrder-was-removed premise disagrees with the Athens documentation he linked (https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.Forms.TForm.OldCreateOrder). Given JclSynch.pas turned out to be an unnecessary defensive patch, this one deserves the same skepticism. Reverting until a specific Delphi 12 compile failure on JVCL surfaces that motivates a targeted fix. The remaining vendored ext patch (mbcolor/mxs.inc) stays because it produces a concrete E2003 Undeclared identifier: 'null' at HTMLColors.pas:290 on Delphi 12 — reproducible, not defensive. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- FixedTrackbar.pas: extend the existing 'Tested on' comment block to note VER350/VER360 IFNDEF arms are added without full verification against Vcl.Grids.pas — same self-documentation pattern @mcdurdin used when he added the 10.3 attestation line in 2019. - HttpServer.Base.pas: extend the pre-existing "may need to check" comment to name the newly-silenced tripwire arms and record that Indy's URL handling on 10.4/11/12 has not been re-verified. The workaround stays applied conservatively rather than removed optimistically. - Drop `.wraplock` .gitignore rule — Meson subproject artifact, no connection to Delphi 11/12 source compat. Scope drift. - windows.md: trim the "so CI is unaffected" tail from the KEYMAN_DELPHI_VERSION paragraph. CI default is a separate concern from the env-var default. Motivated by the same "no unverified defensive extensions" concern that led me to revert the JclSynch and JvComponent patches earlier. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
5a88d15 to
9d53e77
Compare
Address @mcdurdin's "redundant and incorrect information" review. Drop 836 lines. Trim scope to what this PR actually introduces (KEYMAN_DELPHI_CE=1 interactive prompt) plus the CE-specific prerequisites the standard windows.md doesn't cover: - Remove content that belongs in PR keymanapp#16043 (the source-compat patches for JCL, JVCL, mbcolor, SourceRootPath, HttpServer, FixedTrackbar, CleartypeDraw, JsonUtil). Point readers there. - Delete the pre-PR engine.groupproj / insthelper workaround section - this PR removes that reference, so the workaround no longer applies to trees on this branch. - Drop internal memory-system references ([[double-bracket-wiki]]) that would render as literal text on GitHub. - Fix the VER340->'21.0' factual error (it's Delphi 10.4's real Studio path, not a CE-license rev bump). - Collapse duplicated content: uiAccess/kmshell-path explanation, install-Keyman-19 step, revert-before-PR warning, .res file handling, engine.groupproj discussion. - Fix broken cross-references to "section 5.2 step (a)/(b)" and "BSD block" that had no matching structure. - Consolidate build order and shell workflow into one section. - Convert the a-f cross-project dependency graph into a table for scanability. Doc now ~270 lines vs. 939. Scope matches the PR: what KEYMAN_DELPHI_CE=1 does, plus the CE-only setup (Library Search Paths, Keyman 19 install requirement, dependency ordering under IDE prompts). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- §3 registry recipe: only the first six paths mirror DELPHIINCLUDES in delphi_flags.inc.sh (verified: that variable defines exactly those six). The remaining eleven JCL/JVCL/jedi paths are IDE-only and have no equivalent in the CLI build path; my earlier claim that all seventeen mirror DELPHIINCLUDES was wrong. - Replace two "see PR keymanapp#16043" references with pointers to windows.md's Delphi requirements section, which will remain the canonical entry point after 16043 merges (PR-number cross-refs age badly). - §6 debugging: add one-line acknowledgment that the content isn't CE-specific but has no other current home, per review feedback that the section drifts from the doc's stated scope. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
resources/build/minimum-versions.inc.sh pins KEYMAN_MIN_VERSION_EMSCRIPTEN at 3.1.64, but the windows.md walkthrough still told contributors to `emsdk install 3.1.58`. That version now fails to compile core/src/wasm.cpp because a recent Core commit (9909d7d "expose km_core_state_options_update to WASM") uses stricter emscripten pointer-binding APIs. Bumping the docs to match the pin. Discovered while running the CE build walkthrough on this branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address @mcdurdin's "redundant and incorrect information" review. Drop 836 lines. Trim scope to what this PR actually introduces (KEYMAN_DELPHI_CE=1 interactive prompt) plus the CE-specific prerequisites the standard windows.md doesn't cover: - Remove content that belongs in PR keymanapp#16043 (the source-compat patches for JCL, JVCL, mbcolor, SourceRootPath, HttpServer, FixedTrackbar, CleartypeDraw, JsonUtil). Point readers there. - Delete the pre-PR engine.groupproj / insthelper workaround section - this PR removes that reference, so the workaround no longer applies to trees on this branch. - Drop internal memory-system references ([[double-bracket-wiki]]) that would render as literal text on GitHub. - Fix the VER340->'21.0' factual error (it's Delphi 10.4's real Studio path, not a CE-license rev bump). - Collapse duplicated content: uiAccess/kmshell-path explanation, install-Keyman-19 step, revert-before-PR warning, .res file handling, engine.groupproj discussion. - Fix broken cross-references to "section 5.2 step (a)/(b)" and "BSD block" that had no matching structure. - Consolidate build order and shell workflow into one section. - Convert the a-f cross-project dependency graph into a table for scanability. Doc now ~270 lines vs. 939. Scope matches the PR: what KEYMAN_DELPHI_CE=1 does, plus the CE-only setup (Library Search Paths, Keyman 19 install requirement, dependency ordering under IDE prompts). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- §3 registry recipe: only the first six paths mirror DELPHIINCLUDES in delphi_flags.inc.sh (verified: that variable defines exactly those six). The remaining eleven JCL/JVCL/jedi paths are IDE-only and have no equivalent in the CLI build path; my earlier claim that all seventeen mirror DELPHIINCLUDES was wrong. - Replace two "see PR keymanapp#16043" references with pointers to windows.md's Delphi requirements section, which will remain the canonical entry point after 16043 merges (PR-number cross-refs age badly). - §6 debugging: add one-line acknowledgment that the content isn't CE-specific but has no other current home, per review feedback that the section drifts from the doc's stated scope. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mcdurdin
left a comment
There was a problem hiding this comment.
Getting closer - trying to reduce the excess verbiage. We don't need explanations of why a change was made as a source comment. Conversely, we don't want to lose track of the fact that we have not done the required checks to move to newer versions of Delphi, if we move the CI/core team to newer versions in the future.
| Not yet fully verified against Vcl.Grids.pas in VER350 (11) or VER360 (12); | ||
| IFNDEF arms added to unblock compilation, override behaviour retained as-is. |
There was a problem hiding this comment.
| Not yet fully verified against Vcl.Grids.pas in VER350 (11) or VER360 (12); | |
| IFNDEF arms added to unblock compilation, override behaviour retained as-is. | |
| TODO: Not yet fully verified against Vcl.Grids.pas in VER350 (11) or VER360 (12) |
| {$IFNDEF VER340} | ||
| {$MESSAGE WARN 'Not yet checked against Delphi 10.4'} |
There was a problem hiding this comment.
| {$IFNDEF VER340} | |
| {$MESSAGE WARN 'Not yet checked against Delphi 10.4'} | |
| {$IFNDEF VER360} | |
| {$IFNDEF VER350} | |
| {$IFNDEF VER340} | |
| {$MESSAGE WARN 'TODO: Trackbar scrolling on bottom cell not yet checked against Delphi 10.4, 11.0 or 12.0'} |
| {$IFNDEF VER350} | ||
| {$IFNDEF VER360} |
There was a problem hiding this comment.
| {$IFNDEF VER350} | |
| {$IFNDEF VER360} |
| {$IFNDEF VER340} | ||
| {$IFNDEF VER350} | ||
| {$IFNDEF VER360} | ||
| ERROR! Check if this is still needed with Delphi update |
There was a problem hiding this comment.
| ERROR! Check if this is still needed with Delphi update | |
| {$MESSAGE ERROR 'Check if Indy URL UTF-8 handling is still needed with Delphi update'} |
| // fixed in those versions has not been re-verified — the | ||
| // workaround stays applied conservatively. | ||
| {$IFNDEF VER330} | ||
| {$IFNDEF VER340} |
There was a problem hiding this comment.
| {$IFNDEF VER340} | |
| {$IFNDEF VER340} | |
| {$MESSAGE WARN 'TODO: Check if Indy URL UTF-8 handling is still needed with Delphi 10.4/11.0/12.0'} |
Summary
Lets the existing tree compile under Delphi 11 (
VER350) and Delphi 12 (VER360) without breaking Delphi 10.3 (VER330). Lowers contributor friction on #4599 and makes a future build-server bump to a paid Delphi 11/12 license a drop-in if/when that's wanted. CI is unchanged: withKEYMAN_DELPHI_VERSIONunset, every build script keeps defaulting to Delphi 10.3 (BDS 20.0) exactly as before.Split off from #16039 per @mcdurdin's review — that PR bundled the 11/12 compat work with the CE-specific build-chain workarounds. This PR is the compat half; the CE half is a separate PR.
Why this is in scope for the Delphi removal roadmap
Delphi 10.3 Pro is no longer obtainable, and CE 10.3 has been removed from Embarcadero's downloads. Any future build-server bump or new contributor onboarding must go to Delphi 11/12. This PR makes that bump a pure environment change rather than a chase for compile errors in vendored third-party code.
What's in the change
1. Build-script knob (CI-safe)
resources/build/win/configure_environment.inc.shDELPHI_VERSIONreads\${KEYMAN_DELPHI_VERSION:-20.0}resources/build/win/delphi_environment.inc.shresources/builder.inc.shbuilder_describe_platformdelphi-tool probe also respectsKEYMAN_DELPHI_VERSION. Without this, machines with only Delphi 12 installed had allwin,delphi-gated targets silently skippedDefault unchanged. CI doesn't set the var; nothing about the canonical 10.3 flow changes.
2. Delphi 11/12 source compat in Keyman-owned code
Five files under
common/windows/delphi/. Every change is additive IFDEF arms forVER350/VER360; theVER330(10.3) paths are untouched. Each was hit by a real compile failure on Delphi 12; the patch is the minimum needed to keep the existing code shape on 10.3 while letting it compile on 11/12.tools/devtools/SourceRootPath.pas'22.0'/'23.0'DelphiMajorVersionneeds to know the new BDS install dirsweb/Keyman.System.HttpServer.Base.pasIFNDEF VER330tripwire to also accept VER340/350/360components/FixedTrackbar.pasgeneral/CleartypeDrawCharacter.pasEnumFontFamiliesExinteger-return comparison on VER340/350/360 (was VER340-only)general/JsonUtil.pas[]options arg toTJSONAncestor.ToCharson VER350/360Optionsparameter3. Vendored third-party patches (please look here first)
WARNING: This is the highest-risk piece of the PR. Three files under
developer/src/ext/. Each hunk is annotated with a// Keyman local patchcomment plus a refresh strategy noting the upstream package and what to re-apply when those projects ship Delphi 12-compatible releases.jedi/jcl/jcl/source/common/JclSynch.pasBooleanargs toCreateEvent/OpenEvent/CreateWaitableTimer/OpenWaitableTimer/OpenSemaphore/CreateMutex/OpenMutexin explicitBOOL(); switchJclWin32.CreateMutex->Winapi.Windows.CreateMutexBOOL()is an ordinal-preserving typecast, equivalent to the implicit conversion 10.3 was doing — no runtime semantic change. The CreateMutex unit-resolution switch matches the file's existing pattern for the other Winapi callsjedi/jvcl/jvcl/run/JvComponent.pasDoCreateOldCreateOrderproperty in Delphi 11; the modern default is equivalent toOldCreateOrder=Truembcolor/mxs.incDELPHI_5_UP...DELPHI_10_UPHTMLColors.passilently dropsVariantsfrom itsusesclause and breaks with"Undeclared identifier: 'null'"4. .gitignore
Add patterns for per-arch
version*.resand mesonwraplockfiles. General build-output cleanup; not tied to either Delphi tier.Reviewer notes
OldCreateOrder=Trueis what Delphi 11 already does by default. That's the spot most worth a second pair of eyes.kmcmplib,kmc-*, Keyman Core). Those are already Delphi-free per chore(windows): Deprecate use of Delphi #4599 progress and aren't in this PR's blast radius.User Testing
User testing not required: build-environment / source-compat change with no runtime behaviour modification. CI will exercise the 10.3 default path.
Relates-to
Relates-to: #4599
Replaces: #16039 (split into this PR + #16044)