Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
57ab56bb
Commit
57ab56bb
authored
Jul 12, 2018
by
tmcgilchrist
Committed by
Mikhail Glushenkov
Jul 12, 2018
Browse files
Fixup spelling in hashedInstalledPackageIdVeryShort comment on OSX linker workaround.
parent
dcc157c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/PackageHash.hs
View file @
57ab56bb
{-# 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 li
r
bary
-- macOS has a limited load command size, to which the name of the lib
r
ary
-- 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 librar
y
s name, version and abi hash, but in
-- where libraryname contains the librar
ie
s 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 li
r
baries are *not* prefix relocat
e
able anymore as they all end up
-- 1) Packages can collide
more easily
due to the shortened hash.
-- 2) The lib
r
aries 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"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment