forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't build unnecessary targets of legacy-fallback deps.
The refactor in f70fc98 solved an inconsistency in `buildAndInstallUnpackedPackage`. Namely, before the refactor, we didn't pass `hsSetupBuildArgs` to the build invocations, and afterwards we did. The result is that build targets of (legacy) package `B`, that a package `A` depends on, are now passed to the ./Setup build invocation of package `B` (e.g. `./Setup build lib:openapi3` rather than just `./Setup build`). This means we no longer /build always all targets of a legacy-package/ (for example, the lib, the testsuites and the executables). Instead only the required target (just the lib) will be built. However, despite now passing the build args to `./Setup build`, we weren't passing the same arguments to the `./Setup copy` invocation. Therefore, `./Setup copy` would also try to copy targets of the package that weren't built, resulting in a failure. This fixes that failure by correctly passing the build targets to the `./Setup copy` invocation, just like we do for the `./Setup build` one. Fixes haskell#9640
- Loading branch information
Showing
14 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Revision history for depend-on-custom-with-exe | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Copyright (c) 2024, Rodrigo Mesquita | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
|
||
* Neither the name of Rodrigo Mesquita nor the names of other | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# cabal v2-update | ||
Downloading the latest package list from test-local-repo | ||
# cabal build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- one-custom-0.1.0.0 (lib:one-custom) (requires build) | ||
- depend-on-custom-with-exe-0.1.0.0 (lib) (first run) | ||
Configuring one-custom-0.1.0.0... | ||
Preprocessing library for one-custom-0.1.0.0.. | ||
Building library for one-custom-0.1.0.0.. | ||
Installing library in <PATH> | ||
Warning: depend-on-custom-with-exe.cabal:16:1: Ignoring trailing fields after sections: "ghc-options" | ||
Configuring library for depend-on-custom-with-exe-0.1.0.0... | ||
Preprocessing library for depend-on-custom-with-exe-0.1.0.0... | ||
Building library for depend-on-custom-with-exe-0.1.0.0... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
packages: . | ||
extra-packages: one-custom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ withRepo "repo" $ do | ||
skipUnlessGhcVersion ">= 8.8" | ||
cabal "build" ["depend-on-custom-with-exe"] |
23 changes: 23 additions & 0 deletions
23
cabal-testsuite/PackageTests/Regression/T9640/depend-on-custom-with-exe.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cabal-version: 2.4 | ||
name: depend-on-custom-with-exe | ||
version: 0.1.0.0 | ||
-- synopsis: | ||
-- description: | ||
license: BSD-3-Clause | ||
license-file: LICENSE | ||
author: Rodrigo Mesquita | ||
maintainer: [email protected] | ||
-- copyright: | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
-- extra-source-files: | ||
|
||
common warnings | ||
ghc-options: -Wall | ||
|
||
library | ||
import: warnings | ||
exposed-modules: MyLib | ||
build-depends: base, one-custom | ||
hs-source-dirs: src | ||
default-language: Haskell2010 |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Regression/T9640/repo/one-custom-0.1.0.0/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Revision history for one-custom | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/Regression/T9640/repo/one-custom-0.1.0.0/Main.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = putStrLn "Hello" |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Regression/T9640/repo/one-custom-0.1.0.0/Setup.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/Regression/T9640/repo/one-custom-0.1.0.0/cabal.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages: . |
24 changes: 24 additions & 0 deletions
24
cabal-testsuite/PackageTests/Regression/T9640/repo/one-custom-0.1.0.0/one-custom.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cabal-version: 2.4 | ||
name: one-custom | ||
version: 0.1.0.0 | ||
license: NONE | ||
build-type: Custom | ||
extra-doc-files: CHANGELOG.md | ||
|
||
custom-setup | ||
setup-depends: base, Cabal | ||
|
||
common warnings | ||
ghc-options: -Wall | ||
|
||
library | ||
import: warnings | ||
exposed-modules: MyLib | ||
build-depends: base | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
|
||
executable example | ||
main-is: Main.hs | ||
default-language: Haskell2010 | ||
build-depends: base |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Regression/T9640/repo/one-custom-0.1.0.0/src/MyLib.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module MyLib (someFunc) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module MyLib (someFunc) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |