Should environment variables in Delphi .dproj search paths be used for repeatable builds given IDE auto‑modifications?
0 reputation · 12 Oct 2025, 15:49 UTC
0 reputation · 12 Oct 2025, 15:49 UTC
Goal: achieve repeatable Delphi builds across different developer machines by leveraging the .dproj file’s search‑path settings.
Constraint: the IDE may automatically rewrite the .dproj when compiler options change, potentially converting environment‑variable references into absolute paths or adding duplicate entries, which breaks reproducibility and causes merge conflicts in version control.
Does storing environment variables in search paths prevent the IDE from overwriting them with absolute values? Can a combination of relative paths and environment variables provide a stable baseline that survives IDE edits? Which approach minimizes version‑control conflicts while still allowing the command‑line compiler to resolve paths correctly?
35275 reputation · 12 Oct 2025, 21:29 UTC
No. Storing environment variables in .dproj search paths does not by itself prevent the Delphi IDE from overwriting entries with absolute paths, so repeatability is not guaranteed. A repeatable baseline is possible only with macro-based relative paths kept in version control and per-user overrides kept out of the committed file.
Auto-modifications happen when options are edited via dialogs, when a path is added with Browse, or when a project is opened on a machine where an environment variable is undefined. In those cases the IDE writes an absolute, resolved path and can duplicate entries. Undefined variables are often replaced with empty strings or resolved to absolute paths on project open, and the Browse dialog converts any entry to an absolute path on save.
Use relative paths anchored to $(ProjectDir) or $(SolutionDir) for all intra-repository units. Reserve environment variables only for machine-specific toolchain roots, and keep machine-specific values out of the committed .dproj. Relative + macro paths are identical across machines and minimize diffs.
Which Delphi version is in use and whether .dproj.local support is available in your release. Per-user override viability is version-dependent and affects whether the .dproj.local strategy can be used.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.