Skip to content

fix(library): library compiles put their TMPDIR (.compile-tmp) in the project root #1568

Closed

Description

@zackees

Found while verifying #1559.

library_compiler::compile_one_source builds the compiler environment with compile_env_for_build(scratch), where scratch = compile_cwd.or(obj dir). Framework libraries (ESP32) pass a workspace compile_cwd (the project root, from #952), so TMPDIR/TMP/TEMP point at <project>/.compile-tmp. GCC's temp .s files land in the user's project, which is untracked and not gitignored.

Compiles killed mid-run, for example by the fail-stop abort after a sibling fails, leave those temp files behind. After a failed pioarduino 3.3.11 build I found tests/platform/esp32s3/.compile-tmp/cc*.s.

compile_env_for_build documents that its argument should be the per-build scratch root, as link_env_for_build uses. Fix: always use the library's build/object directory as the scratch root; compile_cwd still sets the working directory only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions