Skip to content

make check: consider double-checking that temp files are not injected into non-standard places #13978

Closed
@pnkfelix

Description

@pnkfelix

Spawned off of #13965.

Some of our tools generate, compile, and run code that has been written for e.g. documentation blocks. Sometimes those steps occur as part of standard make check runs.

It can be annoying to developers if such steps generate side garbage in the local file system. It is especially annoying for developers who do not run make in an isolated build directory, since then quite often it is the current working directory (i.e., their clone of the Rust repository) that gets garbage added to it.

It would be easy to say that the documentation writer was at fault for writing such a documentation block, or that another tool like rustdoc was at fault for not running "semi-trusted" code in an isolated semi-sandbox (i.e. a temporary directory).

But nonetheless, it seems like our Makefiles could guard against this, i.e. by taking a directory listing at the start of the build, and then comparing it against the directory listing at the end of the build, and filtering out the subdirectories that are known to be dedicated to build products, stamp files, logs, or temporary files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions