Why does stack (and also cabal?) have such a limitation?
Cannot use 'stack ghci' with both file targets and package targets
I got annoyed when I tried to load my package and its example code (not included in the package) at the same session of stack ghci
.
I learned it can be easily avoided by typing :add path/to/example.hs
after launching stack ghci
.
So why doesn't stack do it automatically?
Anyone with experience building static binaries with stack?
I'm getting a pesky
<command line>: User-specified static library could not be loaded (/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/libpgport.a)
Loading static libraries is not supported in this configuration.
Try using a dynamic library instead.
when doing stack build --ghc-options='-fPIC -lpgport -lpgcommon' :aws-sync
with
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
ld-options: -static
extra-lib-dirs:
- ./lib/gmp-6.1.2/.libs
- ./lib/postgres/src/interfaces/libpq
- ./lib/postgres/src/common
- ./lib/postgres/src/port
static-haskell-nix
I ended up getting blocked on nh2/static-haskell-nix#22, because I need libpq
. There is a workaround, but my case is not that pressing, so I'll wait for upstream. nh2/static-haskell-nix#62 if you want to follow the issue which is blocked upstream by https://gitlab.haskell.org/ghc/ghc/issues/17468.
static-haskell-nix
was quite plug-and-play except for upstream issues, @nh2 has been doing tremendous work.
packages
defined anywhere so I wonder why the warning. There is no package.yaml either.
$ stack --stack-yaml=./stack.yaml build --verbose
2.1.3.1 x86_64 hpack-0.33.0
2020-02-15 19:21:33.643425: [debug] Loading project config file stack.yaml
2020-02-15 19:21:33.644059: [error] You cannot have packages and a shell-file filled at the same time in your nix-shell configuration.
packages
in it?
stack.yaml
contain?
I want to staticly link a '.a' (from rust) into the binary but cant seem to get it to work. Are there any resources on this?
i have tried
extra-libraries:
- nameoflib
extra-lib-dirs:
- /locoflib/
but this only works with absolute paths, and i need a relative path as the other project is in the same repo and distributed along with it
extra-deps
in stack.yaml?
Exception while reading snapshot from lts-15.12:
HttpExceptionRequest Request {
host = "raw.githubusercontent.com"
port = 443
secure = True
requestHeaders = [("User-Agent","Haskell pantry package")]
path = "/commercialhaskell/stackage-snapshots/master/lts/15/12.yaml"
queryString = ""
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(InternalException (HostCannotConnect "raw.githubusercontent.com" [Network.Socket.connect: <socket: 14>: does not exist (Connection refused),Network.Socket.connect: <socket: 14>: does not exist (Connection refused)]))
packages:
- github: haskell/haskell-language-server
# 0.4 release
commit: 0a18edde24923251a148cbbc0ae993a6aac83b9c
sha256: e965019bc48ef75e43992b209055e55b245faaaede04c02fb4825f124ebc3dd1
subdirs:
- .
- ./ghcide/
- ./hls-plugin-api
Cannot use both Docker and Nix at the same time
. Wha'ts wrong with using docker from within a nix-shell ?