Skip to content

Remove unit out dir before building the unit - #41

Merged
ranger-ross merged 2 commits into
masterfrom
remove-out-dir-before-build
Nov 4, 2026
Merged

ranger-ross merged 2 commits into
masterfrom
remove-out-dir-before-build

Conversation

@ranger-ross

@ranger-ross ranger-ross commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Builds using the unstable new build-directory layout now recreate unit output directories before compilation.
    • When rebuilding a library with this layout, hard-linked backup files retain their original contents, while newly generated files reflect the updated source. This helps prevent existing backups from being unintentionally changed during a rebuild.

@ranger-ross ranger-ross changed the title Added test for overwriting hardlinked files Remove unit out dir before building the unit Oct 28, 2026
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 76254cc3-a2e1-43ac-ad82-2d3d296c038e
Commits

Reviewing files that changed from the base of the PR and between 009c819 and 70f2154.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The compiler now uses the unstable build_dir_new_layout setting to control output-directory setup and pre-compilation cleanup. A build test checks that hard-linked .rlib, .rmeta, and .d backups retain their contents after a rebuild. A freshness test changes how the linker stub handles output-file removal errors.

Changes: Build-directory layout

Layer / File(s) Summary
Output-directory handling and regression coverage
src/compiler/mod.rs, tests/testsuite/build.rs, tests/testsuite/freshness.rs
When the new layout is enabled, the compiler removes and recreates the output directory and skips the existing pre-compilation cleanup. The build test checks that hard-linked .rlib, .rmeta, and .d backups retain their original contents after rebuilding. The freshness test ignores errors when removing the output file.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: epage

Merge Risk: Minimal · previous review 009c8

No actionable merge-blocking issue was identified. The linker fixture still creates its output before interruption, and regression coverage checks that rebuilding preserves hard-linked backups. Mergeable subject to normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the main change: removing the unit output directory before building under the new layout.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8f08c26e-a7a0-45c7-a929-a26a7a55ed21
Commits

Reviewing files that changed from the base of the PR and between 0217ae0 and 009c819.

Files selected for processing: 1
  • tests/testsuite/freshness.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@ranger-ross ranger-ross reopened this Oct 28, 2026
@ranger-ross
ranger-ross force-pushed the remove-out-dir-before-build branch 3 times, most recently from 0217ae0 to 009c819 Compare November 2, 2026 14:38
This commit wipes the unit's out dir before we [re]build it to avoid
write to hardlinked files being used outside of build-dir.

The motivation for this commit is to prepare for deduplication for files
in the build-dir using shared content addressible storage. We want to
avoid overwriting a file that is hardlinked into the CAS.
@ranger-ross
ranger-ross force-pushed the remove-out-dir-before-build branch from 009c819 to 70f2154 Compare November 3, 2026 05:39
@ranger-ross
ranger-ross merged commit 28c753a into master Nov 4, 2026
30 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Nov 7, 2026
2 of 3 tasks
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.

1 participant