Skip to content

Commit

Permalink
Record install options
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Nov 6, 2023
1 parent 8591d0c commit 6801926
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic0.env basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
Expand All @@ -8,13 +9,16 @@ Configuring library for basic-0.1...
Preprocessing library for basic-0.1...
Building library for basic-0.1...
Installing library in <PATH>
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic0.env basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Error: [Cabal-7145]
Packages requested to install already exist in environment file at <ROOT>/cabal.dist/basic0.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic
# install options: --force-reinstalls --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic0.env basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic1.env --enable-shared --enable-executable-dynamic --disable-library-vanilla basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
Expand All @@ -25,30 +29,38 @@ Configuring library for basic-0.1...
Preprocessing library for basic-0.1...
Building library for basic-0.1...
Installing library in <PATH>
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic1.env --enable-shared --enable-executable-dynamic --disable-library-vanilla basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Error: [Cabal-7145]
Packages requested to install already exist in environment file at <ROOT>/cabal.dist/basic1.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic
# install options: --force-reinstalls --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic1.env --enable-shared --enable-executable-dynamic --disable-library-vanilla basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic2.env basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic2.env basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Error: [Cabal-7145]
Packages requested to install already exist in environment file at <ROOT>/cabal.dist/basic2.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic
# install options: --force-reinstalls --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic2.env basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic3.env --enable-shared --enable-executable-dynamic --disable-library-vanilla basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
# install options: --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic3.env --enable-shared --enable-executable-dynamic --disable-library-vanilla basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Error: [Cabal-7145]
Packages requested to install already exist in environment file at <ROOT>/cabal.dist/basic3.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic
# install options: --force-reinstalls --disable-deterministic --lib --package-env=<ROOT>/cabal.dist/basic3.env --enable-shared --enable-executable-dynamic --disable-library-vanilla basic
# cabal v2-install
Wrote tarball sdist to <ROOT>/cabal.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz
Resolving dependencies...
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ main = cabalTest $ do
withDirectory ".." $ do
packageEnv <- (</> ("basic" ++ show idx ++ ".env")) . testWorkDir <$> getTestEnv
let installOptions = ["--disable-deterministic", "--lib", "--package-env=" ++ packageEnv] ++ linkConfigFlags linking ++ ["basic"]
cabal "v2-install" installOptions
fails $ cabal "v2-install" installOptions
cabal "v2-install" $ "--force-reinstalls" : installOptions
recordMode RecordMarked $ do
recordHeader $ "install options:" : installOptions
cabal "v2-install" installOptions
recordHeader $ "install options:" : installOptions
fails $ cabal "v2-install" installOptions
recordHeader $ "install options:" : "--force-reinstalls" : installOptions
cabal "v2-install" $ "--force-reinstalls" : installOptions
let exIPID s = takeWhile (/= '\n') . head . filter (\t -> any (`isPrefixOf` t) ["basic-0.1-", "bsc-0.1-"]) $ tails s
hashedIpid <- exIPID <$> liftIO (readFile packageEnv)
return $ ((idx, linking), hashedIpid)
Expand Down

0 comments on commit 6801926

Please sign in to comment.