Skip to content

RunFile: build with dcc64 - #620

Merged
FMXExpress merged 1 commit into
mainfrom
claude/pasclaw-desktop-plan-uapzcp
Oct 26, 2026
Merged

FMXExpress merged 1 commit into
mainfrom
claude/pasclaw-desktop-plan-uapzcp

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

The Delphi build stopped in PasClaw.Gateway.RunFile (from #613), so every unit that uses it, starting with PasClaw.Cmd.Attach, failed with F2063:

PasClaw.Gateway.RunFile.pas(140): E2003 Undeclared identifier: 'PROCESS_QUERY_LIMITED_INFORMATION'
PasClaw.Gateway.RunFile.pas(172): E2003 Undeclared identifier: 'LocalTimeToUniversal'
PasClaw.Gateway.RunFile.pas(187): E2010 Incompatible types: 'PWideChar' and 'string'

FPC never saw any of the three: two are in the Windows branch, and the third is an FPC-only RTL function.

Fixes

  • PROCESS_QUERY_LIMITED_INFORMATION: dcc64's Winapi.Windows does not declare it. It is now declared in the unit, under MSWINDOWS, as RUNFILE_PROCESS_QUERY_LIMITED = $1000. That is our own name, so it cannot collide with a Windows unit that does declare it.
  • LocalTimeToUniversal: only FPC's DateUtils has it. started_at now comes from PasClaw.Utils.NowIsoUtc, which already picks TTimeZone.Local.ToUniversalTime on Delphi (as PasClaw.Agents and PasClaw.Tools.MemoryFetch do). It also quotes its separators; the old format string left : bare, which FormatDateTime replaces with the locale's time separator. DateUtils is no longer used and is removed from the uses clause.
  • DeleteFile: on Delphi, Winapi.Windows comes after SysUtils in scope, so its DeleteFile(PWideChar) won over SysUtils.DeleteFile(string). The call is now SysUtils.DeleteFile, by name.

I also scanned every unit #608 through #618 touched for other unguarded FPC-only identifiers (LocalTimeToUniversal, fpKill, GetProcessID, cint, …) and for unqualified DeleteFile-style calls in units that use Winapi.Windows. Nothing else turned up.

Tests

  • FPC build.
  • make test-runfile passes, and now also checks that started_at is ISO 8601 UTC with literal separators.

Not run: dcc64. There is no Delphi compiler in this environment, and no win64 RTL for FPC either, so the Windows branch was not built here. Please confirm with the Delphi build.


Generated by Claude Code

Three Delphi-only compile errors in PasClaw.Gateway.RunFile (from #613),
none of which FPC sees -- two are in the Windows branch and the third is
an FPC-only RTL function:

  - E2003 PROCESS_QUERY_LIMITED_INFORMATION: dcc64's Winapi.Windows does
    not declare it. Declared here as RUNFILE_PROCESS_QUERY_LIMITED
    ($1000) under MSWINDOWS -- our own name, so it cannot collide with a
    Windows unit that does.
  - E2003 LocalTimeToUniversal: FPC's DateUtils only. started_at now
    comes from PasClaw.Utils.NowIsoUtc, which already picks
    TTimeZone.Local.ToUniversalTime on Delphi (as Agents and MemoryFetch
    do) and quotes its separators: the old format string left ':' bare,
    which FormatDateTime replaces with the locale's time separator.
    DateUtils is no longer used and leaves the uses clause.
  - E2010 DeleteFile: Winapi.Windows comes after SysUtils in scope on
    Delphi, so its DeleteFile(PWideChar) won over SysUtils.DeleteFile.
    Now SysUtils.DeleteFile, by name.

A scan of the units #608 through #618 touched found no other unguarded
FPC-only identifier and no other Windows-shadowed RTL call.

Tested: FPC build, test-runfile (now also checks started_at is ISO 8601
UTC with literal separators). Not run: dcc64 -- there is no Delphi
compiler in this environment, and no win64 RTL for FPC either, so the
Windows branch is unbuilt here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T21:32:26.833274Z 937a5a3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@FMXExpress
FMXExpress merged commit 8cd12d1 into main Oct 26, 2026
1 check passed
FMXExpress pushed a commit that referenced this pull request Oct 26, 2026
dcc64 stopped in PasClaw.Backup with E2003 on GetProcessID (lines 697
and 786, the stage and restore temp dirs), so PasClaw.Maintain and
everything above it failed with F2063. GetProcessID is FPC's SysUtils
only.

PasClaw.Platform gains CurrentPid: GetProcessID on FPC, and on Delphi
GetCurrentProcessId / getpid from Winapi.Windows / Posix.Unistd, which
Platform already uses. It lives there rather than as a fourth private
copy (Cmd.Relay, Tools.RPC and Gateway.RunFile each have one) because
the alternative for Backup -- Winapi.Windows in its own uses clause --
would let Windows' DeleteFile and friends shadow SysUtils' in a unit
that deletes and copies files, the error #620 fixed in RunFile. Backup
lists Platform ahead of its other PasClaw units, and Platform exports
no RTL name, so nothing it already resolved changes.

The same scan, over all of src this time rather than only the units
#608-#618 touched (Backup predates them, which is how #620's scan
missed it), found one more: the gateway's permission-ask id called
GetTickCount64, which PasClaw.Cmd.Relay records as dcc64 E2003. The id
now takes its prefix from DateUtils.MilliSecondOfTheDay, same
resolution and same purpose -- a restarted gateway's ids stay apart
from ones a stale web UI tab may still answer. Not Random: nothing in
the gateway calls Randomize, so its sequence repeats every restart.
With these, the scan finds no unguarded FPC-only identifier in src.

Tested: FPC build; test-backup, test-maintain, test-permissions. Not
run: dcc64 -- no Delphi compiler here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
@FMXExpress FMXExpress mentioned this pull request Nov 13, 2026
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