Skip to content

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

Closed
@jieyouxu

Description

@jieyouxu

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.

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

No branches or pull requests

Issue actions