Skip to content

Instantly share code, notes, and snippets.

@amosr
Created December 21, 2016 02:24
Show Gist options
  • Save amosr/c9cb7dabcd967d2b15644cbd0ccace84 to your computer and use it in GitHub Desktop.
Save amosr/c9cb7dabcd967d2b15644cbd0ccace84 to your computer and use it in GitHub Desktop.
GHC dynamic bug maybe
# Compile once
$ ghc -c Test.hs
# We get a .o out
$ ls -l
total 24
-rw-r--r-- 1 amos staff 757 21 Dec 13:22 Test.hi
-rw-r--r-- 1 amos staff 42 21 Dec 13:17 Test.hs
-rw-r--r-- 1 amos staff 1708 21 Dec 13:22 Test.o
# Compile again with dynamic-too doesn't rerun
$ ghc -c Test.hs -dynamic-too
compilation IS NOT required
# But just touches .dyn_o, creating an empty file
$ ls -l
total 24
-rw-r--r-- 1 amos staff 0 21 Dec 13:23 Test.dyn_o
-rw-r--r-- 1 amos staff 757 21 Dec 13:22 Test.hi
-rw-r--r-- 1 amos staff 42 21 Dec 13:17 Test.hs
-rw-r--r-- 1 amos staff 1708 21 Dec 13:23 Test.o
module Test where
foo :: Int
foo = 1 + 2
@amosr
Copy link
Author

amosr commented Dec 21, 2016

same deal with a head from a few months ago

amos@Amos test-rerun $ ../ghc/inplace/bin/ghc-stage2 -c Test.hs
amos@Amos test-rerun $ ls -l
total 24
-rw-r--r--  1 amos  staff   822 21 Dec 13:26 Test.hi
-rw-r--r--  1 amos  staff    42 21 Dec 13:17 Test.hs
-rw-r--r--  1 amos  staff  1760 21 Dec 13:26 Test.o
amos@Amos test-rerun $ ../ghc/inplace/bin/ghc-stage2 -c Test.hs -dynamic-too
compilation IS NOT required
amos@Amos test-rerun $ ls -l
total 24
-rw-r--r--  1 amos  staff     0 21 Dec 13:27 Test.dyn_o
-rw-r--r--  1 amos  staff   822 21 Dec 13:26 Test.hi
-rw-r--r--  1 amos  staff    42 21 Dec 13:17 Test.hs
-rw-r--r--  1 amos  staff  1760 21 Dec 13:27 Test.o

@amosr
Copy link
Author

amosr commented Dec 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment