Conversation
| -- @ | ||
| -- { "cabal-version": "1.23.0.0", | ||
| -- "compiler": { | ||
| -- "flavor": "GHC", |
There was a problem hiding this comment.
What would tea-drinking-dragon say seeing this one!
There was a problem hiding this comment.
The lib:Cabal data type is called CompilerFlavor... in principle we can change the name for 3.0.
| mkComponentInfo (name, clbi) = JsonObject | ||
| [ "type" .= JsonString compType | ||
| , "name" .= JsonString (prettyShow name) | ||
| , "unit-id" .= JsonString (prettyShow $ componentUnitId clbi) |
There was a problem hiding this comment.
this is not mentioned in the module header docs, but this is an important bit!
| @@ -0,0 +1,46 @@ | |||
| -- | Utility json lib for Cabal | |||
| -- TODO: Remove it again. | |||
There was a problem hiding this comment.
please explain. Make an issue, link to it.
TODOs in the code are almost never fixed "immediately".
| c -> error $ "ShowBuildInfo.getCompilerArgs: Don't know how to get "++ | ||
| "build arguments for compiler "++show c | ||
| where | ||
| -- This is absolutely awful |
There was a problem hiding this comment.
Should there be a ticket about this as well?
| ] | ||
|
|
||
| mkCompilerInfo = JsonObject | ||
| [ "flavour" .= JsonString (prettyShow $ compilerFlavor $ compiler lbi) |
There was a problem hiding this comment.
Spelling here disagrees with module header docs.
|
OK, let's merge now, but please expand comments as requested in the review feedback. |
This allows users to get a JSON representation of various information about how Cabal would go about building a package. The output of this command is intended for external tools and therefore the format should remain stable.
This commit builds upon the work of cfraz89 and completes the lib:Cabal part of the show-build-info feature. Co-authored-by: Chris Fraser <[email protected]>
8dc0c73 to
ac1fc0f
Compare
|
Merged, thanks! |
This is the lib:Cabal part extracted from PR #5954 by @fendor and squashed into two commits.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!