Repository navigation
Implement build-tool-depends - #4104
Conversation
|
@Ericson2314, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ezyang, @dcoutts and @phadej to be potential reviewers. |
| -- could refer to a pkg-config executable (PkgconfigName), or an internal | ||
| -- executable (UnqualComponentName). Thus the name is stringly typed. | ||
| -- | ||
| --g |
| PackageName | ||
| UnqualComponentName -- name of executable component of package | ||
| VersionRange | ||
| deriving (Generic, Read, Show, Eq, Typeable, Data) |
There was a problem hiding this comment.
It is possible that you may want a helper function that takes an ExeDependency and gives a ComponentName (since the UnqualComponentName is only "implicitly" qualified.) I don't know if you'd actually use it.
There was a problem hiding this comment.
Sure, doesn't hurt to add it now. Good hint on unqual vs qual for anyone working with the code base.
|
|
||
| parse = do name <- parse | ||
| _ <- Parse.char ':' | ||
| exe <- parse |
There was a problem hiding this comment.
OK, so right now you are forced to specify the executable name. That's fine (although our users might complain :)
There was a problem hiding this comment.
Besides laziness, I figured a blanket depend-on-all-the-exes dependency might complicate making the solver use deps on specific components. Then again we may need a blanket package dep anyways.
ezyang
left a comment
There was a problem hiding this comment.
Commit 3 (commit 2 was obvious, no problem.)
| -- that we know how to desugar. | ||
| -- | ||
| -- This should almost always be used instead of just accessing the | ||
| -- `toolDepends` field directly. |
There was a problem hiding this comment.
Ok, if that's true there better be a comment on toolDepends telling people about it, or rename that field to something to discourage people from using it directoy.
There was a problem hiding this comment.
I added some longer documentation to the relevant fields in the top commit. I'll also grep at the end to make sure nothing is lurking.
There was a problem hiding this comment.
I could sed the field names too, but probably easiest to do that last.
| -- | ||
| -- This is a tiny function, but used in a number of places. Note that the | ||
| -- version bounds and components of the package are unchecked. This is because | ||
| -- we sanitize exe deps so that the matching name implies these other |
There was a problem hiding this comment.
Where does this sanitizing happen.
There was a problem hiding this comment.
PackageDescription.Check does sanitation happen in places besides that?
There was a problem hiding this comment.
I think the overall codebase doesn't use "sanitization" as the term here. Furthermore, not all checks in PackageDescription.Check are necessarily run all the time: a package can still be built even if some of the checks fail. It is better to say that there is some invariant that is expected to hold; in that case the invariant description should be at the data type definition.
| ++ "'tested-with: GHC==6.10.4 && ==6.12.3'." | ||
|
|
||
| , check (not (null buildDependsRangeOnInternalLibrary)) $ | ||
| , check (not (null depInternalLibraryWithExtraVersion)) $ |
There was a problem hiding this comment.
I didn't read this code carefully. Good tests would tickle all of these cases.
There was a problem hiding this comment.
Whew! A lot of copy pasta but tested everything.
|
Looking good. Obviously you still need to do the cabal-install bits. |
f6d7e02 to
3269f83
Compare
|
How should I write the (presumably system) tests for those tests? I see the cabal files in |
b1487b4 to
fd11fbc
Compare
|
You may want to wait until #4095 is merged. |
|
Hmm good idea |
|
Hmm, so |
|
@Ericson2314 We got rid of this feature in af24cef. Internal library should always be used. |
fd11fbc to
e298eee
Compare
e298eee to
30b4fa8
Compare
|
|
2419889 to
e11029c
Compare
|
Lookin' good! |
| , let toolname = mkUnqualComponentName name | ||
| , toolname `elem` map exeName (executables pkg_descr) ] | ||
| | (ExeDependency _ toolname _) | ||
| <- getAllInternalToolDependencies pkg_descr bi ] |
| -- precisely specify an executable in a package. | ||
| -- | ||
| -- Unless use are very sure what you are doing, use the function in | ||
| -- `Distribution.FooBar` rather than accessing this field directly. |
|
NB: this shouldn't be merged until "Ok things left:" list is done. |
|
@ezyang what's the first todo item about? if it's about |
|
Looking at the source code, it doesn't look like the new-build code has been adjusted for tool-depends yet. But maybe no changes were needed; I don't know if it works or not; the tests would be able to say so. |
30e62d9 to
0b62af1
Compare
acfb6aa to
a6cee38
Compare
|
Ok, docs are done also all that remains is |
|
Yep. Anything in particular you want reviewed before merging? |
|
let's get this merged soon before the PR starts to "conflict-rot" :-) |
This is a bug from `first build-tool-depends` PR: haskell#4104
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
|
@Ericson2314 It would be great if we could have a changelog entry too! |
|
I can't wait till this gets to hvr's ppa repository so I can try it out wild! |
|
@phadej ...I got the hint ;-) |
|
@ezyang OK I will do that in the PR that https://github.com/Ericson2314/cabal/tree/build-tool-depends-glob turns into. |
|
Thanks! |
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
This is a bug from `first build-tool-depends` PR: haskell#4104 Also, remove TODO about factoring things out. The exact set of deps filter here is no longer so globally relevant, and `Distribution.Simple.BuildToolDepends` exposes better filters which are.
Implements much of #3708
Note the the exe component name is currently mandatory, unlike as specified in the original issue.