[Git][ghc/ghc][wip/cabal-3.14] 3 commits: hadrian: Handle broken symlinks properly when creating source dist directories
Zubin (@wz1000)
gitlab at gitlab.haskell.org
Thu Oct 10 09:53:11 UTC 2024
Zubin pushed to branch wip/cabal-3.14 at Glasgow Haskell Compiler / GHC
Commits:
407694e8 by Zubin Duggal at 2024-10-10T15:22:52+05:30
hadrian: Handle broken symlinks properly when creating source dist directories
If we have a broken symlink in the repository, don't try to `need` the symlink
or the target of the symlink. Attempting to do so has `shake` attempt to read the
target to compute its hash, which fails because the target doesn't exist.
- - - - -
2d64fd7a by Zubin Duggal at 2024-10-10T15:22:52+05:30
hadrian: exclude cabal.project.symlink.broken from source archives
Cabal 3.14 introduced a broken symlink in its testsuite. Unfortunately,
this broke our source distribution as we use use `tar --dereference` to avoid
issues with symlink compatibility on windows, and `tar --dereference` chokes
when it encounters any broken symlinks.
We can't get rid of `--dereference` because symlinks are generally broken on
windows, so the only option is to exclude this file from source archives.
see also https://github.com/haskell/cabal/issues/10442
- - - - -
4e74bf73 by Zubin Duggal at 2024-10-10T15:22:52+05:30
Bump Cabal submodule to 3.14
Metric Increase:
haddock.Cabal
- - - - -
4 changed files:
- hadrian/src/Rules/SourceDist.hs
- libraries/Cabal
- testsuite/tests/driver/T4437.hs
- utils/haddock/haddock-test/src/Test/Haddock/Config.hs
Changes:
=====================================
hadrian/src/Rules/SourceDist.hs
=====================================
@@ -55,8 +55,8 @@ archiveSourceTree prepare fname = do
runBuilderWithCmdOptions
[Cwd $ sourceDistRoot -/- dirName]
(Tar Create)
- ["chJf", ".." -/- tarName, baseName]
- ["chJf", ".." -/- tarName] [baseName]
+ ["--exclude=cabal.project.symlink.broken","-chJf", ".." -/- tarName, baseName]
+ ["--exclude=cabal.project.symlink.broken","-chJf", ".." -/- tarName] [baseName]
-- | This creates a symlink to the 'source' at 'target'
@@ -74,7 +74,9 @@ copyFileSourceDist source target = do
error ("source-dist: tried to create non-relative symlink in source dist: " ++ show link_target)
putProgressInfo =<< renderAction ("Create symlink (" ++ link_target ++ ")") source target
isDirectory <- liftIO $ IO.doesDirectoryExist source
- when (not isDirectory) $
+ -- We don't want to call `need` on broken symlinks
+ linkTargetExists <- liftIO $ IO.doesPathExist link_target
+ when (not isDirectory && linkTargetExists) $
need [source]
let createLink src tgt
| isDirectory = liftIO $ IO.createDirectoryLink src tgt
=====================================
libraries/Cabal
=====================================
@@ -1 +1 @@
-Subproject commit 56fb1dc9baa20b079eb0fa84ccafb284a6e91d41
+Subproject commit 2a48e40fdf320caa4240ce8eb28841e31f4f3de3
=====================================
testsuite/tests/driver/T4437.hs
=====================================
@@ -36,11 +36,7 @@ check title expected got
-- See Note [Adding a language extension] in compiler/GHC/Driver/Session.hs.
expectedGhcOnlyExtensions :: [String]
-expectedGhcOnlyExtensions =
- [ "OrPatterns"
- , "NamedDefaults"
- , "MultilineStrings"
- ]
+expectedGhcOnlyExtensions = [ ]
expectedCabalOnlyExtensions :: [String]
expectedCabalOnlyExtensions = ["Generics",
=====================================
utils/haddock/haddock-test/src/Test/Haddock/Config.hs
=====================================
@@ -18,7 +18,7 @@ import Data.Maybe
import Distribution.Text
import Distribution.Types.PackageName
import Distribution.InstalledPackageInfo
-import Distribution.Simple.Compiler (PackageDB(..))
+import Distribution.Simple.Compiler (PackageDB(..), PackageDBX( GlobalPackageDB ))
import Distribution.Simple.GHC
import Distribution.Simple.PackageIndex
import Distribution.Simple.Program
@@ -257,7 +257,7 @@ baseDependencies ghcPath = do
(comp, _, cfg) <- configure normal (Just ghcPath) Nothing
defaultProgramDb
- pkgIndex <- getInstalledPackages normal comp [GlobalPackageDB] cfg
+ pkgIndex <- getInstalledPackages normal comp Nothing [GlobalPackageDB] cfg
let
pkgs =
[ "array"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9c05cd1e1e9daffb708285fcc03b0ffd13f5cbb0...4e74bf73c04104cf885828ef7611813fac7c2efb
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9c05cd1e1e9daffb708285fcc03b0ffd13f5cbb0...4e74bf73c04104cf885828ef7611813fac7c2efb
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241010/49d3a23e/attachment-0001.html>
More information about the ghc-commits
mailing list