Commit 57ab56bb authored by tmcgilchrist's avatar tmcgilchrist Committed by Mikhail Glushenkov
Browse files

Fixup spelling in hashedInstalledPackageIdVeryShort comment on OSX linker workaround.

parent dcc157c6
{-# LANGUAGE RecordWildCards, NamedFieldPuns, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-}
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
-- | Functions to calculate nix-style hashes for package ids.
......@@ -135,22 +135,22 @@ hashedInstalledPackageIdShort pkghashinputs@PackageHashInputs{pkgHashPkgId} =
| otherwise = take (n-1) s ++ "_"
-- | On macOS we shorten the name very aggressively. The mach-o linker on
-- macOS has a limited load command size, to which the name of the lirbary
-- macOS has a limited load command size, to which the name of the library
-- as well as its relative path (\@rpath) entry count. To circumvent this,
-- on macOS the libraries are not stored as
-- @store/<libraryname>/libHS<libraryname>.dylib@
-- where libraryname contains the librarys name, version and abi hash, but in
-- where libraryname contains the libraries name, version and abi hash, but in
-- @store/lib/libHS<very short libraryname>.dylib@
-- where the very short library name drops all vowels from the package name,
-- and truncates the hash to 4 bytes.
--
-- We therefore only need one \@rpath entry to @store/lib@ instead of one
-- We therefore we only need one \@rpath entry to @store/lib@ instead of one
-- \@rpath entry for each library. And the reduced library name saves some
-- additional space.
--
-- This however has two major drawbacks:
-- 1) Packages can easier collide due to the shortened hash.
-- 2) The lirbaries are *not* prefix relocateable anymore as they all end up
-- 1) Packages can collide more easily due to the shortened hash.
-- 2) The libraries are *not* prefix relocatable anymore as they all end up
-- in the same @store/lib@ folder.
--
-- The ultimate solution would have to include generating proxy dynamic
......@@ -248,7 +248,7 @@ renderPackageHashInputs PackageHashInputs{
-- the default value for that feature. So if we avoid adding entries with
-- the default value then most of the time adding new features will not
-- change the hashes of existing packages and so fewer packages will need
-- to be rebuilt.
-- to be rebuilt.
--TODO: [nice to have] ultimately we probably want to put this config info
-- into the ghc-pkg db. At that point this should probably be changed to
......@@ -276,8 +276,8 @@ renderPackageHashInputs PackageHashInputs{
, opt "ghci-lib" False display pkgHashGHCiLib
, opt "prof-lib" False display pkgHashProfLib
, opt "prof-exe" False display pkgHashProfExe
, opt "prof-lib-detail" ProfDetailDefault showProfDetailLevel pkgHashProfLibDetail
, opt "prof-exe-detail" ProfDetailDefault showProfDetailLevel pkgHashProfExeDetail
, opt "prof-lib-detail" ProfDetailDefault showProfDetailLevel pkgHashProfLibDetail
, opt "prof-exe-detail" ProfDetailDefault showProfDetailLevel pkgHashProfExeDetail
, opt "hpc" False display pkgHashCoverage
, opt "optimisation" NormalOptimisation (show . fromEnum) pkgHashOptimization
, opt "split-objs" False display pkgHashSplitObjs
......@@ -354,4 +354,3 @@ hashFromTUF (Sec.Hash hashstr) =
(hash, trailing) | not (BS.null hash) && BS.null trailing
-> HashValue hash
_ -> error "hashFromTUF: cannot decode base16 hash"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment