-
Notifications
You must be signed in to change notification settings - Fork 710
cabal init allows a license that cabal install does not understand #4496
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
Comments
Thanks for the very clear report @Smattr. I've turned this into a newcomer task for someone new to Haskell who wants to dip their toe in the Cabal project. |
Thanks, @ezyang, and nice write up of an action plan! Gives the reader a very detailed idea of what they're in store for if they take the bait. |
I would like to work on this! I think I know how to do it (thanks to this excellently written issue) but I am having trouble setting up the development environment. I forked the repository and cloned it on my local machine. Then I tried to run
so I ran
Any ideas what I might be doing wrong? Can't wait to get started on this contribution! |
Despite the presence of a stack config file, I don't think any of the main developers use stack to develop cabal, so I guess it's not surprising it's not working. Try using new-build instead: https://github.com/haskell/cabal#building-cabal-for-hacking |
Yes, the stack build is broken more often than not. Patches welcome! |
Hi all! I just gave this issue a shot and opened a PR. It is building on travis now. I just checked and it looks like EDIT: added the fix for |
checks if license provided is alphanumeric. #4496
PR #4504 has been merged. I will close this for now. |
Nice work, everyone! Very speedy resolution. @2016rshah if you have a dev environment setup and are now in need of a new issue to work on, it looks like there are plenty of approachable open ones. Though it's not tagged with newcomer, #3853 might be a valuable one to address. I know little about Cabal internals, but am happy to help with setup problems or Haskell questions. @ezyang, please feel free to contradict anything I've said or give different issue suggestions if you disagree :) |
@Smattr I guess I better go newcomer-ify that ticket :) (There's something tricky, which is the code change probably needs to be made in hackage-security, not cabla-install) |
Uh oh!
There was an error while loading. Please reload this page.
Summary. For example, a license containing a space:
Despite the promising sounding title, this does not appear to be a duplicate of #3098 that talks about license-file, not license. It is possible this is related to #1074 if
cabal install
is callingcabal check
.Instructions from @ezyang. First, follow the instructions in the README at https://github.com/haskell/cabal for setting up your dev environment.
As you can see from
instance Parsec License
, the set of permitted characters for a free-form license text is one or more alpha-numeric characters. To fix this bug, you will have to modifycabal-install/Distribution/Client/Init.hs
to check if the other license has valid syntax and reject it / ask the user for another license if it does not.To see an example of an existing prompt which will reprompt if the text is invalid, see
getPackageName
.If you want to go further beyond this ticket, look at
getLanguage
and make sure it doesn't also suffer from the same error.A test for this fix is not necessary, but you should run the resulting cabal binary and check that the correct behavior occurs.
If you want a nice follow up task, look at #1074, decide what to do, and fix it!
What you will learn. How to test if a string is alphanumeric in Haskell; how the prompt mechanism in
cabal init
works. This is a nice and easy task to get started with the cabal-install build system as well.The text was updated successfully, but these errors were encountered: