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

CcInfo does not take profiling mode into account #895

Closed
aherrmann opened this issue May 24, 2019 · 0 comments · Fixed by #896
Closed

CcInfo does not take profiling mode into account #895

aherrmann opened this issue May 24, 2019 · 0 comments · Fixed by #896

Comments

@aherrmann
Copy link
Member

Describe the bug
The CcInfo provider returned by haskell_library does not take the profiling mode into account. Similarly, haskell_toolchain_library ignores the profiling mode artifacts of toolchain libraries. (Relatedly, it also ignores the _thr, _debug versions of the rts).

Expected behavior
If the CcInfo provider is to faithfully describe the compilation results of a Haskell target, then it should reflect profiling mode. I.e. in regular compilation mode CcInfo would carry the regular shared and static libraries. In profiling mode it would only carry the static profiling library, as GHC does not produce dynamic libraries in profiling mode.

Additional context
Ideally, HaskellInfo would not need to carry any .so/.a files itself, instead those would all be carried by the CcInfo provider. However, this may not be fully achievable.

Notably, dropping all non-profiling libraries in profiling mode seems to enforce compilation with -fexternal-interpreter, which imposes a significant performance penalty. See #438.

Also, the static archives of GHC's core packages shipped with nixpkgs or the GHC bindist on Unix are compiled without -fPIC. Which may be an issue with GHCi/Template Haskell.

Nonetheless, it seems reasonable to let CcInfo handle the regular compilation path. I.e. not worrying about GHCi/Template Haskell. Where necessary, the HaskellInfo provider (or another dedicated provider if deemed appropriate) could carry any libraries/objects required for GHCi/Template Haskell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant