Skip to content

Interaction of -fno-code and -E seems undesirable

If you pass -fno-code and -E together then the output gets sent to a temporary file.

[nix-shell:~/ghc-clean]$ _build/stage1/bin/ghc A.hs -fno-code -fforce-recomp -E -v2
Glasgow Haskell Compiler, Version 9.3.20210922, stage 2 booted by GHC version 8.10.2
Created temporary directory: /run/user/1000/ghc1266455_0
*** Copying `A.hs' to `/run/user/1000/ghc1266455_0/ghc_1.hspp':
*** Deleting temp files:
*** Deleting temp dirs:

If you don't pass -fno-code then the file gets written to A.hspp.

[nix-shell:~/ghc-clean]$ _build/stage1/bin/ghc A.hs  -fforce-recomp -E -v2
Glasgow Haskell Compiler, Version 9.3.20210922, stage 2 booted by GHC version 8.10.2
*** Copying `A.hs' to `A.hspp':
*** Deleting temp files:
*** Deleting temp dirs:

Why would passing -fno-code or not dictate whether this file ends up in a temporary file or not?

Proposed behaviour: With -fno-code, -E still writes out the file to A.hspp.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information