-
-
Save ivanperez-keera/e9c7a94530eac21500e1ba60e60312cd to your computer and use it in GitHub Desktop.
~/tmp/du$ cabal install dunai | |
Resolving dependencies... | |
Build profile: -w ghc-8.10.4 -O1 | |
In order, the following will be built (use -v for more details): | |
- base-orphans-0.8.4 (lib) (requires build) | |
- primitive-0.7.1.0 (lib) (requires build) | |
- simple-affine-space-0.1.1 (lib) (requires build) | |
- splitmix-0.1.0.3 (lib) (requires build) | |
- transformers-compat-0.6.6 (lib) (requires build) | |
- random-1.2.0 (lib) (requires build) | |
- transformers-base-0.4.5.2 (lib) (requires build) | |
- MonadRandom-0.5.3 (lib) (requires build) | |
- dunai-0.7.0 (lib) (requires download & build) | |
Downloading dunai-0.7.0 | |
Starting base-orphans-0.8.4 (lib) | |
Starting simple-affine-space-0.1.1 (lib) | |
Starting primitive-0.7.1.0 (lib) | |
Starting splitmix-0.1.0.3 (lib) | |
Downloaded dunai-0.7.0 | |
Building base-orphans-0.8.4 (lib) | |
Building splitmix-0.1.0.3 (lib) | |
Building simple-affine-space-0.1.1 (lib) | |
Building primitive-0.7.1.0 (lib) | |
Installing splitmix-0.1.0.3 (lib) | |
Installing simple-affine-space-0.1.1 (lib) | |
Completed splitmix-0.1.0.3 (lib) | |
Starting transformers-compat-0.6.6 (lib) | |
Completed simple-affine-space-0.1.1 (lib) | |
Starting random-1.2.0 (lib) | |
Building transformers-compat-0.6.6 (lib) | |
Building random-1.2.0 (lib) | |
Installing base-orphans-0.8.4 (lib) | |
Completed base-orphans-0.8.4 (lib) | |
Installing transformers-compat-0.6.6 (lib) | |
Completed transformers-compat-0.6.6 (lib) | |
Starting transformers-base-0.4.5.2 (lib) | |
Building transformers-base-0.4.5.2 (lib) | |
Installing transformers-base-0.4.5.2 (lib) | |
Completed transformers-base-0.4.5.2 (lib) | |
Installing primitive-0.7.1.0 (lib) | |
Completed primitive-0.7.1.0 (lib) | |
Installing random-1.2.0 (lib) | |
Completed random-1.2.0 (lib) | |
Starting MonadRandom-0.5.3 (lib) | |
Building MonadRandom-0.5.3 (lib) | |
Installing MonadRandom-0.5.3 (lib) | |
Completed MonadRandom-0.5.3 (lib) | |
Starting dunai-0.7.0 (lib) | |
Building dunai-0.7.0 (lib) | |
Installing dunai-0.7.0 (lib) | |
Completed dunai-0.7.0 (lib) | |
Warning: installdir is not defined. Set it in your cabal config file or use | |
--installdir=<path>. Using default installdir: "/home/user/.cabal/bin" | |
Warning: | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
@ WARNING: Installation might not be completed as desired! @ | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
Without flags, the command "cabal install" doesn't expose libraries in a | |
usable manner. You might have wanted to run "cabal install --lib dunai". | |
$ cabal repl | |
Resolving dependencies... | |
Build profile: -w ghc-8.10.4 -O1 | |
In order, the following will be built (use -v for more details): | |
- fake-package-0 (lib) (first run) | |
Configuring library for fake-package-0.. | |
Preprocessing library for fake-package-0.. | |
Warning: No exposed modules | |
GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help | |
Loaded GHCi configuration from /tmp/cabal-repl.-24101/setcwd.ghci | |
Prelude> import Data.MonadicStreamFunction | |
<no location info>: error: | |
Could not load module ‘Data.MonadicStreamFunction’ | |
It is a member of the hidden package ‘dunai-0.7.0’. | |
Perhaps you need to add ‘dunai’ to the build-depends in your .cabal file. | |
Prelude> | |
Leaving GHCi. | |
$ cabal install --lib dunai | |
Resolving dependencies... | |
Up to date | |
$ cabal repl | |
Resolving dependencies... | |
Build profile: -w ghc-8.10.4 -O1 | |
In order, the following will be built (use -v for more details): | |
- fake-package-0 (lib) (first run) | |
Configuring library for fake-package-0.. | |
Preprocessing library for fake-package-0.. | |
Warning: No exposed modules | |
GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help | |
Loaded GHCi configuration from /tmp/cabal-repl.-24280/setcwd.ghci | |
Prelude> import Data.MonadicStreamFunction | |
<no location info>: error: | |
Could not load module ‘Data.MonadicStreamFunction’ | |
It is a member of the hidden package ‘dunai-0.7.0’. | |
Perhaps you need to add ‘dunai’ to the build-depends in your .cabal file. | |
Prelude> | |
Leaving GHCi. |
I think paths will be relative to that config file.
I'd be surprised if that were the case. It it were, that could potentially simplify things a lot.
if they don't, we could try to set cabal_dir env var before the command
our guess was right, user-config init
uses $CABAL_DIR
as base dir for config values, so changing it is needed, until it includes a new option --cabal-dir
(as commented here: haskell/cabal#7455 (comment))
so
D:\ws\haskell\issues\try-dunai2>set CABAL_DIR=D:\ws\haskell\issues\try-dunai2
D:\ws\haskell\issues\try-dunai2>cabal user-config init
Writing default configuration to D:\ws\haskell\issues\try-dunai2\config
D:\ws\haskell\issues\try-dunai2>type .\config
.....
remote-repo-cache: D:\ws\haskell\issues\try-dunai2\packages
-- logs-dir: D:\ws\haskell\issues\try-dunai2\logs
world-file: D:\ws\haskell\issues\try-dunai2\world
....
extra-prog-path: D:\ws\haskell\issues\try-dunai2\bin
...
build-summary: D:\ws\haskell\issues\try-dunai2\logs\build.log
....
installdir: D:\ws\haskell\issues\try-dunai2\bin
.....
etc
After that you can do (without having to set CABAL_DIR in future sessions):
D:\ws\haskell\issues\try-dunai2>cabal --config-file=.\config update
Downloading the latest package list from hackage.haskell.org
Updated package list of hackage.haskell.org to the index-state 2021-09-23T05:14:
06Z
D:\ws\haskell\issues\try-dunai2>dir /B
config
log
packages
store
D:\ws\haskell\issues\try-dunai2>cabal --config-file=.\config repl --build-depends=dunai
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
- base-orphans-0.8.5 (lib) (requires download & build)
- primitive-0.7.2.0 (lib) (requires download & build)
- simple-affine-space-0.1.1 (lib) (requires download & build)
- splitmix-0.1.0.3 (lib) (requires download & build)
- transformers-compat-0.7 (lib) (requires download & build)
- random-1.2.1 (lib) (requires download & build)
- transformers-base-0.4.6 (lib) (requires download & build)
- MonadRandom-0.5.3 (lib) (requires download & build)
- dunai-0.8.0 (lib) (requires download & build)
- fake-package-0 (lib) (first run)
- ............
-
will not touch any file in $HOME (i hope)
will not touch any file in $HOME (i hope)
Although i a curious about why do you want to isolate all possible dirs, did v2-build store cause you problems? Install dir can be parametrized and the build configured to use binaries produced by previous steps.
As commented the store is immutable and should build and cache new package hashed versions or reuse existing ones in a safe manner, depending on the build config. It sometimes get corrupted due to some bug, but wiping it out usually fixes it
If you want reproducible builds, pining the hackage index and use a cabal freeze file can help.
I guess so, at that point maybe it worths to create a new whole global config with
cabal user-config init --config-file path/to/file
and use it with --config-fileI think paths will be relative to that config file.