have hs-source-dirs: as a field in the default cabal file #1222

Closed
cartazio opened this Issue Feb 28, 2013 · 8 comments

Comments

Projects
None yet
2 participants
@cartazio
Member

cartazio commented Feb 28, 2013

it'd be handy to add this field to the default template generated when the "include comments" switch is selected.

If this is a patch y'all will accept, i'll figure out doing a tiny pull request for this

@byorgey

This comment has been minimized.

Show comment Hide comment
@byorgey

byorgey Feb 28, 2013

Member

Good idea. It may be as simple as flipping the Boolean value here:

https://github.com/haskell/cabal/blob/master/cabal-install/Distribution/Client/Init.hs#L725

but I don't quite remember how it works. A pull request would be great.

Member

byorgey commented Feb 28, 2013

Good idea. It may be as simple as flipping the Boolean value here:

https://github.com/haskell/cabal/blob/master/cabal-install/Distribution/Client/Init.hs#L725

but I don't quite remember how it works. A pull request would be great.

@cartazio

This comment has been minimized.

Show comment Hide comment
@cartazio

cartazio Mar 1, 2013

Member

i'm doing a test build of that change with cabal-dev right now, will test it on a toy example shortly, and if it works i'll fire off the pull request

if that works, this'll be the highest impact yet simplest patch i've ever done!
:)

Member

cartazio commented Mar 1, 2013

i'm doing a test build of that change with cabal-dev right now, will test it on a toy example shortly, and if it works i'll fire off the pull request

if that works, this'll be the highest impact yet simplest patch i've ever done!
:)

@cartazio

This comment has been minimized.

Show comment Hide comment
@cartazio

cartazio Mar 11, 2013

Member

seems that it only includes that field if there is a folder in already the direct i've "cabal init" 'd

Member

cartazio commented Mar 11, 2013

seems that it only includes that field if there is a folder in already the direct i've "cabal init" 'd

@byorgey

This comment has been minimized.

Show comment Hide comment
@byorgey

byorgey Mar 12, 2013

Member

Can you explain what you mean a bit more? Preferably with a minimal, reproducible test case?

Member

byorgey commented Mar 12, 2013

Can you explain what you mean a bit more? Preferably with a minimal, reproducible test case?

@cartazio

This comment has been minimized.

Show comment Hide comment
@cartazio

cartazio Mar 12, 2013

Member

case a:

mkdir projecths
cd projecths
cabal init
# stuff interacting with cabal, ending with yes, i want the commented fields

the resulting cabal file does not have the commented field

--- hs-source-dirs:
----- this field does not appear (commented or not) in the cabal file

whereas

case b:

mkdir projecths
cd projecths
mkdir src
cabal init
# stuff interacting with cabal, ending with yes, i want the commented fields

the resulting cabal file has the entry

hs-source-dirs: src

I think case a should have the commented field, if only to make it easier for new haskellers just starting with cabal to discover and start using it sooner, rather than once they're digging into the source of larger projects

Member

cartazio commented Mar 12, 2013

case a:

mkdir projecths
cd projecths
cabal init
# stuff interacting with cabal, ending with yes, i want the commented fields

the resulting cabal file does not have the commented field

--- hs-source-dirs:
----- this field does not appear (commented or not) in the cabal file

whereas

case b:

mkdir projecths
cd projecths
mkdir src
cabal init
# stuff interacting with cabal, ending with yes, i want the commented fields

the resulting cabal file has the entry

hs-source-dirs: src

I think case a should have the commented field, if only to make it easier for new haskellers just starting with cabal to discover and start using it sooner, rather than once they're digging into the source of larger projects

@byorgey

This comment has been minimized.

Show comment Hide comment
@byorgey

byorgey Mar 13, 2013

Member

OK, thanks. I agree having a commented hs-source-dirs field would be good. I'll look into this.

Member

byorgey commented Mar 13, 2013

OK, thanks. I agree having a commented hs-source-dirs field would be good. I'll look into this.

@byorgey

This comment has been minimized.

Show comment Hide comment
@byorgey

byorgey Mar 14, 2013

Member

I cannot reproduce this. When I do case a, I do indeed get

  -- Directories containing source files.
  -- hs-source-dirs:      

in the output .cabal file, as expected. I tried choosing both Library and Executable and it works with both. I'm going to close this ticket; feel free to reopen (with a detailed test case, exact copy-pasted from your terminal) if you think there's still an issue.

Member

byorgey commented Mar 14, 2013

I cannot reproduce this. When I do case a, I do indeed get

  -- Directories containing source files.
  -- hs-source-dirs:      

in the output .cabal file, as expected. I tried choosing both Library and Executable and it works with both. I'm going to close this ticket; feel free to reopen (with a detailed test case, exact copy-pasted from your terminal) if you think there's still an issue.

@byorgey byorgey closed this Mar 14, 2013

@cartazio

This comment has been minimized.

Show comment Hide comment
@cartazio

cartazio Mar 14, 2013

Member

looks like i had a stale build of the current cabal-install head, my bad.

Member

cartazio commented Mar 14, 2013

looks like i had a stale build of the current cabal-install head, my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment