maffh
maffh

Reputation: 299

Cabal: Does not exists in Windows 8.1

Today I installed windows 8.1 and haskell on my laptop. I'm trying to build my own haskell library, but I got an error when I try to use cabal sdist. This is the error:

D:\Development\School\AFP\Assignments\Practice\Exercise\Project>cabal sdist
Distribution quality errors:
'license: NONE' is not a recognised license. The known licenses are: GPL,
GPL-2, GPL-3, LGPL, LGPL-2.1, LGPL-3, AGPL, AGPL-3, BSD2, BSD3, MIT, ISC,
MPL-2.0, Apache, Apache-2.0, PublicDomain, AllRightsReserved, OtherLicense
Distribution quality warnings:
No 'category' field.
No 'maintainer' field.
No 'synopsis' field.
A 'license-file' is not specified.
When distributing packages it is encouraged to specify source control
information in the .cabal file using one or more 'source-repository' sections.
See the Cabal user guide for details.
Note: the public hackage server would reject this package.
Warning: Cannot run preprocessors. Run 'configure' command first.
Building source dist for Project-0.1.0.0...
cabal: does not exist

Before I used the "cabal sdist" I used the following commands:

  1. cabal init
  2. cabal sandbox init
  3. cabal install -j

Every command succeed, except for the cabal sdist. The cabal install only gives the following warning:

D:\Development\School\AFP\Assignments\Practice\Exercise\Project>cabal install -j

Resolving dependencies...
In order, the following will be installed:
Project-0.1.0.0 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Notice: installing into a sandbox located at
D:\Development\School\AFP\Assignments\Practice\Exercise\Project\.cabal-sandbox
Configuring Project-0.1.0.0...
Building Project-0.1.0.0...
Installed Project-0.1.0.0

This is my Project.cabal file:

-- Initial Project.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

-- Initial Project.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

name:                Project
version:             0.1.0.0
-- synopsis:            
description:         Education
license:             NONE
-- license-file:     
-- author:              
-- maintainer:          
-- copyright:           
-- category:            
build-type:          Simple
extra-source-files: File6, File5, File4, File3, File2 
cabal-version:       >=1.10

library
  exposed-modules:     File1
  -- other-modules:       
  -- other-extensions:    
  build-depends:       base >=4.8 && <4.9, QuickCheck >=2.8 && <2.9
  hs-source-dirs:      src
  default-language:    Haskell2010

I tried google, but I can't find a good solution. I use the following versions:

Cabal version: 1.22.4.0

Haskell version: 7.10.2

If you need more information, please ask.

Upvotes: 1

Views: 202

Answers (2)

maffh
maffh

Reputation: 299

The problem was that cabal could not find the files in extra-source-files. I thought I didn't had to add the extension of the haskell files, but this is required.

I also had another problem. The extra-source-files wasn't using the hs-source-dirs, so I had to explicitly write "src/" infront of a file.

Upvotes: 1

crockeea
crockeea

Reputation: 21811

I don't know anything about sdist, but the problem is clear: you've specified 'NONE' as the license in your cabal file, but that is not allowed for the sdist option. configure, build, and init don't care about the specific license, but sdist apparently does.

For more info, I searched google for "cabal sdist" and found this.

This [cabal sdist] has the advantage that Cabal will do a bit more checking, and ensure that the tarball has the structure that HackageDB expects.

HackageDB probably expects a valid license, hence why "NONE" is not allowed.

Upvotes: 2

Related Questions