Get the hash of a script's absolute path.
Two hashes will be the same as long as the absolute paths are the same.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulecabal-install-3.12.1.0Haskell2010
Utilities to help commands with scripts
Get the hash of a script's absolute path.
Two hashes will be the same as long as the absolute paths are the same.
Get the directory for caching a script build.
The only identity of a script is it's absolute path, so append the
hashed path to the script-builds dir to get the cache directory.
Get the directory for caching a script build and ensure it exists.
The only identity of a script is it's absolute path, so append the
hashed path to the script-builds dir to get the cache directory.
withContextAndSelectors :: AcceptNoTargetsWhat your command should do when no targets are found.
-> Maybe ComponentKindA target filter
-> NixStyleFlags aCommand line flags
-> [String]Target strings or a script and args.
-> GlobalFlagsGlobal flags.
-> CurrentCommandCurrent Command (usually for error reporting).
-> (TargetContext -> ProjectBaseContext -> [TargetSelector] -> IO b)The body of your command action.
-> IO bDetermine whether the targets represent regular targets or a script and return the proper context and target selectors. Die with an error message if selectors are valid as neither regular targets or as a script.
In the case that the context refers to a temporary directory, delete it after the action finishes.
What your command should do when no targets are found.
RejectNoTargetsAcceptNoTargetsreturn a default TargetSelector
Eq AcceptNoTargetsDefined in cabal-install-3.12.1.0 · Distribution.Client.ScriptUtilsShow AcceptNoTargetsDefined in cabal-install-3.12.1.0 · Distribution.Client.ScriptUtilsInformation about the context in which we found the TargetSelectors.
ProjectContextThe target selectors are part of a project.
GlobalContextThe target selectors are from the global context.
ScriptContext FilePath ExecutableThe target selectors refer to a script. Contains the path to the script and the executable metadata parsed from the script
Eq TargetContextDefined in cabal-install-3.12.1.0 · Distribution.Client.ScriptUtilsShow TargetContextDefined in cabal-install-3.12.1.0 · Distribution.Client.ScriptUtilsAdd add the executable metadata to the context and write a .cabal file.
Add the SourcePackage to the context and use it to write a .cabal file.
The base for making a SourcePackage for a fake project. It needs a Library or Executable depending on the command.
lSrcpkgDescription :: Functor f => LensLike f (SourcePackage loc) (SourcePackage loc) GenericPackageDescription GenericPackageDescriptionA lens for the srcpkgDescription field of SourcePackage
Find the path of an exe that has been relocated with a "-o" option