Skip to content

samples: add Delphi .dproj + dcc32/dcc64.cfg so samples build under Delphi - #95

Merged
FMXExpress merged 1 commit into
mainfrom
claude/delphi-sample-projects
May 30, 2026
Merged

FMXExpress merged 1 commit into
mainfrom
claude/delphi-sample-projects

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Summary

Building any sample under Delphi fails with:

[dcc32 Fatal Error] SampleServer.dpr(52): F2613 Unit 'PasClaw.Agent' not found.
[dcc32 Fatal Error] PasClaw.Tools.WebSearch.pas(45): F2613 Unit 'PasClaw.Search.Types' not found.

samples/component-console/ previously had only .dpr source files and an FPC Makefile. The Delphi toolchain (dcc32 / dcc64 / RAD Studio / msbuild) had no search path beyond the sample directory itself, so the first PasClaw.* unit in the sample's uses clause failed; after a partial fix in user setup, the next failure landed inside the transitive PasClaw.Tools.WebSearch path on PasClaw.Search.Types.

Fix — five new files in samples/component-console/

SampleConsole.dproj
SampleSimple.dproj
SampleServer.dproj
dcc32.cfg
dcc64.cfg

Each .dproj mirrors src/pasclaw/PasClaw.dproj's structure but with the search path re-rooted at ..\..\src\:

Setting Value
DCC_UnitSearchPath every src/pkg/* directory the main pasclaw binary uses — cliui, utils, logger, config, json, providers, tokenizer, tools, mcp, gateway, channels, crypto, net, search, cron, skills, agent, memory, updater, membench, tui, platform, hashline, component, vendor/dmvcframework, plus cmd. Same 26 entries as the main dproj.
DCC_Namespace System;System.Net;System.Win;Xml;Data;Datasnap;Web;Soap;Winapi;Posix so bare SysUtils etc. resolve under modern Delphi where only System.SysUtils ships.
DCC_UnitAlias WinTypes=Winapi.Windows;WinProcs=Winapi.Windows for legacy Windows API names.
DCC_UsePackage vcl;rtl on Win32/Win64 — same as PasClaw.dproj, so Indy resolves from RAD Studio's bundled package, no vendoring on Delphi.
TargetedPlatforms Win32 + Win64. Linux64 omitted on samples since the FPC Makefile covers Linux end-to-end.
DCC_ExeOutput ..\..\build\delphi\<Platform>\<Config> to mirror PasClaw.dproj.

dcc32.cfg + dcc64.cfg are the cmdline-only complement: dcc32 auto-loads dcc32.cfg from the current directory, so

cd samples\component-console
dcc32 SampleSimple.dpr

picks up the same -U / -NS / -A flags without going through msbuild on the dproj. dcc64.cfg is a byte-for-byte copy because search-path semantics are identical for the 64-bit compiler.

GUIDs are unique per dproj. Sample .dpr headers now enumerate three build flows: make (FPC), msbuild SampleX.dproj (Delphi), dcc32 SampleX.dpr (Delphi cmdline). Sample Makefile header gets a paragraph pointing to the new dprojs and cfgs.

Verification

  • FPC sample build (make clean && make) still produces all three binaries (no regression).
  • Each new .dproj parses as well-formed XML via Python's ET.parse — full dcc32 validation requires actual Delphi which this Linux container doesn't ship.

https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon


Generated by Claude Code

Building any sample under Delphi (dcc32 / dcc64 / RAD Studio IDE /
msbuild) failed with:

  [dcc32 Fatal Error] SampleServer.dpr(52): F2613 Unit 'PasClaw.Agent' not found.
  [dcc32 Fatal Error] PasClaw.Tools.WebSearch.pas(45): F2613 Unit 'PasClaw.Search.Types' not found.

because the samples/component-console/ directory only had .dpr
source files and an FPC Makefile — no project file or compiler
config, so the Delphi toolchain had no search path beyond the
sample directory itself. First PasClaw.* unit hit failed
("PasClaw.Agent" from the sample's uses clause); after a partial
fix in user setup, the next failure landed inside the transitive
PasClaw.Tools.WebSearch path on PasClaw.Search.Types.

Fix adds three sibling project files plus shared cmdline configs:

  samples/component-console/SampleConsole.dproj
  samples/component-console/SampleSimple.dproj
  samples/component-console/SampleServer.dproj
  samples/component-console/dcc32.cfg
  samples/component-console/dcc64.cfg

Each .dproj mirrors src/pasclaw/PasClaw.dproj's structure but
with the search path re-rooted at ..\..\src\:

  DCC_UnitSearchPath  every src/pkg/* directory the main pasclaw
                      binary uses (cliui, utils, logger, config,
                      json, providers, tokenizer, tools, mcp,
                      gateway, channels, crypto, net, search, cron,
                      skills, agent, memory, updater, membench,
                      tui, platform, hashline, component, vendor/
                      dmvcframework, plus cmd) — same 26 entries
                      as the main dproj.

  DCC_Namespace       System;System.Net;System.Win;Xml;Data;
                      Datasnap;Web;Soap;Winapi;Posix
                      (so bare "SysUtils" etc. resolve under
                      modern Delphi RTL where only System.SysUtils
                      ships).

  DCC_UnitAlias       WinTypes=Winapi.Windows;
                      WinProcs=Winapi.Windows
                      (legacy Windows API unit names).

  DCC_UsePackage      vcl;rtl on Win32/Win64 — same as
                      PasClaw.dproj, so Indy resolves from the
                      RAD Studio bundled package, no vendoring on
                      Delphi.

  Targeted Platforms  Win32 + Win64. Linux64 was omitted on
                      samples since the FPC Makefile already
                      covers Linux end-to-end.

GUIDs are unique per dproj (newly generated). Output goes to
..\..\build\delphi\<Platform>\<Config>\ to mirror PasClaw.dproj's
output convention.

dcc32.cfg + dcc64.cfg are the cmdline-only complement: dcc32
auto-loads dcc32.cfg from the current dir, so

    cd samples\component-console
    dcc32 SampleSimple.dpr

picks up the same -U / -NS / -A flags without going through
msbuild on the dproj. dcc64.cfg is a byte-for-byte copy because
the search-path semantics are identical for the 64-bit compiler.

Sample .dpr headers updated to enumerate three build flows:
make (FPC), msbuild SampleX.dproj (Delphi), dcc32 SampleX.dpr
(Delphi cmdline). Sample Makefile header gets a paragraph
pointing to the new dprojs and cfgs.

Verified:

  * FPC sample build (make clean && make) still produces all three
    binaries (no regression).
  * Each new .dproj parses as well-formed XML via Python's
    ET.parse (smoke against the syntax — full validation needs
    actual dcc32 which this Linux container doesn't ship).

https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
@FMXExpress
FMXExpress merged commit 056a3bd into main May 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6e7b9aaad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,53 @@
# dcc32.cfg — shared cmdline build config for Sample{Console,Simple,Server}.dpr

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove shell-style comments from DCC configuration files

When the documented dcc32 SampleSimple.dpr flow is used from this directory, dcc32 automatically loads this file, but Delphi .cfg files contain compiler arguments rather than shell syntax and do not define # as a comment marker. The compiler therefore receives these prose lines as invalid input before it can build the sample. Embarcadero documents .cfg as a configuration file used by the command-line compilers and documents that an unrecognized option in DCC32.CFG is invalid. Remove the prose from the file or move it into separate documentation. The byte-for-byte copy in dcc64.cfg needs the same correction.

Useful? React with 👍 / 👎.

# Unit search paths — every src/pkg/* directory the main pasclaw binary
# uses, relative to samples/component-console/.
-U..\..\src\cmd
-U..\..\src\pkg\cliui

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Combine the Delphi unit-search paths into one -U switch

After the invalid comment lines are removed, the documented direct dcc32 flow still does not receive the intended search path: these repeated -U arguments replace one another, leaving only the final dmvcframework directory, so compilation cannot resolve units such as PasClaw.Agent. Embarcadero's -U documentation explicitly says to include the entire search path and separate multiple directory names with semicolons. Emit one semicolon-delimited -U argument instead. The identical sequence in dcc64.cfg has the same defect.

Useful? React with 👍 / 👎.

FMXExpress added a commit that referenced this pull request May 30, 2026
samples/agent: fix Codex reviews on merged PRs #95 + #96
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