Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cabal file aaaaa.cabal has a mismatched package name: bbbbb #317

Closed
rvion opened this issue Jun 15, 2015 · 11 comments
Closed

Cabal file aaaaa.cabal has a mismatched package name: bbbbb #317

rvion opened this issue Jun 15, 2015 · 11 comments
Milestone

Comments

@rvion
Copy link
Contributor

rvion commented Jun 15, 2015

➜ lamdu git:(master) stack build
Checking against build plan lts-2.14
Checking against build plan lts-1.15
Checking against build plan nightly-2015-06-15
No matching snapshot was found for your package, falling back to: lts-2.14
This behavior will improve in the future, please see: #253
Writing default config file to: /home/rvion/dev/lamdu/stack.yaml
cabal file /home/rvion/dev/lamdu/Lamdu.cabal has a mismatched package name: lamdu-ide

@drwebb
Copy link
Contributor

drwebb commented Jun 15, 2015

I'm not sure if you're asking for an improvement, but I think your error is arising because the name field in your Lambdu.cabal is lambdu-ide where it should be Lambdu.

@rvion
Copy link
Contributor Author

rvion commented Jun 15, 2015

I really think this is a bug in stack.
Lambdu (https://github.com/Peaker/lamdu) is building fine with cabal

@snoyberg
Copy link
Contributor

Cabal is inconsistent in its handling here. If I'm not mistaken, trying to install an sdist with an incorrectly named .cabal file would fail. Is there a reason why we want to support this workflow? It seems pretty broken to me.

@snoyberg snoyberg added this to the Later improvements milestone Jun 16, 2015
@rvion
Copy link
Contributor Author

rvion commented Jun 16, 2015

I'm not really 100% sure to understand why the package-name must match the cabal file name.
I don't really see the value of duplicating the info, but I may be too naive and I may miss some infos here.
I think it also comes down to: do we want stack to be as compatible as it can ?
Sure, if the behaviour is bad / inconsistent / broken in cabal, current state is good.

@snoyberg if you confirm stack is right, I can open issues on cabal and lamdu and link them here if you want.

@snoyberg
Copy link
Contributor

I think it's fair to call this a cabal bug, and opening an issue would be appreciated. To demonstrate, take a package (I used acme-missiles, as it's my go-to simple package example), rename the .cabal file, run cabal sdist, and then try to cabal install that tarball. I get:

$ cabal install dist/acme-missiles-0.3.tar.gz
Resolving dependencies...
Failed to install acme-missiles-0.3
Build log ( /home/vagrant/.cabal/logs/acme-missiles-0.3.log ):
cabal: /home/vagrant/.cabal/logs/acme-missiles-0.3.log: does not exist

And then:

$ cabal install dist/acme-missiles-0.3.tar.gz  -j1
Resolving dependencies...
Failed to install acme-missiles-0.3
cabal: Error: some packages failed to install:
acme-missiles-0.3 failed while unpacking the package. The exception was:
user error (Package .cabal file not found:
"/tmp/acme-missiles-0.3-1982/acme-missiles-0.3/acme-missiles.cabal"

@chrisdone
Copy link
Member

I'm also inclined to say they should match, and in this particular example there's no utility in them not matching.

@rodlogic
Copy link

One other advantage of matching is that you can just look at the file system and know what the project name is instead of being surprised by something different inside the cabal file.

@azverkan
Copy link

azverkan commented Feb 8, 2016

Are there any known workarounds for projects that are hosted in source control systems that append branch names to the project name? For example, package.cabal might be located in the folder package-dev/ package-1.0/, package/tags/1.0 etc...

@harendra-kumar
Copy link
Collaborator

There are no restrictions on the folder name. It is the name of the .cabal file that should match the package name field inside it.

geraldus added a commit to geraldus/ghcjs-hplay that referenced this issue Mar 12, 2016
hplayground.cabal does not match the package name it defines.  Please
rename the file to: ghcjs-hplay.cabal For more information, see:
commercialhaskell/stack#317
@isheff
Copy link

isheff commented Nov 8, 2016

As azverkan points out, when referring to other modules, say in git repositories (e.g. https://github.com/apache/thrift/tree/e134cbc6ff797c061332ecfae697e807832e1682/lib/hs ), it is not always the case that the filename and module name match. It would be super helpful to have some way of getting around this.

@dlthomas
Copy link

Yeah, I think wontfix is the wrong call here. Demanding that I follow best practices is one thing; demanding that all of my dependencies do is overkill.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants