Ignore source files that are used as main when inferring modules#416
Ignore source files that are used as main when inferring modules#416
main when inferring modules#416Conversation
|
This PR attempts to address #188. However, this is non-trivial. I'm not even sure if there is a sound solution. Consider the following: # source files:
#
# linux/L.hs
# windows/W.hs
# src/L.hs
executable:
when:
condition: os(windows)
then:
source-dirs:
- windows
- src
main: W.hs
else:
source-dirs: linux
main: L.hsWith this PR we will get the following output: executable foo
if os(windows)
main-is: W.hs
hs-source-dirs:
windows
src
else
main-is: L.hs
hs-source-dirs:
linuxspecifically, Ignoring any code for now, can we conceptually come up with an algorithm that produces sensible results? One of the issues is that For the example above, we know that the two branches of the when:
- condition: ...
main: ...
- condition: ...
source-dirs: ...
- condition: ...
...Here I don't think it is statically decidable how things interact. (statically == independent of a specific build configuration) |
(fixes #188)