Skip to content

run-make-support: rename tmp_dir() and clarify its semantics #125726

Closed
@jieyouxu

Description

@jieyouxu
Member

Most command wrappers assume output artifacts will be emitted to tmp_dir() (which calculates TMPDIR as is used in tools.mk), which is a scratchpad directory that is intended to be unique for each run-make test so they don't interfere with each other, and that output artifact emission is contained to the directory. Typically command wrappers will have --out-dir=tmp_dir() presets.

The naming of tmp_dir() however is pretty bad -- it being a "temporary directory" is not to be confused with env::temp_dir.

Do note, however, that tools.mk setting TMPDIR has other effects:

On Unix, returns the value of the TMPDIR environment variable if it is set

I don't know if this is intentional, but if it is intended to even control where e.g. codegen artifacts are emitted, then setting TMPDIR does nothing on Windows: we also need to set TMP/TEMP on Windows.

Activity

added
A-testsuiteArea: The testsuite used to check the correctness of rustc
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
C-bugCategory: This is a bug.
on May 29, 2024
self-assigned this
on May 29, 2024
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on May 29, 2024
removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on May 29, 2024
jieyouxu

jieyouxu commented on Jun 3, 2024

@jieyouxu
MemberAuthor

In #125827 we named the output artifacts directory rmake_out, so reasonable names could be rmake_out_dir and rmake_out_path, for example.

added 2 commits that reference this issue on Jun 8, 2024

Auto merge of rust-lang#126097 - Kobzol:runmake-change-cwd, r=jieyouxu

Auto merge of rust-lang#126097 - Kobzol:runmake-change-cwd, r=jieyouxu

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @jieyouxu@rustbot

    Issue actions

      run-make-support: rename `tmp_dir()` and clarify its semantics · Issue #125726 · rust-lang/rust