Repository navigation
samples: add Delphi .dproj + dcc32/dcc64.cfg so samples build under Delphi - #95
Conversation
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
There was a problem hiding this comment.
💡 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 | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Building any sample under Delphi fails with:
samples/component-console/previously had only.dprsource files and an FPCMakefile. The Delphi toolchain (dcc32/dcc64/ RAD Studio /msbuild) had no search path beyond the sample directory itself, so the firstPasClaw.*unit in the sample'susesclause failed; after a partial fix in user setup, the next failure landed inside the transitivePasClaw.Tools.WebSearchpath onPasClaw.Search.Types.Fix — five new files in
samples/component-console/Each
.dprojmirrorssrc/pasclaw/PasClaw.dproj's structure but with the search path re-rooted at..\..\src\:DCC_UnitSearchPathsrc/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_NamespaceSystem;System.Net;System.Win;Xml;Data;Datasnap;Web;Soap;Winapi;Posixso bareSysUtilsetc. resolve under modern Delphi where onlySystem.SysUtilsships.DCC_UnitAliasWinTypes=Winapi.Windows;WinProcs=Winapi.Windowsfor legacy Windows API names.DCC_UsePackagevcl;rtlon Win32/Win64 — same asPasClaw.dproj, so Indy resolves from RAD Studio's bundled package, no vendoring on Delphi.TargetedPlatformsDCC_ExeOutput..\..\build\delphi\<Platform>\<Config>to mirrorPasClaw.dproj.dcc32.cfg+dcc64.cfgare the cmdline-only complement:dcc32auto-loadsdcc32.cfgfrom the current directory, sopicks up the same
-U/-NS/-Aflags without going throughmsbuildon the dproj.dcc64.cfgis a byte-for-byte copy because search-path semantics are identical for the 64-bit compiler.GUIDs are unique per dproj. Sample
.dprheaders now enumerate three build flows:make(FPC),msbuild SampleX.dproj(Delphi),dcc32 SampleX.dpr(Delphi cmdline). SampleMakefileheader gets a paragraph pointing to the new dprojs and cfgs.Verification
make clean && make) still produces all three binaries (no regression)..dprojparses as well-formed XML via Python'sET.parse— full dcc32 validation requires actual Delphi which this Linux container doesn't ship.https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
Generated by Claude Code