Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Cabal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
f5133394
Commit
f5133394
authored
Jan 09, 2019
by
David Eichmann
🏋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extra-bundled-libraries: align naming convention with ghc
parent
3904dfbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
11 deletions
+79
-11
Cabal/Distribution/Simple/BuildPaths.hs
Cabal/Distribution/Simple/BuildPaths.hs
+21
-1
Cabal/Distribution/Simple/GHC.hs
Cabal/Distribution/Simple/GHC.hs
+43
-10
Cabal/doc/developing-packages.rst
Cabal/doc/developing-packages.rst
+9
-0
Cabal/doc/file-format-changelog.rst
Cabal/doc/file-format-changelog.rst
+6
-0
No files found.
Cabal/Distribution/Simple/BuildPaths.hs
View file @
f5133394
...
...
@@ -31,7 +31,8 @@ module Distribution.Simple.BuildPaths (
mkGenericSharedLibName
,
mkSharedLibName
,
mkStaticLibName
,
mkGenericSharedBundledLibName
,
exeExtension
,
objExtension
,
dllExtension
,
...
...
@@ -57,6 +58,7 @@ import Distribution.System
import
Distribution.Verbosity
import
Distribution.Simple.Utils
import
Data.List
(
stripPrefix
)
import
System.FilePath
((
</>
),
(
<.>
),
normalise
)
-- ---------------------------------------------------------------------------
...
...
@@ -218,6 +220,24 @@ mkStaticLibName platform (CompilerId compilerFlavor compilerVersion) lib
=
"lib"
++
getHSLibraryName
lib
++
"-"
++
comp
<.>
staticLibExtension
platform
where
comp
=
prettyShow
compilerFlavor
++
prettyShow
compilerVersion
-- | Create a library name for a bundled shared library from a given name.
-- This matches the naming convention for shared libraries as implemented in
-- GHC's packageHsLibs function in the Packages module.
-- If the given name is prefixed with HS, then this prepends 'lib' and appends
-- the compiler flavour/version and shared library extension e.g.:
-- "HSrts-1.0" -> "libHSrts-1.0-ghc8.7.20190109.so"
-- Otherwise the given name should be prefixed with 'C', then this strips the
-- 'C', prepends 'lib' and appends the shared library extension e.g.:
-- "Cffi" -> "libffi.so"
mkGenericSharedBundledLibName
::
Platform
->
CompilerId
->
String
->
String
mkGenericSharedBundledLibName
platform
comp
lib
|
"HS"
`
isPrefixOf
`
lib
=
mkGenericSharedLibName
platform
comp
lib
|
Just
lib'
<-
stripPrefix
"C"
lib
=
"lib"
++
lib'
<.>
dllExtension
platform
|
otherwise
=
error
(
"Don't understand library name "
++
lib
)
-- ------------------------------------------------------------
-- * Platform file extensions
-- ------------------------------------------------------------
...
...
Cabal/Distribution/Simple/GHC.hs
View file @
f5133394
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE CPP #-}
...
...
@@ -109,12 +110,12 @@ import Distribution.Types.UnqualComponentName
import
Distribution.Utils.NubList
import
Language.Haskell.Extension
import
Control.Monad
(
msum
)
import
Control.Monad
(
msum
,
forM_
)
import
Data.Char
(
isLower
)
import
qualified
Data.Map
as
Map
import
System.Directory
(
doesFileExist
,
getAppUserDataDirectory
,
createDirectoryIfMissing
,
canonicalizePath
,
removeFile
,
renameFile
)
,
canonicalizePath
,
removeFile
,
renameFile
,
getDirectoryContents
)
import
System.FilePath
(
(
</>
),
(
<.>
),
takeExtension
,
takeDirectory
,
replaceExtension
,
isRelative
)
...
...
@@ -1820,7 +1821,7 @@ installLib :: Verbosity
->
Library
->
ComponentLocalBuildInfo
->
IO
()
installLib
verbosity
lbi
targetDir
dynlibTargetDir
_builtDir
_
pkg
lib
clbi
=
do
installLib
verbosity
lbi
targetDir
dynlibTargetDir
_builtDir
pkg
lib
clbi
=
do
-- copy .hi files over:
whenVanilla
$
copyModuleFiles
"hi"
whenProf
$
copyModuleFiles
"p_hi"
...
...
@@ -1829,7 +1830,10 @@ installLib verbosity lbi targetDir dynlibTargetDir _builtDir _pkg lib clbi = do
-- copy the built library files over:
whenHasCode
$
do
whenVanilla
$
do
sequence_
[
installOrdinary
builtDir
targetDir
(
mkGenericStaticLibName
(
l
++
f
))
sequence_
[
installOrdinary
builtDir
targetDir
(
mkGenericStaticLibName
(
l
++
f
))
|
l
<-
getHSLibraryName
(
componentUnitId
clbi
)
:
(
extraBundledLibs
(
libBuildInfo
lib
))
,
f
<-
""
:
extraLibFlavours
(
libBuildInfo
lib
)
]
...
...
@@ -1837,12 +1841,41 @@ installLib verbosity lbi targetDir dynlibTargetDir _builtDir _pkg lib clbi = do
whenProf
$
do
installOrdinary
builtDir
targetDir
profileLibName
whenGHCi
$
installOrdinary
builtDir
targetDir
ghciProfLibName
whenShared
$
sequence_
[
installShared
builtDir
dynlibTargetDir
(
mkGenericSharedLibName
platform
compiler_id
(
l
++
f
))
|
l
<-
getHSLibraryName
uid
:
extraBundledLibs
(
libBuildInfo
lib
)
,
f
<-
""
:
extraDynLibFlavours
(
libBuildInfo
lib
)
]
whenShared
$
if
-- The behavior for "extra-bundled-libraries" changed in version 2.5.0.
-- See ghc issue #15837 and Cabal PR #5855.
|
specVersion
pkg
<
mkVersion
[
2
,
5
]
->
do
sequence_
[
installShared
builtDir
dynlibTargetDir
(
mkGenericSharedLibName
platform
compiler_id
(
l
++
f
))
|
l
<-
getHSLibraryName
uid
:
extraBundledLibs
(
libBuildInfo
lib
)
,
f
<-
""
:
extraDynLibFlavours
(
libBuildInfo
lib
)
]
|
otherwise
->
do
sequence_
[
installShared
builtDir
dynlibTargetDir
(
mkGenericSharedLibName
platform
compiler_id
(
getHSLibraryName
uid
++
f
))
|
f
<-
""
:
extraDynLibFlavours
(
libBuildInfo
lib
)
]
sequence_
[
do
files
<-
getDirectoryContents
builtDir
let
l'
=
mkGenericSharedBundledLibName
platform
compiler_id
l
forM_
files
$
\
file
->
when
(
l'
`
isPrefixOf
`
file
)
$
do
isFile
<-
doesFileExist
(
builtDir
</>
file
)
when
isFile
$
do
installShared
builtDir
dynlibTargetDir
file
|
l
<-
extraBundledLibs
(
libBuildInfo
lib
)
]
where
builtDir
=
componentBuildDir
lbi
clbi
...
...
Cabal/doc/developing-packages.rst
View file @
f5133394
...
...
@@ -2453,6 +2453,15 @@ system-dependent values for these fields.
directory
(
e
.
g
.
via
a
custom
setup
).
Libraries
listed
here
will
be
included
when
``
copy
``-
ing
packages
and
be
listed
in
the
``
hs
-
libraries
``
of
the
package
configuration
in
the
package
database
.
Library
names
must
either
be
prefixed
with
"HS"
or
"C"
and
corresponding
library
file
names
must
match
:
-
Libraries
with
name
"HS<library-name>"
:
-
`
libHS
<
library
-
name
>.
a
`
-
`
libHS
<
library
-
name
>-
ghc
<
ghc
-
flavour
><
ghc
-
version
>.<
dyn
-
library
-
extension
>*`
-
Libraries
with
name
"C<library-name>"
:
-
`
libC
<
library
-
name
>.
a
`
-
`
lib
<
library
-
name
>.<
dyn
-
library
-
extension
>*`
..
pkg
-
field
::
extra
-
lib
-
dirs
:
directory
list
...
...
Cabal/doc/file-format-changelog.rst
View file @
f5133394
...
...
@@ -49,6 +49,12 @@ relative to the respective preceding *published* version.
* Require fields with optional commas to consistently omit or place
commas between elements.
* Changed the behavior of `extra-bundled-libraries` field. The naming convention
of dynamic library files (e.g. generated by a custom build script) has
changed. For library names prefixed with "C", the dynamic library file
name(s) must be of the form `lib<library-name>.<dyn-library-extension>*`
instead of the old `libC<library-name>-ghc<ghc-flavour><ghc-version>.<dyn-library-extension>`
``cabal-version: 2.4``
----------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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