Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
cc723f54
Commit
cc723f54
authored
Dec 09, 2016
by
Mikhail Glushenkov
Committed by
GitHub
Dec 09, 2016
Browse files
Merge pull request #4164 from abooij/issue-4156
First create then rename symlinks to fix #4156
parents
49f2eac1
9a3896d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/GHC.hs
View file @
cc723f54
...
...
@@ -1521,10 +1521,18 @@ installFLib verbosity lbi targetDir builtDir _pkg flib =
#
ifndef
mingw32_HOST_OS
-- createSymbolicLink file1 file2 creates a symbolic link
-- named file2 which points to the file file1.
-- Note that we do want a symlink to name rather than dst, because
-- the symlink will be relative to the directory it's created in.
createSymbolicLink
name
(
dstDir
</>
flibBuildName
lbi
flib
)
createSymbolicLink
name
(
dstDir
</>
"lib"
++
nm
<.>
"so"
)
-- Note that we do want a symlink to 'name' rather than 'dst',
-- because the symlink will be relative to the directory it's created
-- in.
-- Finally, we first install in a temporary directory and then rename
-- to simulate a ln --force
withTempDirectory
verbosity
dstDir
nm
$
\
tmpDir
->
do
let
link1
=
flibBuildName
lbi
flib
link2
=
"lib"
++
nm
<.>
"so"
createSymbolicLink
name
(
tmpDir
</>
link1
)
renameFile
(
tmpDir
</>
link1
)
(
dstDir
</>
link1
)
createSymbolicLink
name
(
tmpDir
</>
link2
)
renameFile
(
tmpDir
</>
link2
)
(
dstDir
</>
link2
)
where
nm
::
String
nm
=
unUnqualComponentName
$
foreignLibName
flib
...
...
cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs
View file @
cc723f54
...
...
@@ -26,6 +26,7 @@ main = setupAndCabalTest $ do
skipUnless
=<<
ghcVersionIs
(
>=
mkVersion
[
7
,
8
])
withPackageDb
$
do
setup_install
[]
setup
"copy"
[]
-- regression test #4156
dist_dir
<-
fmap
testDistDir
getTestEnv
lbi
<-
getLocalBuildInfoM
let
installDirs
=
absoluteInstallDirs
(
localPkgDescr
lbi
)
lbi
NoCopyDest
...
...
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