Skip to content
Snippets Groups Projects
romes's avatar
Rodrigo Mesquita authored
Note [Loading Plugins]
~~~~~~~~~~~~~~~~~~~~~~

When loading plugins, we must be careful to check that certain packages we
depend on, like ghc the library, are ABI compatible with the packages the
plugin was linked against.

Currently, ghc the library and the boot packages don't have an ABI hash in
their identifier. Consequently, when loading a plugin that was linked against
ghc-v-xxx into a module that is being linked against ghc-v-yyy, we must
(somehow) guarantee that xxx and yyy are indeed the same, which isn't trivial
because xxx and yyy aren't available in the package identifier. Or we risk
linking the plugin against an incompatible ghc of the same version, leading to
crashes and segmentation faults (since the loaded plugin will make use of an
incompatible library thinking it's compatible).

A solution is to re-compute the ABI hash of the plugin being loaded and compare
it against the ABI hash of the plugin as computed by the compiler that compiled
it. If the hashes are one and the same, it's safe to load the plugin.

-- Because the ABI hash (see addFingerprints) depends on ... ?

See also #20742
4df21502
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..