Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Mention that package names are case-sensitive #2111

Closed
wants to merge 1 commit into from

Conversation

ismail-s
Copy link

@ismail-s ismail-s commented May 6, 2016

If you feel this is a nitpick, or that I've phrased it badly, then by all means do what you want. But I just ran into this issue and it took me a while to realise that this might be the issue.

@sjakobi
Copy link
Member

sjakobi commented May 14, 2016

Well, that's a bit of information that is more in the scope of Cabal than in the scope of stack.

What we could possibly do is cite the relevant rules in the section for stack new:

A package is identified by a globally-unique package name, which consists of one or more alphanumeric words separated by hyphens. To avoid ambiguity, each of these words should contain at least one letter. Chaos will result if two distinct packages with the same name are installed on the same system.

(From https://www.haskell.org/cabal/users-guide/developing-packages.html#developing-packages)

What do you think, @mgsloan?

But tell me how exactly you ran into this problem, @ismail-s! Ideally you'd get a suggestion for similar, existing packages when you pass a misspelled package name to stack.

@ismail-s
Copy link
Author

Well, I was working through the cis194 Spring 2013 exercises, and the last exercise on monads requires the use of the MonadRandom module (note the uppercase chars). So I added monadrandom to the build-depends section of the cabal file, ran something like stack build/test, and got something like:

ismail_s:~/workspace/cis194-sols (master) $ stack build
While constructing the BuildPlan the following exceptions were encountered:

--  Failure when adding dependencies:    
      monadrandom: needed (-any), stack configuration has no specified version
    needed for package cis194-sols-0.1.0.0

--  While attempting to add dependency,
    Could not find package monadrandom in known packages

Eventually, once I thought to try typing MonadRandom instead, stack build worked successfully.

If you want more info on the environment I was running these commands in, or want to try it out yourself, then go to https://ide.c9.io/ismail_s/cis194-homework, you should be able to access it with your github account.

@mgsloan
Copy link
Contributor

mgsloan commented May 15, 2016

@sjakobi Sure, seems reasonable!

Thanks for the feedback, but I'm not sure how helpful it will be to point it out in this portion of the documentation. Pretty much everything in haskell is case-sensitive.

@ismail-s
Copy link
Author

Fair enough then, you guys can reject this PR. Ideally, though, stack would suggest similarly named packages in the error message.

@mgsloan
Copy link
Contributor

mgsloan commented May 15, 2016

Alright, thanks for the suggestion! Good idea about giving fuzzy suggestions for build-depends, I've noted it down on #1748 (comment)

@mgsloan mgsloan closed this May 15, 2016
@ismail-s ismail-s deleted the patch-1 branch May 16, 2016 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants