I am trying to install stack locally (I am on a university account, and can not make a systemwide install). I am following the manual install instructions. I am on a Red Hat system.
Here is the output from stack:
$ ln -s /data/local/ .local
$ ln -s /data/stack/ .stack
$ mv path/to/stack ~/.local/bin/
$ stack install
Writing the configuration file for the implicit global project to:
/data/stack/global-project/stack.yaml. Note: You can change the snapshot via the resolver field
there.
Using the latest snapshot lts-22.6.
Preparing to install GHC (tinfo6-libc6-pre232) to an isolated location. This will not interfere with
any system-level installation.
Preparing to download ghc-tinfo6-libc6-pre232-9.6.3 ...
ghc-tinfo6-libc6-pre232-9.6.3: download has begun
ghc-tinfo6-libc6-pre232-9.6.3: 93.91 MiB / 192.42 MiB ( 48.80%) downloaded...
ghc-tinfo6-libc6-pre232-9.6.3: 192.42 MiB / 192.42 MiB (100.00%) downloaded...
Downloaded ghc-tinfo6-libc6-pre232-9.6.3.
Unpacking GHC into /data/stack/programs/x86_64-linux/ghc-tinfo6-libc6-pre232-9.6.3.temp/ ...
Configuring GHC ...
/data/stack/programs/x86_64-linux/ghc-tinfo6-libc6-pre232-9.6.3.temp/ghc-9.6.3-x86_64-unknown-linux/configure: line 6576: FP_PROG_LD_BUILD_ID: command not found
ar: conftest.a: No such file or directory
Installing GHC ...
Installed GHC.
Error: [S-8506]
Stack failed to parse the target(s).
While parsing, Stack encountered the error:
The specified targets matched no packages. Perhaps you need to run stack init?
Stack expects a target to be a package name (e.g. my-package), a package identifier (e.g.
my-package-0.1.2.3), a package component (e.g. my-package:test:my-test-suite), or, failing
that, a relative path to a directory that is a local package directory or a parent directory
of one or more local package directories.
How can I overcome this? My ultimate goal is to be able to use this installation to have access to a recent GHC and install packages that can be used by any project.
Note that I am using the /data directory because my account has a quota and stack's install is unbelievably huge. I intend to move it to my home directory after I've gotten rid of all of the unnecessary garbage, as /data is a temporary directory. In addition to the above error, will I have to rewrite a bunch of files to refer to ~/.stack and ~/.local instead of /data/stack and /data/local?
I would use ghcup to install Haskell, Stack and Cabal. Are you able to install ghcup? I am not sure if that is a system wide installation or not.