Skip to content

Fix stale objects after source metadata collisions - #5489

Open
Daniiiil1 wants to merge 1 commit into
platformio:developfrom
Daniiiil1:fix/git-checkout-stale-objects
Open

Fix stale objects after source metadata collisions#5489
Daniiiil1 wants to merge 1 commit into
platformio:developfrom
Daniiiil1:fix/git-checkout-stale-objects

Conversation

@Daniiiil1

Copy link
Copy Markdown

Summary

  • disable SCons' max_drift content-signature shortcut for PlatformIO builds
  • add a regression test that replaces an old source file with different, same-size content while preserving its mtime
  • verify the corrected build produces the new program and a subsequent unchanged build does not rewrite the object

Why

SCons normally avoids rehashing files older than its max-drift window when their stored size and timestamp still match. A Git checkout can replace a source while preserving both values, causing PlatformIO to combine objects from different source states. Setting max_drift to -1 keeps content-based dependency decisions but removes that unsafe metadata shortcut.

Fixes #5481.

Validation

  • pytest -q tests/commands/test_run.py — 8 passed
  • isolated test_ci_boards and test_calculator_example — 2 passed after initializing the repository's examples submodule
  • make before-commit — codespell, isort, black, and pylint passed; pylint 10.00/10
  • broader suite before submodule initialization — 103 passed, 15 skipped; the two missing-fixture failures were then reproduced and resolved by initializing examples

@CLAassistant

CLAassistant commented Aug 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Daniiiil1
Daniiiil1 marked this pull request as ready for review August 4, 2026 16:48
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.

Stale .o survives git checkout to a different branch — SCons decider misses the change, linker fails with undefined reference to removed code

2 participants