Skip to content

test: record TMPDIR defaults and override precedence - #16982

Merged
rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-ntquvrouxqty
Nov 9, 2026
Merged

rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-ntquvrouxqty

Conversation

@rgrinberg

Copy link
Copy Markdown
Member

Extract and expand the temporary-directory environment coverage from #16930 into a test-only prerequisite.

Record the runtime value in both regular actions and (cram ...) actions for the default, an env-stanza override, and an action-level setenv override. The probe reads TMPDIR on Unix and TEMP on Windows; generated paths are normalized without rewriting the explicit override markers.

Current main replaces both kinds of override with Dune's managed directory in both contexts. The test records that behavior and checks that a second unchanged build reuses regular and Cram results.

Observe the platform temporary-directory variable in regular and Cram
actions with no override, an env stanza, and action-level setenv nodes.
Record current behavior without changing it, and check that unchanged
builds reuse both kinds of result across Dune invocations.

Extract and expand the override coverage from the Cram isolation fix.

Signed-off-by: Rudi Grinberg <[email protected]>
@rgrinberg
rgrinberg merged commit 684fd1c into ocaml:main Nov 9, 2026
34 of 37 checks passed
@Alizter Alizter added this to the 3.26.0 milestone Nov 10, 2026
rgrinberg added a commit that referenced this pull request Nov 12, 2026
Builds on the temporary-directory defaults and override matrix in
#16982.

Fix the shared `TMPDIR` behavior demonstrated in #16925 without adding
shell exports. Initialize Dune's managed temporary directory when
interpreting a build action, before action-level `setenv` nodes.
Build-job process spawning preserves that final environment; internal
jobs retain their separate Dune temporary directory. Directory
`env-vars` behavior is unchanged.

Cram keeps its scripts, captured output, and metadata in its own scratch
directory and exposes an initially empty `tmp/` child to setup scripts
and test commands. The paths are assigned at execution time, not
embedded in generated shell commands or rule digests. Invalidate cached
rules and Cram actions for the changed behavior.

Update the preparatory matrix's expected values for regular-action
`setenv` and Cram's private directory. Remove the older standalone
override test, while retaining isolation, empty-directory, setup-script,
and runner-file separation coverage.

Signed-off-by: Rudi Grinberg <[email protected]>
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