0

我在开发模式下使用以下方式运行haskell基于 - 的构建:cabalubuntu 20.04

cabal new-run -- exe:live-docs \
  --database-url='postgres://<user>:<password>@<host>:<port>/<dbname>' \
  serve --enable-admin --admin-assets-dir=../admin/static

保持 cabal 会话在后台工作(保持活动状态)以供生产使用的最佳实践是什么?

我徒劳地查看了阴谋集团的文档。

4

1 回答 1

1

如果目标是避免cabal's 输出(如您的评论中所述),您有两个快速选择:

  1. 用来-v0要求它不输出任何东西。如果构建程序失败,它仍然会产生输出。

    cabal run -v0 live-docs -- --db etc
    
  2. 用于cabal构建,并可选择将其复制到中央某处,然后...运行您的程序。这是大多数人所做的。构建和运行:

    cabal build live-docs # this produces output and is done once
    
    # the next three are essentially equivalent options. you do one of them each
    # time you want to start your program
    `cabal list-bin live-docs` --db etc # OR
    cabal exec live-docs -- --db etc # OR
    ./dist-newstyle/<poke around a bit>/live-docs --db etc
    

    要在中心位置构建和复制:

    cabal install exe:live-docs # done once, produces output
    
    live-docs --db etc # each time you want to start your program
    
于 2021-05-15T19:12:13.227 回答