Cabal install failure on existing sandbox in Windows - windows

I have installed the Haskell-platform on Windows. I am trying to build an existing project from an existing cabal sandbox. Whenever I attempt to reinstall, all packages fail with the following error:
cabal.exe: expected an absolute directory name for --prefix:
Was wondering where I need to specify an absolute directoy. Cabal is installed here:
Note: I am using Powershell to execute these commands.
C:\Users\user\AppData\Roaming\cabal\bin\cabal.exe
Here's the full output.
websockets-snap-0.8.2.1 (new package)
Project-0.1 (new package)
cabal.exe: The following packages are likely to be broken by the reinstalls:
haskell-platform-2013.2.0.0
cgi-3001.1.7.5
Use --force-reinstalls if you want to install anyway.
PS C:\Users\user\Project> cabal install --force-reinstalls
Resolving dependencies...
Warning: The following packages are likely to be broken by the reinstalls:
haskell-platform-2013.2.0.0
cgi-3001.1.7.5
Continuing even though the plan contains dangerous reinstalls.
Configuring Crypto-4.2.5.1...
cabal.exe: expected an absolute directory name for --prefix:
/Users/user/Project/.cabal-sandbox
Failed to install Crypto-4.2.5.1
Configuring MonadRandom-0.1.13...
cabal.exe: expected an absolute directory name for --prefix:
/Users/user/Project/.cabal-sandbox
Failed to install MonadRandom-0.1.13
Configuring SHA-1.6.1...
cabal.exe: expected an absolute directory name for --prefix:
/Users/user/Project/.cabal-sandbox
Failed to install SHA-1.6.1
How do I specify an absolute directory name for prefix?

You could try using the solution described here. It's basically about removing/replacing powershells default dir alias. But that's for sure not the most powershell-compatible way of fixing it.

Related

How to properly install GO with paths and all?

I have installed GO, setup the paths but when i run a file i get this error:
error!! exec: "sqlboiler": executable file not found in $PATH
exec: "sqlboiler": executable file not found in $PATH
exec: "sqlboiler": executable file not found in $PATH
exit status 3
What is going wrong?
The installation instructions are good, https://go.dev/doc/install. However, for me un Ubuntu 20.4 in wsl2, the suggested path for the binaries wasn't enough. Only go and gofmt are added to /usr/local/go/bin.
I did add the below to my .bashrc, since go install puts the binaries in this location on my system.
export PATH="$HOME/go/bin:$PATH"
Note, that the path to the binaries may differ on your system, so you have to adjust it accordingly.
Any binary you install with go install that is added to this path will be available to your shell afterwards.
For example:
$ go install github.com/volatiletech/sqlboiler/v4#latest
$ go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql#latest
$ whereis sqlboiler
sqlboiler: /home/blue/go/bin/sqlboiler
Potentially, you also need some database packages to your system. I am not sure on this any more. For example, you could add some Postgres libs if you are using Postgres. You have to see if it works without.
apt-get install postgresql-client-common postgresql-client-12
How to properly install GO with paths and all?
Install Go with the installer (Windows) or archive (extract into /usr/local on Linux/Mac).
When installing from archive, manually add the directory path where the go binary is located (/usr/local/go) to PATH.
Set GOPATH to a directory path wherein to contain bin, pkg and src sub-directories.
Add ${GOPATH}/bin to PATH.
What is going wrong?
The program you are running is trying to run the executable sqlboiler, which cannot be found in any of the directories specified in PATH.

How to install wxHaskell?

I have downloaded the latest Haskell Platform(8.0.1 version) for Windows 7, wxWidgets-3.0.2, set all the needed environment variables. I have successfully installed "wxdirect" using "cabal install", but when I try to install "wxc" it fails. Install logs:
C:\wxWidgets-3.0.2\lib\gcc_dll\mswud\..: getDirectoryContents: does not exist
(The system cannot find the path specified.)
cabal: Leaving directory '.'
Where do I need to get that "gcc_dll\mswud\" folder?
P.S Neither Abriline nor Achelanne works for me for some reason.
P.P.S I tried to install this library following Haskell-wiki instructions, but it didn't work complaining about a ton of dependencies.
UPDATE
I tried installing the wxHaskell using Haskell Platform 2014.2.0.0 with Abriline installer. It stopped on building wxc. Logs:
Building wxc
setup.exe: Maybe.fromJust: Nothing
1] Compiling Main ( wxc-0.92.2.0\dist\setup\setup.hs, wxc-0.92.2.0\dist\setup\Main.o )
Linking .\wxc-0.92.2.0\dist\setup\setup.exe ...
The bitness is correct
Configuring wxc-0.92.2.0...
Configuring wxc to build against wxWidgets 3.0.2
cabal: Leaving directory '.\wxc-0.92.2.0'
UPDATE
Extended logs with "cabal install wxc -v3":
http://rgho.st/7BJcHzJTF
From the log it seems that maybe pkg-config is missing. From the platform's built in msys2 run pacman -S pkg-config and install it, see if it works after that.
I've installed it as follows.
Download wxInstall-Achelanne-64-0.1.zip, unzip, and set this folder as the current directory in a terminal
Type
Set WXWIN=%CD%\wxWidgets
Set WXCFG=gcc_dll\mswu
Set PATH=%CD%;%PATH%
cabal unpack wxdirect
cabal install ./wxdirect-xxx
(where xxx is e.g. 0.92.3).
Find the file wxdirect.exe and put it in the current directory.
Rename the file wxWdigets/include/wx/setup_redirect.h to wxWdigets/include/wx/setup.h
Type
cabal unpack wxc
cabal install ./wxc-xxx
Find the file wxc.dll and put it in the DLLs folder.
Put the folders DLLs and wxWidgets\lib\gcc_dll in your search path.
Now you can install wxcore and wx.

gnu/libtool (libltdl) installed but not found by configure script

I am trying to install guile locally on a system. It requires gnu/libtool. While installing all its dependencies, the "make check" command showed errors while installing gnu/libtool. But if I omitted the command and simply ran "make" followed by "make install", then it was able to install successfully. I was able to install the rest of the dependencies without any problem. However, when I run the following command, then I am getting the below mentioned error:
Command:
../configure --with-libltdl-prefix=$PREFIX/libtool --with-libgmp-prefix=$PREFIX/gmp --with-libunistring-prefix=$PREFIX/libunistring --with-libiconv-prefix=$PREFIX/libiconv --with-libreadline-prefix=$PREFIX/libreadline --with-libintl-prefix=$PREFIX/gettext --prefix=$PREFIX/guile
Error:
configure: error: GNU libltdl (Libtool) not found, see README.
the $PREFIX is defined and I have installed the libltdl library in the libtool folder. When I look through the include and lib sub directories of the libtool folder, I can find the libltdl folders and .so files.
So, I am unsure as to why the configure script is not able to find the locally installed version of libtool. I will be highly grateful if someone can point out the problem in the command and how to remedy this error.
I had a similar issue when trying to compile bind9 using distcc under Rasbian. I had previously installed the package libtool but I was also missing the package libtool-bin.
That solved my issue.
Try
apt list libtool* --installed
and see if both show up.

cabal + proxy: downloading packages from hackage

I'm using Haskell Platform 7.10.2-a (64-bit) on Windows:
>cabal -V
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
My proxy requires (basic HTTP) authentication:
>set http_proxy=http://user:passwd#acme.com:port
It seems to work for cabal update:
> cabal update
Downloading the latest package list from hackage.haskell.org
Skipping download: Local and remote files match.
However, when I try to install any package, it fails:
> cabal get ghc-mod
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'ghc-mod'.
>cabal install shelltestrunner
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'shelltestrunner'.
You may need to run 'cabal update' to get the latest list of available
packages.
How can I get get or install to actually use the proxy? Or is there some other problem preventing installation of packages from hackage?
I may have found the cause, when using cabal -v update, it displays path like
\\ACME.NET\UserData\username\RF\AppData\Roaming\cabal\packages\hackage.haskell.org\00-index.tar.gz
while other uses of cabal use path like C:\Users\username\AppData\.., but without the RF folder in the displayed path. Must be my company network server config. Anyway, I updated paths like remote-repo-cache to use another folder in cabal/config and it works better now.

Keep confusing different cabals (cabal, cabal-dev, cabal-install and $HOME:/.cabal/bin/cabal)

I keep confusing
cabal from /usr/local/bin/cabal
cabal-dev
cabal-install
cabal in ~/.cabal/bin/cabal which is used for creating a sandbox.
So far I've been using cabal (from /usr/local/bin/cabal) and ~/.cabal/bin/cabal - the first one for creating a .cabal file by cabal init, the second one for creating a sandbox by cabal sandbox init and installing the dependencies by cabal install --only-dependencies.
So now I want to begin using only one of these tools - whatever is more modern and should be used. I believe this is ~/.cabal/bin/cabal
So I've added ~/.cabal/bin to $PATH and performed cabal sandbox init. It worked fine. But cabal install --only-dependencies said
cabal: No cabal file found. Why is that? According to this tutorial http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html it doesn't have to be like that.
Anyway, what have I done wrong and what should I do?
UPDATE:
$ which cabal
/Users/alex/.cabal/bin/cabal
But I wonder, does cabal sandbox init have to create a .cabal file? The documentation does prove that and the error is:
cabal: No cabal file found.
Please create a package description file <pkgname>.cabal
Did you run cabal init to create a pkgname.cabal file? All of the examples that you liked they always do cabal install --only dependencies in an existing source tree, assuming the existence of a pkgname.cabal file.

Resources