Skip to content

haskell_stack is slow and has unwanted side effects #2890

@andreasabel

Description

@andreasabel

I'd say the haskell_stack gimmick, while nicely displaying the ghc version if I am in a directory with stack.yaml, does a bit too much.

  1. It is slow. When I change to a directory that has a stack.yaml, I am waiting a couple of seconds before my prompt appears.
    The reason is that stack is slow, it does all kind of stuff before it gives the desired answer.
  2. One of these things stack is doing creating a .cabal file from a package.yaml file (using its internal version of hpack).
    This seems a bit too much. I do not want my shell prompt to create new files. I just want it to display information.

So my advice would be to switch this feature off until it gets fixed.

_p9k_haskell_stack_version() {
if ! _p9k_cache_stat_get $0 $1 ${STACK_ROOT:-~/.stack}/{pantry/pantry.sqlite3,stack.sqlite3}; then
local v
v="$(STACK_YAML=$1 stack \
--silent \
--no-install-ghc \
--skip-ghc-check \
--no-terminal \
--color=never \
--lock-file=read-only \
query compiler actual)" || v=
_p9k_cache_stat_set "$v"
fi
_p9k__ret=$_p9k__cache_val[1]
}

Upstream issue:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions