commercialhaskell / commercialhaskell/stack

Put GHC tmpdirs into .stack-work

Open
#5,892 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

# Motivation

I'm trying to look at the output of a custom `-pgmF` preprocessor by using `--ghc-options=-keep-tmp-files`, but it took me forever to realize that the output is in `$TMPDIR` and not `.stack-work` (since that's where `-ddump` files go already).

Additionally, when I run a single `stack build`, I get 5 different `ghc` temp directories. I'm assuming Stack invokes GHC 5 times and GHC creates a tmpdir each time. This makes it difficult to know which directory contains the file I want to look at.

# Request

It'd be great if Stack could set the `-tmpdir` flag whenever invoking `ghc` to an appropriate location in `.stack-work/`. This way, the GHC temp dirs could clearly be labelled like `.stack-work/ghctmp-build-setup-hs/` or `.stack-work/ghctmp-build-library/` or whatever, and if a user runs `--ghc-options=-keep-hscpp-files`, they can do `find .stack-work -name '*.hscpp'` and easily find files.

Related: https://gitlab.haskell.org/ghc/ghc/-/issues/22258

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.