Skip to content

Support module thinning and renaming Cabal-side. - #2038

Merged
ezyang merged 1 commit into
haskell:masterfrom
ezyang:ezyang-renaming
Sep 18, 2014
Merged

ezyang merged 1 commit into
haskell:masterfrom
ezyang:ezyang-renaming

Conversation

@ezyang

@ezyang ezyang commented Aug 11, 2014

Copy link
Copy Markdown
Contributor

NB: unlike GHC, Cabal will still try to find a globally consistent choice for
all package names, i.e. this does not implement private dependencies.

Signed-off-by: Edward Z. Yang [email protected]

@23Skidoo

Copy link
Copy Markdown
Member

@ezyang
The Travis build is failing. Can you look into that?

@ezyang

ezyang commented Aug 11, 2014

Copy link
Copy Markdown
Contributor Author

Oops, looks like I forgot to update the tests.

Comment thread Cabal/Distribution/Package.hs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment saying what this Bool stands for? If it controls whether this module renaming is enabled, why not use Maybe ModRenaming instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment will do. It actually indicates whether or not to dump all of the exported modules into scope, independent of renaming. So ModRenaming False [] means nothing is visible and ModRenaming True [] means everything is visible. The renamings then just add on to this.

@23Skidoo

Copy link
Copy Markdown
Member

Looks good in general modulo some comments. Would be also nice to have a test case.

@ezyang

ezyang commented Aug 22, 2014

Copy link
Copy Markdown
Contributor Author

OK, updated with updates for comments.

@ezyang

ezyang commented Aug 22, 2014

Copy link
Copy Markdown
Contributor Author

Oh, re tests, does it make you feel any better if the GHC testsuite has the relevant tests? :)

@23Skidoo

Copy link
Copy Markdown
Member

Oh, re tests, does it make you feel any better if the GHC testsuite has the relevant tests? :)

If that includes tests for Cabal support, then yes.

@ezyang

ezyang commented Aug 23, 2014

Copy link
Copy Markdown
Contributor Author

So, Travis is failing because the install test for cabal-install is not using the right version of Cabal. Uh, I think this is not my fault?

@23Skidoo

Copy link
Copy Markdown
Member

Build failure on GHC 7.4 is because of haskell/random#10.

@23Skidoo

Copy link
Copy Markdown
Member

Travis issue is now fixed.

@tibbe

tibbe commented Aug 27, 2014

Copy link
Copy Markdown
Contributor

/cc @dcoutts

Comment thread Cabal/Distribution/Package.hs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bikeshedding: we tend to use full names, so should be ModuleRenaming.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the comments, this might be clearer as a record with descriptive names for the two fields. Something like moduleRenamingIncludeOriginals and moduleRenamings?

@dcoutts

dcoutts commented Aug 27, 2014

Copy link
Copy Markdown
Contributor

So my main concern is that pairing the renaming with the dependency is quite invasive. Do we really need them together or could this be simpler with the renaming being separate?

I was going to say that I can see that they need to be together while we resolve flags etc in the GenericPackageDescription -> PackageDescription conversion, but actually I don't think that's true.

So suppose we just had them together in the external syntax, but we had them as two seprate fields in the BuildInfo. Would that work?

@ezyang

ezyang commented Aug 27, 2014

Copy link
Copy Markdown
Contributor Author

OK, I think we can separate them.

@ezyang
ezyang force-pushed the ezyang-renaming branch 2 times, most recently from 5929518 to 28eca74 Compare August 29, 2014 01:42
@ezyang

ezyang commented Aug 29, 2014

Copy link
Copy Markdown
Contributor Author

Seperated. Duncan wanted one more change which was to store the renamings as a list so that original order is preserved, but we already preserve this order from targetBuildDepends, so I think we can just use a map. So it would be good if we can land this.

@ezyang

ezyang commented Sep 18, 2014

Copy link
Copy Markdown
Contributor Author

Hey guys, I'd like to get this merged. I'll merge it this weekend if there are no further comments.

@23Skidoo

Copy link
Copy Markdown
Member

No objections from me. Thank you for your contributions!

@ezyang
ezyang force-pushed the ezyang-renaming branch 2 times, most recently from 819513e to 30553ab Compare September 18, 2014 20:19
Unlike GHC, Cabal will still try to find a globally consistent choice for
all package names, i.e. this does *not* implement private dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
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.

4 participants