haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
297 stars 82 forks source link

GHC-generated LINE annotation might cause non-deterministic build #105

Open cartazio opened 7 years ago

cartazio commented 7 years ago

AlexWrapper-basic copy.txt

theres thousands of newlines in that attached file! also some of the source / line attributions seem likely to cause nondeterminstic builds under some conditions eg


{-# LINE 1 "/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc64947_0/ghc_2.h" #-}

cc @hvr

erikd commented 7 years ago

I agree that it would probably be nice to remove excessive newlines, but I can't see how these, or the source line attributions could cause non-deterministic builds. Can you generate a test case that show this?

erikd commented 7 years ago

Ok so the non-determinacy comes from things like:

{-# LINE 1 "/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc64947_0/ghc_2.h" #-}

but does that come from Alex or GHC ?

hvr commented 7 years ago

That looks a lot like a tmp-file generated by GHC... I wonder if GHC should #line-annotate positions in ephemeral tmp files... (especially if -keep-tmp-files is not active)

andreasabel commented 2 years ago

Is this still a problem? Cannot reproduce atm.
We need a reproducer to report this upstream.