SysTools: Override TMPDIR when invoking gcc
AbandonedPublic

Authored by bgamari on Jun 10 2016, 6:00 PM.

Details

Reviewers
austin
rwbarton
Trac Issues
#11476
Summary

This sets TMPDIR to GHC's tempDir during invocations to GCC,
ensuring that temporary files don't accumulate as the result of GCC bug Trac #69351.
Fixes GHC Trac #11476.

Test Plan

Validate, check that temporary files are cleaned up

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 10061
Build 12106: arc lint + arc unit
bgamari retitled this revision from to SysTools: Override TMPDIR when invoking gcc.Jun 10 2016, 6:00 PM
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
bgamari added a reviewer: rwbarton.
bgamari updated the Trac tickets for this revision.

Does GHC clean up after GCC with this change? When I looked at this I remember the tricky part being that GHC tracks exactly which temporary files and directories it creates and deletes them specifically (and doesn't delete directories recursively). I don't know if that is for a good reason though.

compiler/main/SysTools.hs
579

You mean GCC here, not GHC.

Phyx added a subscriber: Phyx.Jun 11 2016, 1:43 AM
Phyx added inline comments.
compiler/main/SysTools.hs
565

Hmmm. Is this still needed? It's been a while since Vista and GCC 3.4.x.

bgamari updated this revision to Diff 7953.Jun 13 2016, 4:30 AM
bgamari marked an inline comment as done.

Fix comment

bgamari updated this revision to Diff 7954.Jun 13 2016, 4:42 AM

Recursively delete temporary directories

I've changed the removal behavior such that temporary directories are deleted recursively.

compiler/main/SysTools.hs
565

A good question.

austin accepted this revision.Jul 11 2016, 5:58 PM

LGTM

This revision is now accepted and ready to land.Jul 11 2016, 5:58 PM
bgamari added inline comments.Sep 5 2016, 4:15 PM
compiler/main/SysTools.hs
1229

This here is my only reservation here. Recursive deletion is a large hammer which can potentially wreak a lot of damage.

bgamari abandoned this revision.Nov 10 2016, 2:35 PM

Given that gcc 6, which fixes the issue which prompted this fix, is now becoming available I think it's best to just punt on this.