Skip to content

GHC not noticing it should produce some new binary artifacts

Summary

Compile a binary (e.g. exectable) with no explicit flags, then compile again with -dynamic-too: you'd expect to have *dyn* files in the directory but there is none!

Steps to reproduce

❯ cat Main.hs                                                                                                                  module Main where
main = pure ()

❯ ghc Main.hs                                                                                                                  [1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

❯ ll                                                                                                                           .rwxrwxr-x  10M artem 22 Jul 21:52 Main
.rw-rw-r--  646 artem 22 Jul 21:52 Main.hi
.rw-rw-r--   33 artem 22 Jul 20:36 Main.hs
.rw-rw-r-- 2.8k artem 22 Jul 21:52 Main.o

❯ ghc Main.hs -dynamic-too                                                                                                     1 (0.088s) < 21:52:31

❯ ll                                                                                                                           .rwxrwxr-x  10M artem 22 Jul 21:52 Main
.rw-rw-r--  646 artem 22 Jul 21:52 Main.hi
.rw-rw-r--   33 artem 22 Jul 20:36 Main.hs
.rw-rw-r-- 2.8k artem 22 Jul 21:52 Main.o

Expected behavior

I expect *dyn* files to materialize.

Environment

  • GHC version used: 9.2.3

Optional:

  • Operating System: Linux
  • System Architecture: x86_64

Discussion

Apparently, this was discussed on Cabal bug tracker long ago: https://github.com/haskell/cabal/issues/4635

I looked at the recompilation checking label but didn't see anything relevant.

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