Skip to content

Ensure correct version of ghc-pkg for cabal repl --with-ghc=doctest - #8718

Closed
sol wants to merge 1 commit into
haskell:masterfrom
sol:doctest-ghc-pkg-fix
Closed

sol wants to merge 1 commit into
haskell:masterfrom
sol:doctest-ghc-pkg-fix

Conversation

@sol

@sol sol commented Feb 1, 2023 •

Copy link
Copy Markdown
Member

This addresses sol/doctest#396


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@sol

sol commented Feb 1, 2023

Copy link
Copy Markdown
Member Author

@andreasabel can you take over shepherd this?

-- responsibility when invoked with `--interactive`. On `--info` it
-- augments the result of `ghc --info` with three additional fields:
--
-- 1. ghc: The path to the `ghc` executable that is used by `doctest`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Please note that even though I describe this in the context of doctest, other tools that make creative use of cabal repl --with-ghc=.. (e.g. hie-bios) could benefit from this as well. All they would need to do is augment --info with the actual path to ghc.

@sol
sol force-pushed the doctest-ghc-pkg-fix branch from d691693 to 189beec Compare February 1, 2023 04:45
@sol sol changed the title Make sure that doctest finds the correct version of ghc-pkg Ensure corret version of ghc-pkg for cabal repl --with-ghc=doctest Feb 1, 2023
@andreasabel andreasabel changed the title Ensure corret version of ghc-pkg for cabal repl --with-ghc=doctest Ensure correct version of ghc-pkg for cabal repl --with-ghc=doctest Feb 22, 2023
progdb4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap progdb3
return (comp, compPlatform, progdb4)

type GhcInfo = Map String String

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 this get a haddockumentation?

  • What is the purpose?
  • What are the keys?
  • What are the values?
  • Example?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's the output of ghc --info

@andreasabel

Copy link
Copy Markdown
Member

@sol: Thanks for this PR!
What do you want me to do? Build&test locally?
CI passed, but maybe it does not have any tests for this multi-GHC feature.
Do you think you could add a test?

@andreasabel andreasabel added the re: --with-compiler Concerning option `-w` and similar label Feb 22, 2023
@sol

sol commented Feb 23, 2023

Copy link
Copy Markdown
Member Author

What do you want me to do?

This addresses sol/doctest#396.

If you still care about this use case, and care enough to put some effort into it, then please go ahead and take over this PR.

I acknowledge that other Doctest users could benefit from this too, but I don't have the capacity to finish this up myself.

Build&test locally?

The code is working as-is. What's left is getting it into a mergable state (eg does this need a change log entry? Bike shedding and what not...).

@wismill wismill mentioned this pull request May 27, 2024
2 of 5 tasks
@sol

sol commented Jun 25, 2025

Copy link
Copy Markdown
Member Author

This is addressed by sol/doctest#396 and will be further alleviated by #10996.

Closing.

@sol sol closed this Jun 25, 2025
@sol
sol deleted the doctest-ghc-pkg-fix branch June 25, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

re: --with-compiler Concerning option `-w` and similar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants