You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn when a package uses TH but doesn't tell about it to Cabal #1562
It seems like there are a lot of packages that use Template Haskell but don't tell Cabal about it via extensions or other-extensions. With GHC 7.8 (and probably also older ones) this can lead to build failures (see e.g. #1553). It'd be nice if we could do a check akin to #1455 and warn the user if this is the case.
This feature will likely require using GHC API, so perhaps we could combine it with #1455 - what we need is a ghc --make augmented to dump the dependency graph and the set of all enabled extensions before the actual compilation.
Update: see also #3081. If we implement this feature for TH, it will be easy to generalise for all extensions.
Is there any chance other-extensions could be make an optional field for projects that don't use CPP (and thus can have all their extensions discovered programmatically)? Obviously if a human has to do the work of writing extensions then they have to do it, but it doesn't look like that's the case without CPP.
There's already a lot of boilerplate in .cabal files between extra-source-files, exposed-modules, etc. I understand why we have it (other languages may say "treat any .foo as a Foo file, and we want to be more precise), but I think we want to be careful about adding/enforcing more if we don't have to.
@seagreen I am very sympathetic to your concern, but unfortunately having it be implicit would sort of miss the point, because the dependency solver wants to make decisions about what packages to choose without having to actually look at the Haskell files (it's got only the Cabal file, not the full tarball.)
Maybe the moral of the story is that Cabal metadata should be divided into two parts: one that is hand-written, and one that is machine generated. When you upload, you upload both parts (so you have to be able to generate the machine bits.)
Maybe the moral of the story is that Cabal metadata should be divided into two parts: one that is hand-written, and one that is machine generated. When you upload, you upload both parts (so you have to be able to generate the machine bits.)
Something like this sounds absolutely fantastic:) Should we make a new issue to consider it? I think the problem you describe in your first paragraph (that even though the info is machine derivable, it needs to go in the cabal file so the solver can see it) will keep coming up until we get a proper place to store machine derivable info (which is really just a cache) separate from human written info.
Activity
23Skidoo commentedon Oct 26, 2013
Assigning to myself so I don't forget about this.
seagreen commentedon Aug 31, 2016
Is there any chance
other-extensionscould be make an optional field for projects that don't use CPP (and thus can have all their extensions discovered programmatically)? Obviously if a human has to do the work of writing extensions then they have to do it, but it doesn't look like that's the case withoutCPP.There's already a lot of boilerplate in
.cabalfiles betweenextra-source-files,exposed-modules, etc. I understand why we have it (other languages may say "treat any.fooas a Foo file, and we want to be more precise), but I think we want to be careful about adding/enforcing more if we don't have to.seagreen commentedon Aug 31, 2016
PS Thanks for opening this, I definitely think enforcement is better than nothing.
ezyang commentedon Aug 31, 2016
@seagreen I am very sympathetic to your concern, but unfortunately having it be implicit would sort of miss the point, because the dependency solver wants to make decisions about what packages to choose without having to actually look at the Haskell files (it's got only the Cabal file, not the full tarball.)
Maybe the moral of the story is that Cabal metadata should be divided into two parts: one that is hand-written, and one that is machine generated. When you upload, you upload both parts (so you have to be able to generate the machine bits.)
seagreen commentedon Aug 31, 2016
Something like this sounds absolutely fantastic:) Should we make a new issue to consider it? I think the problem you describe in your first paragraph (that even though the info is machine derivable, it needs to go in the cabal file so the solver can see it) will keep coming up until we get a proper place to store machine derivable info (which is really just a cache) separate from human written info.
ezyang commentedon Aug 31, 2016
Yes, a new issue seems like a good idea.
seagreen commentedon Aug 31, 2016
Done!