mietek / haskell-on-heroku

Buildpack for deploying Haskell apps
BSD 3-Clause "New" or "Revised" License
131 stars 16 forks source link

Build is rejected if license file is missing #53

Closed akhra closed 9 years ago

akhra commented 9 years ago

Cabal gives an error message when license-file: <file> is specified in config but <file> is not present; this doesn't actually make the build fail in a local environment, but is interpreted as a build failure by haskell-on-heroku. Granted this is user error at its finest, but I think anything that won't stop cabal run should probably pass here too.

mietek commented 9 years ago

Please note that specifying a nonexistent file as the license-file does stop cabal copy from succeeding, which is one of the cabal commands that Halcyon currently uses under the hood:

$ git clone https://github.com/mietek/hello
$ cd hello
$ vi hello.cabal
$ git diff
diff --git a/hello.cabal b/hello.cabal
index eaa71ea..1cf2ae4 100644
--- a/hello.cabal
+++ b/hello.cabal
@@ -2,6 +2,7 @@ name:               hello
 version:            1.0
 build-type:         Simple
 cabal-version:      >= 1.20
+license-file:       nonexistent

 executable hello
   main-is:            Main.hs
$ cabal sandbox init
$ cabal configure
Resolving dependencies...
Configuring hello-1.0...
Warning: The 'license-file' field refers to the file 'nonexistent' which does
not exist.
$ cabal build
Building hello-1.0...
Preprocessing executable 'hello' for hello-1.0...
[1 of 1] Compiling Main             ( Main.hs, dist/build/hello/hello-tmp/Main.o )
Linking dist/build/hello/hello ...
$ cabal copy
cabal: nonexistent: does not exist
$ echo $?
1