(Optionally) copy '-package-id' args from 'stack' #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the environment variable 'HALIVE_STACK_COMPONENT' is set, its value
will be passed to 'stack ghci' as the component to use. The command
line used to launch 'ghci' is extracted from 'stack' log output, and the
'-package-id=<...>' arguments used to configure the 'DynFlags' passed to
'runGhc'.
This is necessary when the stack package dbs contain multiple packages
that provide the same module. Without it, 'runGhc' will not be able to
know which package should be used to provide the module, producing an
error such as this:
demo/Shader.hs:3:8:
Ambiguous module name ‘Graphics.GL’:
it was found in multiple packages:
gl-0.7.7@gl_8feL1KNX30C7cRvC5KMerD OpenGLRaw-3.0.0.0@OpenG_2ifknuoKtb4Jnk98tmsl6Y
This is very slow, since it has to compile the project with 'ghci' just
to get the arguments -- only to be used to compile it again! But it
does make 'halive' work in situations where, without it, there would
only be failure.
(A proper solution would involve modifying 'stack' to provide this
information more efficiently.)