Repository navigation
Keep build output inside the worktree - #72
Merged
Merged
Conversation
Cargo and SwiftPM now write to their default locations, target/ and macos/.build/, both ignored, so git worktree remove is the whole cleanup. The /tmp scratch layout keyed by checkout hash is removed with the script that computed it, the two duplicate test wrappers, and the cleanup step that forked bash from the app to find and delete that cache. verify-cargo.sh and verify-swift.sh are the only Rust and Swift entrypoints; the check scripts call them, verify-cargo.sh gains a lint mode, and the harness slots become test, lint and build instead of three overlapping release-build confirmations. The login-shell PATH test injected the probe result instead of running a real zsh under a two-second bound, which failed whenever the machine was busy building.
1 task
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
브랜치 하나를 빌드하고 검증할 때 생기는 산출물을 전부 그 워크트리 안으로 옮기고, 검증 진입점을 두 스크립트로 줄입니다.
지금까지
cargo test와swift test의 산출물은/tmp/hide-verify-<uid>/<checkout hash>/에 쌓였습니다."검증 중인 트리를 더럽히지 않는다"가 이유였는데,
target/과macos/.build/는 이미 ignore되어 있고 harness는 tracked 파일만 채점하므로 그 이유는 사라진 지 오래였습니다.남은 것은 비용이었습니다: 워크트리를 지워도 캐시는 남아 7.5 GB의 고아 디렉터리가 생겼고, #71은 앱이
bash scripts/build-scratch.sh를 포크해서 그 경로를 계산해 지우는 코드까지 들였습니다.이 PR 이후 빌드 결과는 cargo가
target/, SwiftPM이macos/.build/에 쓰고,git worktree remove한 번이 청소의 전부입니다.바뀐 것:
scripts/build-scratch.sh,rust-test.sh,swift-test.sh삭제.verify-cargo.sh와verify-swift.sh가 유일한 Rust/Swift 검증 진입점이고, 스크래치를 쓰던 check 스크립트 7개가 이 둘을 부릅니다.verify-cargo.sh는 호출자의CARGO_TARGET_DIR와 무관하게 항상 워크트리의target/을 쓰고,lint모드(cargo fmt --check+clippy -D warnings)가 생겼습니다.verify-swift.sh test --filter X로 스위트 하나를 돌릴 수 있습니다.worktree_cleanup.rs에서/tmp캐시를 찾아 지우던owned_scratch_root와 그 실패를 표현하던Partial결과, 셸의"partial"분기를 삭제했습니다. 캐시가 워크트리 안에 있으면git worktree remove가 함께 지웁니다.agents/config.json의 검증 슬롯을 겹치는 4개(test/build/typecheck/lint가cargo build --release를 세 번 확인)에서 다른 일을 하는 3개(test,lint,build=verify-swift.sh test)로 바꿨습니다. Sasu verify가 clippy와 fmt를 처음으로 돌립니다.OperationalPolicyTests의loginShellPathIsTheChildToolPATH는 실제/bin/zsh -l을 2초 제한으로 띄우고 성공을 요구했습니다. 기계가 바쁘면 타임아웃으로 떨어지는 테스트였습니다. 프로브 결과를 주입하는 두 케이스(로그인 PATH가 있으면 그것, 없으면/usr/bin:/bin)로 바꿨고, 비밀값이 자식 환경에 전달되지 않는 것도 고정값으로 확인합니다.docs/BUILD.md를 다시 썼고,AGENTS.md,CONTRIBUTING.md,DESIGN.md,docs/README.md,verification-fixtures.md,BROWSER_PANES.md,PERFORMANCE_TESTING.md에서 지운 스크립트와/tmp경로를 걷어냈습니다.Related
/tmp캐시 삭제 단계를 넣은 PR; 이 PR이 그 단계를 되돌립니다)Breaking change
bash scripts/rust-test.sh,swift-test.sh호출은verify-cargo.sh test,verify-swift.sh test [--filter X]로 바꿔야 합니다./tmp/hide-verify-<uid>/는 코드가 지우지 않습니다. 한 번 손으로 지우면 다시 생기지 않습니다.macos/.build/(약 0.7 GB)가 생깁니다. 이전에는 같은 크기가/tmp에 있었으므로 총량은 같고, 워크트리 삭제로 함께 사라진다는 점만 다릅니다.Review focus
lint(clippy)를 넣어 verify 시간이 늘어나는 것(cold 기준 수십 초)이 CI와 로컬 검증을 같은 게이트로 맞추는 값어치가 있는지.herdr-core/src/worktree_cleanup.rs.RemovalOutcomeenum을String으로 접었으므로, 제거 결과가"removed"또는"refused"둘뿐이라는 것을confirm의 재시도 건너뛰기 조건(row.result == "removed")과 함께 봐주세요.check-hide-full.sh의 로그가target/hide-full.log로 갑니다. 다른 위치가 낫다면 알려주세요.Risk surface
git worktree remove가 실패하면 이전과 같이 행이refused로 표시되고 Git의 stderr가 메시지로 보입니다. 이전에partial(폴더는 지웠으나/tmp캐시는 못 지움)이던 상태는 더 이상 생길 수 없습니다.Evidence
python3 -m unittest discover -s scripts/tests: 28개 통과.test_verification_builds.py의 실제 Cargo+SwiftPM 패키지 테스트가CARGO_TARGET_DIR=must-not-use를 준 상태에서도target/과macos/.build/만 쓰고, 코어 값이 바뀌면 Swift 실행파일이 따라 바뀌는 것을 확인.bash scripts/verify-cargo.sh lint: fmt와 clippy 통과.bash scripts/verify-cargo.sh test: 새removal_deletes_the_selected_worktree_with_its_build_output_and_keeps_the_branch포함 cleanup 테스트 5개 통과.bash scripts/verify-swift.sh test: 444개 통과(cold, 릴리스 코어 빌드 포함 4분 44초). 실행 후/tmp/hide-verify-<uid>/에 새 디렉터리가 생기지 않고target/과macos/.build/만 생긴 것을 확인.session_sync::tests::coordinator_recovers_event_gap_with_one_fresh_snapshot_and_stops_its_reader,coordinator_resumes_from_the_last_event_without_fetching_another_snapshot두 개가condition did not become true before deadline으로 실패합니다. 이 PR이 건드리지 않은 파일이고, 같은 기계의main체크아웃에서도 같은 두 개가 같은 이유로 실패하는 것을 확인했습니다(다른 워크트리 세 곳이 동시에 빌드 중이던 조건). 별도 이슈로 다룹니다.partial색상 분기 제거 하나이고, 그 상태를 만들 코드 경로가 없어졌습니다.AI tooling
손으로 확인한 것:
/tmp/hide-verify-501/아래 4개 디렉터리 중 하나(1.7 GB)가 존재하지 않는 워크트리의 것임을 해시를 각 체크아웃 경로에서 다시 계산해 대조했고,macos/루트의.o/.d/.swiftdeps60개가 2026-08-31 하루에 생긴swiftc직접 실행 잔재임을 mtime으로 확인했습니다.