fix(cdk): redirect CDK synth/test temp output to disk-backed TMPDIR#217
Open
scottschreckengaust wants to merge 2 commits into
Open
fix(cdk): redirect CDK synth/test temp output to disk-backed TMPDIR#217scottschreckengaust wants to merge 2 commits into
scottschreckengaust wants to merge 2 commits into
Conversation
…216) CDK synth, Jest tests, and esbuild bundling write large cdk.out artifacts to TMPDIR (defaults to /tmp). On systems where /tmp is a size-limited tmpfs, the full test suite exhausts space and crashes. Changes: - cdk/mise.toml: set TMPDIR={{config_root}}/.tmp via [env] so all mise //cdk:* tasks use a disk-backed directory; add mkdir -p .tmp to test and synth task runs - .pre-commit-config.yaml: export TMPDIR in pre-push hook entry so hooks inherit the same override - .github/workflows/build.yml: explicit TMPDIR=${{ runner.temp }} for the build step (CI runners have disk-backed temp) - .gitignore: add /cdk/.tmp/ Closes #216. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CDK's fingerprinter recursively walks the asset directory (repoRoot). When TMPDIR was set to cdk/.tmp/ (inside the repo), the fingerprinter entered .tmp/cdk.out*/asset.*/ which contained another copy of the repo, creating infinitely nested paths until ENAMETOOLONG. Fix: use $HOME/.cache/cdk-tmp which is outside the repo tree entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/tmp(tmpfs) to$HOME/.cache/cdk-tmp(disk-backed, outside repo tree)runner.temp(already disk-backed on GHA runners)Changes
cdk/mise.toml[env] TMPDIR = "{{env.HOME}}/.cache/cdk-tmp"+mkdir -p $TMPDIRin test/synth tasks.pre-commit-config.yaml.github/workflows/build.ymlTMPDIR: ${{ runner.temp }}on build stepKey constraint: TMPDIR must be outside the repo tree. CDK's
AgentRuntimeArtifact.fromAsset(repoRoot)fingerprints the entire repo recursively — if TMPDIR is inside it, the fingerprinter enterscdk.out*/asset.*/(which contains a copy of the repo), finds the nested TMPDIR, enters itscdk.out*/asset.*/, and loops untilENAMETOOLONG.Test plan
mise //cdk:test— verify$HOME/.cache/cdk-tmpgets artifacts,/tmpstays at 17Mcdk.out*files appear in/tmpduring test runTMPDIR: ${{ runner.temp }}Closes #216.
🤖 Generated with Claude Code