on iko/ghcjs-patch-master help sign in
Troubleshooting: add a note about missing files (#894)

This is another common issue.

commit21e3527e7a88a70f10f54bea886d0a3e9c9c1cfe authorMichael Peyton Jones <michael.peyton-jones@iohk.io> dateMon 26 Oct 2020, 23:45 (6 years ago) parentf658bea
1 file changed+14
docs/troubleshooting.md+14
docs/troubleshooting.md+14
@@ -70,3 +70,17 @@ Where possible, try to do the configuration in your cabal/stack configuration, e
7070This will ensure that the two builds agree.
7171
7272If you want or need to set some of them in Nix, try bringing the two into sync temporarily for troubleshooting.
73+
74+## Other specific issues
75+
76+### Why does the build complain about some files being missing?
77+
78+Sometimes your build works fine outside `haskell.nix`, but inside the `haskell.nix` build, cabal complains that some file is missing.
79+What is going on?
80+
81+The answer is that `haskell.nix` *thoroughly* cleans the source *by following what is mentioned as required in the cabal file*.
82+So we only include Haskell sources if they appear in a `hs-source-dirs` somewhere; and we only include non-Haskell files if they are included in `extra-source-files` or similar.
83+
84+This is good practice anyway: if you do not include such files in `extra-source-files` then they will not be included in `cabal sdist`, which will cause problems if you ever upload your package to Hackage.
85+But `haskell.nix` is very picky about it.
86+