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.
Merge pull request haskell#5558 from typedrat/fix-sdist-fd-leak
Fix haskell#5541.
- Loading branch information
Showing
7 changed files
with
50 additions
and
1 deletion.
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,4 @@ | ||
module Main (main) where | ||
|
||
main :: IO () | ||
main = putStrLn "Hello, World!" |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/NewSdist/ManyDataFiles/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: . |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/NewSdist/ManyDataFiles/many-data-files.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,9 @@ | ||
cabal-version: 2.2 | ||
name: many-data-files | ||
version: 0 | ||
|
||
data-files: data/*.txt | ||
|
||
executable dummy | ||
default-language: Haskell2010 | ||
main-is: Main.hs |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/NewSdist/ManyDataFiles/many-data-files.out
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 @@ | ||
# cabal new-sdist | ||
Wrote tarball sdist to <ROOT>/many-data-files.dist/source/dist-newstyle/sdist/many-data-files-0.tar.gz |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/NewSdist/ManyDataFiles/many-data-files.test.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,17 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import Control.Applicative ((<$>)) | ||
import System.Directory ( createDirectoryIfMissing ) | ||
import qualified Data.ByteString.Char8 as BS | ||
|
||
main = cabalTest . withSourceCopy $ do | ||
limit <- getOpenFilesLimit | ||
cwd <- testCurrentDir <$> getTestEnv | ||
|
||
case limit of | ||
Just n -> do | ||
liftIO $ createDirectoryIfMissing False (cwd </> "data") | ||
forM_ [1 .. n + 100] $ \i -> | ||
liftIO $ BS.writeFile (cwd </> "data" </> ("data-file-" ++ show i) <.> "txt") (BS.pack "a data file\n") | ||
cabal "new-sdist" ["many-data-files"] | ||
Nothing -> skip |
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