You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Describe the bug
The
CcInfo
provider returned byhaskell_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 therts
).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 modeCcInfo
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 theCcInfo
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, theHaskellInfo
provider (or another dedicated provider if deemed appropriate) could carry any libraries/objects required for GHCi/Template Haskell.The text was updated successfully, but these errors were encountered: