Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should bios cradles run ghc? #215

Closed
lukel97 opened this issue Jun 28, 2020 · 3 comments · Fixed by #231
Closed

How should bios cradles run ghc? #215

lukel97 opened this issue Jun 28, 2020 · 3 comments · Fixed by #231
Labels
type: enhancement New feature or request

Comments

@lukel97
Copy link
Contributor

lukel97 commented Jun 28, 2020

This a further piece of work from #207:

Cabal and stack cradles can run GHC to get the libdir from cabal exec ghc -- --print-libdir and stack exec ghc -- --print-libdir respectively.
Direct cradles just use the ghc on the path.
But what about bios programs? What ghc are they using exactly? There should be a way for the bios program to report this, either via the program or in a hie.yaml file

@lukel97 lukel97 changed the title How should bios cradles run ? How should bios cradles run ghc? Jun 29, 2020
@fendor fendor added the type: enhancement New feature or request label Jul 3, 2020
@pepeiborra
Copy link
Contributor

pepeiborra commented Jul 29, 2020

I was coming around to request this, well spotted @bubba !

A bios cradle currently has the following shape:

  bios:
    program: "program to run"
    dependency-program: "optional program to run"
    shell: build-tool flags $HIE_BIOS_ARG
    dependency-shell: build-tool dependencies

where each component has the type

program :: FilePath -> IO ([Flag], [Target])
shell :: String -> IO ([Flag], [Target])
dependency_program :: FilePath
dependency_shell :: [FilePath]

The path to GHC is not necessarily known statically, so we need a program to compute it, and it should be the same for the entire session - we don't want a different GHC per component or per file!

With that in mind, I propose adding a new optional field to the bios cradle section, which if present is used to compute the ghc path:

 with-ghc :: IO String
 with-ghc: "program to run"

@fendor
Copy link
Collaborator

fendor commented Jul 29, 2020

@pepeiborra The important bit is to document what kind of command line options this ghc must accept to be functional. E.g. currently we need it to accept --numeric-version and -print-libdir. What else might be helpful?

@pepeiborra
Copy link
Contributor

@fendor that too. But I came here because I want my bios scripts to be able to set the path to ghc, that's the important feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants