haskell / haskell/cabal

Compiler ABI hash should include the toolchain

Open
#10,811 0 comments 0 reactions 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Currently `cabal-install` will create one store directory per distinct compiler. However this is not quite correct since it only consults the "Project Unit Id" field, which records a hash of the build configuration which produced the compiler, but doesn't include toolchain information.

For example, if you install the same compiler twice with two different toolchains then `cabal-install` will reuse the same store directory, however, this is very likely to not work correctly. For instance, you can't typically use `clang` to link together object files produced by `gcc` or vice-versa.

Therefore it would be better to include more information in the hash. The `settings` file seems appropriate, as that contains (1) The Project Unit Id, which records information about the build, and also (2) any information about the configured toolchain that is discovered during installation.

Related to #10170

Contributor guide

Open the contributing guide

Research direction

Start by tracing how cabal-install derives the compiler store directory from the Project Unit Id and how the settings file is read during installation. Compare installations using different toolchains, including gcc and clang, and verify that their store directories no longer collide. Done means the toolchain information discovered in settings contributes to the compiler ABI hash.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.