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

Fix ./setup install comand (backport #10417) #10435

Merged
merged 3 commits into from
Oct 8, 2024
Merged
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
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Revision history for DistPrefInstall

## 0.1.0.0 -- YYYY-mm-dd

* First version. Released on an unsuspecting world.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cabal-version: 3.12
name: DistPrefInstall
version: 0.1.0.0
license: NONE
author: Matthew Pickering
maintainer: [email protected]
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
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/Install/DistPrefInstall/Setup.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Test.Cabal.Prelude

main = setupTest $ recordMode DoNotRecord $ withPackageDb $ do
setup "configure" []
setup "build" []
setup "copy" []
setup "install" []
setup "sdist" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module MyLib (someFunc) where

someFunc :: IO ()
someFunc = putStrLn "someFunc"
11 changes: 11 additions & 0 deletions changelog.d/t10416
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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.

}
Loading