keymanapp / keymanapp/keyman

chore(windows): let engine.groupproj Build All work end-to-end in IDE

Open
#16,192 0 comments 0 reactions 0 assignees View on GitHub
chore windows/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

## Problem

Opening `windows/src/engine/engine.groupproj` in Delphi 12 CE loads all engine children (`keyman.exe`, `kmcomapi.dll`, `tsysinfo.exe`, `tsysinfox64.exe`) into one Project Manager window — a natural workflow for a contributor iterating on engine code. But **IDE "Build All" doesn't work end-to-end** today for two reasons:

1. **Group order is wrong**: `engine.groupproj` lists `tsysinfo` before `tsysinfox64`. `tsysinfo.dproj` embeds `tsysinfo_x64.res` which requires `tsysinfox64.exe` to have been built first. Build All tries `tsysinfo` first and fails.
2. **The .exe → .bin → .res chain lives in shell**: even in the correct order, the copy+rc step between the two Delphi builds is in `windows/src/engine/tsysinfo/build.sh` (`do_build`), not in `tsysinfo.dproj`. Delphi's Build All has no way to fire that shell step between compiling the two projects.

Result: CE contributors iterating on engine code have to walk through 4 CE prompts via the shell script even when they don't need the shell orchestration for anything else.

## Proposed fix

Two small changes:

1. **Reorder `engine.groupproj`** so `tsysinfox64` sits before `tsysinfo` in the group. Both under `` and under the `` `CallTarget` list.

2. **Add a `` to `tsysinfo.dproj`** that runs the copy + rc.exe:
```xml

copy /Y "$(ProjectDir)..\tsysinfox64\bin\Win64\Debug\tsysinfox64.exe" "$(ProjectDir)tsysinfox64.bin"
rc /nologo "$(ProjectDir)tsysinfo_x64.rc"

```
(Exact paths / Configs may need parameterisation via `$(Config)`.)

After this, IDE Build All on `engine.groupproj` produces all four engine outputs from the IDE, no CE-prompt terminal roundtrip needed.

The `build.sh` orchestration keeps working exactly as it does today (build.sh does the copy+rc BEFORE invoking `delphi_msbuild` on tsysinfo — the PreBuildEvent would just harmlessly re-run the same copy+rc, or be a no-op if the file is already fresh).

## What this does NOT solve

Other cross-project dependencies still require `build.sh` scaffolding on a fresh clone:

- `devtools -buildmessageconstants` → `MessageIdentifierConsts.pas` needed by `keyman.dproj` / `kmshell.dproj`
- `build_standards_data` codegen for BCP-47 registry `.pas` files needed by TIKE
- `kmcmplib-19.dll` (Rust build) needed by TIKE at runtime
- `regsvr32 kmcomapi.dll` at install time

So the workflow becomes: full `build.sh` chain once for codegen and vendored deps, then Build All in the IDE for engine iteration. Currently: full `build.sh` chain every time.

## Out of scope

- Same treatment for `desktop.groupproj` and `developer.groupproj`: worth investigating in a follow-up but each has its own cross-project bits (Locale codegen for desktop/setup, kmcmplib runtime for TIKE, `common_components.bpl` / `keyman_components.bpl` for both).
- This is deliberately not part of #16044 which is conservative about `.dproj` touches.

## Context

Surfaced during the CE workflow walkthrough for #16044 — testing whether the four sequential CE prompts for engine children were avoidable. Related to the broader Delphi-12-CE contributor onboarding work under [#4599](https://github.com/keymanapp/keyman/issues/4599).

Contributor guide

Open the contributing guide

Research direction

Start with windows/src/engine/engine.groupproj and windows/src/engine/tsysinfo/tsysinfo.dproj, then read windows/src/engine/tsysinfo/build.sh to compare the existing copy and rc steps. Test Build All in Delphi 12 CE after the project changes. Done means the four engine outputs build end-to-end in the IDE without CE prompts, while build.sh still works.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.