Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't merge: Remove includes-field #10153

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ buildInfoFieldGrammar =
<*> monoidalFieldAla "extra-lib-dirs-static" (alaList' FSep SymbolicPathNT) L.extraLibDirsStatic
^^^ availableSince CabalSpecV3_8 []
<*> monoidalFieldAla "include-dirs" (alaList' FSep SymbolicPathNT) L.includeDirs
<*> monoidalFieldAla "includes" (alaList' FSep SymbolicPathNT) L.includes
<*> monoidalFieldAla "autogen-includes" (alaList' FSep RelativePathNT) L.autogenIncludes
^^^ availableSince CabalSpecV3_0 []
<*> monoidalFieldAla "install-includes" (alaList' FSep RelativePathNT) L.installIncludes
Expand Down
4 changes: 0 additions & 4 deletions Cabal-syntax/src/Distribution/Types/BuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ data BuildInfo = BuildInfo
, extraLibDirsStatic :: [SymbolicPath Pkg (Dir Lib)]
, includeDirs :: [SymbolicPath Pkg (Dir Include)]
-- ^ directories to find .h files
, includes :: [SymbolicPath Include File]
-- ^ The .h files to be found in includeDirs
, autogenIncludes :: [RelativePath Include File]
-- ^ The .h files to be generated (e.g. by @autoconf@)
, installIncludes :: [RelativePath Include File]
Expand Down Expand Up @@ -189,7 +187,6 @@ instance Monoid BuildInfo where
, extraLibDirs = []
, extraLibDirsStatic = []
, includeDirs = []
, includes = []
, autogenIncludes = []
, installIncludes = []
, options = mempty
Expand Down Expand Up @@ -242,7 +239,6 @@ instance Semigroup BuildInfo where
, extraLibDirs = combineNub extraLibDirs
, extraLibDirsStatic = combineNub extraLibDirsStatic
, includeDirs = combineNub includeDirs
, includes = combineNub includes
, autogenIncludes = combineNub autogenIncludes
, installIncludes = combineNub installIncludes
, options = combine options
Expand Down
3 changes: 0 additions & 3 deletions Cabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,6 @@ instance HasBuildInfo BuildInfo where
includeDirs f s = fmap (\x -> s{T.includeDirs = x}) (f (T.includeDirs s))
{-# INLINE includeDirs #-}

includes f s = fmap (\x -> s{T.includes = x}) (f (T.includes s))
{-# INLINE includes #-}

autogenIncludes f s = fmap (\x -> s{T.autogenIncludes = x}) (f (T.autogenIncludes s))
{-# INLINE autogenIncludes #-}

Expand Down
2 changes: 0 additions & 2 deletions Cabal-syntax/src/Distribution/Types/InstalledPackageInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ data InstalledPackageInfo = InstalledPackageInfo
, extraLibrariesStatic :: [String]
, extraGHCiLibraries :: [String] -- overrides extraLibraries for GHCi
, includeDirs :: [FilePath]
, includes :: [String]
, -- INVARIANT: if the package is definite, UnitId is NOT
-- a ComponentId of an indefinite package
depends :: [UnitId]
Expand Down Expand Up @@ -163,7 +162,6 @@ emptyInstalledPackageInfo =
, extraLibrariesStatic = []
, extraGHCiLibraries = []
, includeDirs = []
, includes = []
, depends = []
, abiDepends = []
, ccOptions = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ ipiFieldGrammar =
<@> monoidalFieldAla "extra-libraries-static" (alaList' FSep Token) L.extraLibrariesStatic
<@> monoidalFieldAla "extra-ghci-libraries" (alaList' FSep Token) L.extraGHCiLibraries
<@> monoidalFieldAla "include-dirs" (alaList' FSep FilePathNT) L.includeDirs
<@> monoidalFieldAla "includes" (alaList' FSep FilePathNT) L.includes
<@> monoidalFieldAla "depends" (alaList FSep) L.depends
<@> monoidalFieldAla "abi-depends" (alaList FSep) L.abiDepends
<@> monoidalFieldAla "cc-options" (alaList' FSep Token) L.ccOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ includeDirs :: Lens' InstalledPackageInfo [FilePath]
includeDirs f s = fmap (\x -> s{T.includeDirs = x}) (f (T.includeDirs s))
{-# INLINE includeDirs #-}

includes :: Lens' InstalledPackageInfo [String]
includes f s = fmap (\x -> s{T.includes = x}) (f (T.includes s))
{-# INLINE includes #-}

depends :: Lens' InstalledPackageInfo [UnitId]
depends f s = fmap (\x -> s{T.depends = x}) (f (T.depends s))
{-# INLINE depends #-}
Expand Down
2 changes: 0 additions & 2 deletions Cabal/src/Distribution/PackageDescription/Check/Target.hs
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,6 @@ checkBuildInfoPathsWellFormedness bi = do
mapM_
(checkPath False "hs-source-dirs" PathKindDirectory . getSymbolicPath)
(hsSourceDirs bi)
-- Possibly absolute paths.
mapM_ (checkPath True "includes" PathKindFile . getSymbolicPath) (includes bi)
Copy link
Member Author

@sol sol Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code checked that includes exist and that the paths are well-formed.

mapM_
(checkPath True "include-dirs" PathKindDirectory . getSymbolicPath)
(includeDirs bi)
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2499,7 +2499,7 @@ checkForeignDeps pkg lbi verbosity =
explainErrors missingHdr missingLibs
)
where
allHeaders = collectField (fmap getSymbolicPath . includes)
allHeaders = []
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This area of the code checked that a dummy C program that includes any headers listed under includes can be compiled successfully.

allLibs =
collectField $
if withFullyStaticExe lbi
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Simple/GHC/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ componentGhcOptions verbosity lbi bi clbi odir =
, ghcOptCppIncludes =
toNubListR $
[coerceSymbolicPath (autogenComponentModulesDir lbi clbi </> makeRelativePathEx cppHeaderName)]
, ghcOptFfiIncludes = toNubListR $ map getSymbolicPath $ includes bi
, ghcOptObjDir = toFlag $ coerceSymbolicPath odir
, ghcOptHiDir = toFlag $ coerceSymbolicPath odir
, ghcOptHieDir = bool NoFlag (toFlag $ coerceSymbolicPath odir </> (extraCompilationArtifacts </> makeRelativePathEx "hie")) $ flagHie implInfo
Expand Down
2 changes: 0 additions & 2 deletions Cabal/src/Distribution/Simple/Program/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,6 @@ data GhcOptions = GhcOptions
-- ^ Search path for CPP includes like header files; the @ghc -I@ flag.
, ghcOptCppIncludes :: NubListR (SymbolicPath Pkg File)
-- ^ Extra header files to include at CPP stage; the @ghc -optP-include@ flag.
, ghcOptFfiIncludes :: NubListR FilePath
-- ^ Extra header files to include for old-style FFI; the @ghc -#include@ flag.
, ghcOptCcProgram :: Flag FilePath
-- ^ Program to use for the C and C++ compiler; the @ghc -pgmc@ flag.
, ----------------------------
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Simple/Register.hs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
, IPI.extraLibrariesStatic = extraLibsStatic bi
, IPI.extraGHCiLibraries = extraGHCiLibs bi
, IPI.includeDirs = absinc ++ adjustRelIncDirs relinc
, IPI.includes = map getSymbolicPath $ includes bi
, IPI.depends = depends
, IPI.abiDepends = [] -- due to #5465
, IPI.ccOptions = [] -- Note. NOT ccOptions bi!
Expand Down
Loading