This is an archive of the discontinued LLVM Phabricator instance.

[scan-build-py] use python tempfile for tempdir
ClosedPublic

Authored by rizsotto.mailinglist on Mar 11 2017, 3:27 AM.

Details

Summary

It's a chunk from D26390

tempdir method is used to be a default value for parent directory of the output directory. The implementation was following the Perl scan-build implementation. It tries to come up with a meaningful (most probably writable) place on the filesystem. The very same functionality is implemented in python tempfile module. It's tested better, it works on multiple platform and requires no additional code to use it.

Diff Detail

Repository
rL LLVM

Event Timeline

dcoughlin accepted this revision.Mar 19 2017, 10:57 AM

This this looks much cleaner to me!

I suppose this will break anyone who was setting TMPDIR, etc. to direct output. But if they were, they have a command-line flag they could use instead of an environment variable.

This revision is now accepted and ready to land.Mar 19 2017, 10:57 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the review Devin!

I suppose this will break anyone who was setting TMPDIR, etc. to direct output. But if they were, they have a command-line flag they could use instead of an environment variable.

Actually, TMPDIR,TEMP and TMP environment still kicks in as primary location if command line argument does not present. Would not make breaking change like that.