haskell / haskell/hsc2hs

hsc2hs shouldn't call cc directly

Open
#66 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
46
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Currently `hsc2hs` calls `cc` directly when it needs to compile C. However, in general it doesn't have enough information about the build context to do so robustly, especially when GHC becomes runtime-retargetable (since the choice of which C compiler is used is going to depend upon the GHC profile). This is already starting to affect us as `hsc2hs` isn't benefitting from upstream GHC changes like https://gitlab.haskell.org/ghc/ghc/-/issues/20162.

I propose that hsc2hs should consistently rely on `ghc` to invoke the C compiler, centralizing build configuration in GHC.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing hsc2hs's path for compiling C and identify where it invokes cc directly; the issue does not name files or tests. Compare that path with how ghc invokes the C compiler, then verify that hsc2hs consistently delegates through ghc so build configuration and compiler selection are centralized.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.