Cabal-3.12.0.0
Cabal and Cabal-syntax 3.12.0.0 changelog and release notes
Significant changes
Add support for asm, cmm, and js sources in executable components #8639 #9061
Executable components now support the inclusion of asm, cmm, and js source files in a cabal file using the same syntax as is used for these sources in library components, similar to how c and c++ sources are supported in both types of components. This syntax was already parsed in cabal files, but was silently ignored in the build step, so no changes to syntax are made.
Add
--haddock-output-dirflag tocabal haddock. #8720 #8788This flag gives the user full control over the directory where the documentation is placed. It allows both relative and absolute paths.
Add
--semaphoreoption to./Setup buildinterface #8557When
./Setup build --semaphore <SEM>is called,ghcwill be called with the-jsemoption. It is the responsibility of the caller of./Setup buildto manage the semaphore according to the GHC Jobserver Protocol.This low level interface is intended to be called by a high-level tool such as
cabal-installwhich can create and manage the semaphore appropriately.The protocol is specified by GHC Proposal #540.
Add
--promised-dependencyflag to./Setup configureinterface #8726There is a new flag
--promised-dependencyto allow users to configure a package without having previously built the dependency. Instead, we promise to the configure phase that we will have built it by the time we build the package. This allows us to configure all the packages we intend to load into the repl without building any dependenices which we will load in the same session, because the promise is satisifed due to loading the package and its dependency into one multi-session which ensures the dependency is built before it is needed.A user of ./Setup configure specifies a promised dependency by using the "--promised-dependency" flag with a normal dependency specification. For example:
'--promised-dependency=cabal-install-solver=cabal-install-solver-3.9.0.0-inplace'Add
--ignoretocabal check#8587 #9442Distribution.PackageDescription.Check.Warningnow exportsfilterPackageChecksById, this can be used by third-party tools to filter warnings.
Add support for
GHC2024#9736 #9791Support for the
GHC2024language edition, introduced by GHC 9.10, has been added. It can now be used in thedefault-languageandother-languagesfields, and will be offered as an option bycabal init.Remove
initialBuildStepsfromDistribution.Simple.Build#9474Calling
initialBuildStepsto prepare source files for a package is error prone, asinitialBuildStepsonly handles things like the paths module and nothing else.To mimick
initialBuildStepsbehaviour when there is no custom Setup, you can callrepl_setupHooks.If you are dealing with a custom setup, you have to invoke
./Setup repl --repl-multi-file.Cabal and Cabal-syntax 3.12 support GHC version 8.4.4 and up.
Support for all previous GHC versions is deprecated.
Label error messages with codes (following GHC, Stack)
As with GHC and Stack, Cabal and cabal-install now generate warnings and errors prefixed with error codes of the form
[Cabal-xxxxx]. These will be documented on https://errors.haskell.org, although very few are as yet.
Other changes
Installing a library with a Custom setup no longer requires building the executable #9777 #9650 #10311
For example, if we have
pkg-a.cabal:library build-depends: pkg-band
pkg-b.cabal:library exposed-modules: ... executable pkg-b-exe main-is: ...An invocation
cabal build pkg-awill buildlib:pkg-aandlib:pkg-b, but notexe:pkg-b-exebecause it is not needed for buildingpkg-a! Previously the executable would be built unnecessarily.If the invocation were
cabal build pkg-a exe:pkg-b-exethen alllib:pkg-a,lib:pkg-b, andexe:pkg-b-exewould be built.Note: There may be a package whose Custom setup expects the executable to be built together with the library always. Unfortunately, this is a breaking change for them. To migrate, packages should no longer assume the executable is built when only the library is requested (e.g.
cabal install --lib Agdawill not build theAgdaexecutable, whilecabal install Agdawill).Agda is an example of a package which expected in its
Setup.hscopy hook the executable to already be built. This was fixed by inspecting the copy arguments and making sure we only use the executable when it is built, since it is only needed when the executable too is needed.cabal initshould not suggest Cabal < 2.0 #8680 #8700'cabal init' no longer suggests users to set cabal-version to less than 2.0.
Remove
Distribution.Utils.TempTestDirmodule from Cabal library #9453 #9454This library was only used by internal tests, and now lives in the
Cabal-testslibrary which is shared across test components.PkgConfig individual calls #9134
cabalinvokespkg-configindividually for each lib if querying for all doesn't return the expected result.Split up
Distribution.Simple.Setup#8130The external interface of 'Distribution.Simple.Setup' has been kept the same, but internally it has been broken up into smaller modules. This improves build times in two ways:
- GHC is superlinear in the size of files, meaning that splitting up a large file can reduce overall compile times.
- Breaking up the module allows dependent modules to refine their imports to just the parts they require, allowing them to start buildling quicker when GHC is run in parrallel make mode ('--ghc-options -j').
Reimplementing
cabal check#7423 #8427checkPackagesignature has been simplified, you do not need to pass a specific configuration of the package, since we do not flattenGenericPackageDescriptionany more.checkPackageFileNameshas been removed, usecheckPackageFilesinstead.checkPackageFilesGPDhas been introduced, a function similar tocheckPackageFilesthat works onGenericPackageDescription. You do not need to useflattenPackageDescriptionanymore.
Installation of extra-compilation-artifacts directory #8662
GHC plugins now can store custom data in the 'extra-compilation-artifacts' directory which gets installed with the package.
Add option to
./Setup replto write repl arguments to file #8726The
./Setup replcommand is modified to allow a user to defer starting the repl and instead instruct the command to write the necessary build flags to a directiory. The option is called--repl-multi-file <DIR>.This is useful when starting multi-component sessions, as we want to query Setup.hs for the arguments which are needed to build each component but not for ./Setup to start the repl itself.
Add Haiku as a known platform #9006
Cabal: Distribution now recognises Haiku as a valid platform, and also implements Haiku's unique directory layout.
Installation of
.hiefiles #8685 #9019Hie files generated by GHC are now stored in the
extra-compilation-artifactsdirectory which gets installed with the package.Include the GHC "Project Unit Id" in the cabal store path #8114 #9326
This allows the use of several API incompatible builds of the same version of GHC without corrupting the cabal store.
This relies on the "Project Unit Id" which is available since GHC 9.8.1, older versions of GHC do not benefit from this change.
Fix the platform string for GNU/Hurd #9434
Depending whom you ask, GNU/Hurd will be labelled "gnu" or "hurd". The autotools use "gnu", so ghc follows this for installed files, even if the ghc source code uses OSHurd. We thus need to add the translation between the two.
Use linker capability detection to improve linker use #9443
Previously the GHC version number and platform were used as a proxy for whether the linker can generate relocatable objects.
Now, the ability of the linker to create relocatable objects is detected.
Merge globbing implementations #5349 #9673
The common aspects of the globbing functionality between
Cabalandcabal-installhave been factored out. The only change in the user-facing API is that we now record when a glob does not match exactly, but matches a directory with that same name, with the new constructorGlobMatchesDirectoryofGlobResult.To illustrate, this change means that when
foo/diris a directory, the glob*/dir/matches exactlyfoo/dir(as before), but now*/dirproducesGlobMatchesDirectoryinstead of failing. This allows callers to decide whether to allow or discard such inexact matches.Deduplicate
LD_LIBRARY_PATHwhen running tests #8728Add support for a number of architectures:
Don't report
index.htmlfile as created, if not created by Haddock #5120 #9332Enable using
$ORIGINinRPATHon GNU/Hurd #9441Make check comply with Hackage requirements #8897
cabal checkwill only return exitcode 1 when the package is not fit for Hackage. E.g. it will not error anymore when yoursynopsis:is larger thandescription:, just emit a warning.- Cabal:
Distribution.Client.Checknow exportsisHackageDistError, for third-party tools to know if a specific error will preclude a package from being uploaded to Hacakge.
Add language extension
ExtendedLiterals(GHC proposal #451) #8992Warn about inconsistent indentation #8975
- Make Cabal warn about inconsistent indentation in .cabal files. For example warn about somewhat common decreasing indentation like in
library default-language: Haskell2010 build-depends: base ghc-options: -WallThe change is
readFieldsfunction.This is an effect of using
indentOfAtLeastmethod/approach: any indentation greater than current offset is accepted.That behavior is desirable to parsing multiline field contents, but it is a bit surprising for fields in sections, which we expect to be aligned.
Such insonsistency seems to be always a mistake, and it's easy to fix once a machine points it out.
Add
LexBraceslexer warning #8577LexBraceswarning is issued when brace delimiting syntax is used. This way, usingreadFields', a low-lever consumer may decide whether braces were used.Looking for a brace character in the input is imprecise, as braces can occur inside field content.
This warning is not propagated to parser warnings, so e.g.
readGenericPackageDescriptiondoesn't warn about it. This is because all parser warnings prevent uploads to Hackage, and using braces (or not) is a matter of opinion.Distinguish
powerpc64le, by addingPPC64LEconstructor to typeArch#9534 #9535Adds constructor
PPC64LEto typeArchto distinguish architecture powerpc64le from powerpc64. Existing constructorPPC64now exclusively represents powerpc64.PkgConfig individual calls #9134
cabalinvokespkg-configindividually for each lib if querying for all doesn't return the expected resultAdd language extension
ListTuplePuns(GHC proposal #475) #8854Add
mkVersionIntervalsfor creating aVersionIntervalsfrom a list #9034If external tools want to change the version intervals of dependencies, they need to be able to create a
VersionRangefrom a[VersionInterval]list. Adding the functionmkVersionIntervalsmakes this possible again.Update SPDX License List to version
3.23 2024-02-08#9818- LicenseId and LicenseExceptionId now conform to SPDX License List version 3.23 2024-02-08.
