Skip to content
Snippets Groups Projects
Commit 0cb2c957 authored by Matthew Pickering's avatar Matthew Pickering Committed by Mergify
Browse files

Fix ./setup install comand

Running ./setup install will give you an error:

```
fromFlag NoFlag. Use fromFlagOrDefault
CallStack (from HasCallStack):
  error, called at src/Distribution/Simple/Flag.hs:110:19 in Cabal-3.15.0.0-inplace:Distribution.Simple.Flag
  fromFlag, called at src/Distribution/Simple/Register.hs:161:16 in Cabal-3.15.0.0-inplace:Distribution.Simple.Register
```

This seems to not be tested anywhere and most people will use ./setup
register in any case, but we should fix this for the next point release
in 3.14 series. # Please enter the commit message for your changes.
Lines starting

Fixes #10416

(cherry picked from commit 2a178f24)
parent 3ade64cc
No related branches found
No related tags found
No related merge requests found
......@@ -1094,6 +1094,7 @@ defaultInstallHook_setupHooks inst_hooks pkg_descr localbuildinfo _ flags = do
defaultRegisterFlags
{ regInPlace = installInPlace flags
, regPackageDB = installPackageDB flags
, registerCommonFlags = installCommonFlags flags
}
when (hasLibs pkg_descr) $
register pkg_descr localbuildinfo registerFlags
......
# Revision history for DistPrefInstall
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
cabal-version: 3.12
name: DistPrefInstall
version: 0.1.0.0
license: NONE
author: Matthew Pickering
maintainer: matthewtpickering@gmail.com
build-type: Simple
extra-doc-files: CHANGELOG.md
common warnings
ghc-options: -Wall
library
import: warnings
exposed-modules: MyLib
build-depends: base
hs-source-dirs: src
default-language: Haskell2010
import Distribution.Simple
main = defaultMain
import Test.Cabal.Prelude
main = setupTest $ recordMode DoNotRecord $ withPackageDb $ do
setup "configure" []
setup "build" []
setup "copy" []
setup "install" []
setup "sdist" []
module MyLib (someFunc) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
synopsis: Fix ./setup install command
packages: Cabal
prs: #10417
issues: #10416
significance: significant
description: {
- `./setup install` was failing with a `fromFlag NoFlag` error. It is now fixed.
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment