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

add hie-bios command #199

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add hie-bios command #199

wants to merge 3 commits into from

Conversation

hyperfekt
Copy link
Contributor

@hyperfekt hyperfekt commented May 7, 2020

This adds support for hie-bios.
Since hie-bios can't call a program with arguments (haskell/hie-bios#158), the following files are needed in the project:

hie.yaml:

cradle: {bios: {program: ".hie-bios"}}

.hie-bios:

#! /bin/sh
snack hie-bios $@

Closes #178.

@hyperfekt hyperfekt force-pushed the hie-bios branch 2 times, most recently from f11dc93 to dc390ce Compare May 7, 2020 18:21
@hyperfekt
Copy link
Contributor Author

Currently extra-directories are not yet implemented since I could not find a corresponding flag for GHC, and trying to use it with Digital Asset's ghcide will fail due to https://github.com/digital-asset/ghcide/issues/551.

@hyperfekt
Copy link
Contributor Author

hyperfekt commented May 9, 2020

I've thought about this and while I could add flags to add extra-directories as all kinds of different flags GHC offers for specifying search paths for different kinds of files, this would still not cover all uses (for example Template Haskell as used in Snack itself).
The real solution would be to have hie-bios ask on behalf of its dependents for directories to add to the PATH for a session, or for GHC to add a flag to add directories to the PATH (which would also need to be reflected in its API).
A workaround would be to add all those directories to the PATH of hie-bios dependents like it is done for GHCi by Snack right now, which of course has the problem of collisions between files in extra-directories in different packages.
Another option would be to allow extra-directories only in the root project (or even get rid of it entirely, in which case TH would have to call out to Nix I guess?) so that collisions are not a possibility.

@hyperfekt
Copy link
Contributor Author

I implemented shell commands for hie-bios so maybe this command should not be hie-bios specific, and output the flags to stdout instead, and the shell command can be used to pipe that into the file required by hie-bios.

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.

Support hie-bios
1 participant