Skip to content

libstd/os: set tmp dir to /data/tmp on Android #8901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

adrientetar
Copy link
Contributor

Android has no /tmp partition, cf. #8511.

@huonw
Copy link
Member

huonw commented Aug 31, 2013

This could probably be written as (which helps reduce the ugliness of the conditional compilation):

#[cfg(unix)]
fn lookup() -> Path {
    if cfg!(target_os = "android") {
        Path("/data/tmp")
    } else {
        getenv_nonempty("TMPDIR").unwrap_or_default(Path("/tmp"))
    }
}

(The cfg! and if get evaluated at compile time, so there is no cost.)

Path("/data/tmp")
} else {
getenv_nonempty("TMPDIR").unwrap_or_default(Path("/tmp"))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build log says that the build failed because there is trailing whitespace on this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I shouldn't have copy-pasted that and since the build system was a bit flaky recently I thought it was a false positive.

Android has no /tmp partition, return /data/tmp instead. Cf. rust-lang#8511.
bors added a commit that referenced this pull request Sep 4, 2013
Android has no /tmp partition, cf. #8511.
@bors bors closed this Sep 4, 2013
@adrientetar adrientetar deleted the issue-8511 branch December 15, 2013 11:49
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 16, 2022
Rework `branches_sharing_code`

fixes rust-lang#7378

This changes the lint from checking pairs of blocks, to checking all the blocks at the same time. As such there's almost none of the original code left.

changelog: Don't lint `branches_sharing_code` when using different binding names
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.

3 participants