1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-25 08:34:10 +03:00
juvix/package.yaml
Paul Cadman 669474f345
Add juvix dev anoma {start, stop, status} to manage an Anoma client (#3183)
This PR adds the `juvix dev anoma {start, stop, status}` commands to
manage a running Anoma client.

The motivation for this is that we can add additional commands (e.g
`indexer`, `prove`, `(mempool)-submit`) which interact with the
persistent Anoma client.

`juvix dev anoma start` now writes a configuration file in
`<juvix_config>/anoma-client/config.yaml` which contains the host URL
and
port of the started Anoma client and the pid of the Anoma client
process.

For example:

config.yaml
```
host:
  port: 58922
  url: localhost
pid: 75299
```

The `anoma stop` command kills the Anoma client and the `anoma status`
command shows the config of the currently running client.

There can be at most one Anoma client running when using this mechanism.

## Dependency

This PR adds a new dependency on the `unix` package. This is used for
APIs to send signals to processes.

## CLI docs

### `juvix dev anoma`

```
Usage: juvix dev anoma COMMAND

  Subcommands related to the Anoma client

Available options:
  -h,--help                Show this help text

Available commands:
  start                    Start an Anoma client
  status                   Show the status of the Anoma client
  stop                     Stop the Anoma client
```

### `juvix dev anoma start`

```
Usage: juvix dev anoma start --anoma-dir ANOMA_DIR [-g|--foreground]
                             [-f|--force]

  Start an Anoma client

Available options:
  --anoma-dir ANOMA_DIR    Path to anoma repository
  -g,--foreground          Start the client in the foreground
  -f,--force               Forcefully start a client, terminating any currently
                           running client if necessary
  -h,--help                Show this help text
```

### `juvix dev anoma status`

```
Usage: juvix dev anoma status

  Show the status of the Anoma client

Available options:
  -h,--help                Show this help text
```

### `juvix dev anoma stop`

```
Usage: juvix dev anoma stop

  Stop the Anoma client

Available options:
  -h,--help                Show this help text
```
2024-11-22 16:03:30 +00:00

243 lines
5.6 KiB
YAML

name: juvix
version: 0.6.8
license: GPL-3.0-only
license-file: LICENSE.md
copyright: (c) 2022- Heliax AG.
maintainer: The Compilers Team at Heliax AG <hello@heliax.dev>
author:
[
Jonathan Prieto-Cubides,
Jan Mas Rovira,
Paul Cadman,
Lukasz Czajka,
Github's contributors,
]
tested-with: ghc == 9.8.2
homepage: https://juvix.org
bug-reports: https://github.com/anoma/juvix/issues
description: The Juvix compiler
category: Compilers/Interpreters
github: anoma/juvix
flags:
# This flag can only be used in an environment that contains static libraries
# for all dependencies, including libc We use this when doing a static build
# using the ghc-musl alpine container
static:
description: Build static executable
default: false
manual: true
extra-source-files:
- README.md
- assets/css/*.css
- assets/js/*.js
- assets/images/*.svg
- juvix-stdlib/**/*.juvix
- include/package/**/*.juvix
- include/package-base/**/*.juvix
- runtime/c/include/**/*.h
- runtime/c/**/*.a
- runtime/rust/juvix/target/**/*.rlib
- runtime/tree/*.jvt
- runtime/vampir/*.pir
- runtime/casm/*.casm
- runtime/nockma/*.nockma
- config/config.json
- config/configure.sh
dependencies:
- aeson == 2.2.*
- aeson-better-errors == 0.9.*
- aeson-pretty == 0.8.*
- ansi-terminal == 1.1.*
- array == 0.5.*
- base == 4.19.*
- base16-bytestring == 1.0.*
- base64-bytestring == 1.2.*
- bitvec == 1.1.*
- blaze-html == 0.9.*
- bytestring == 0.12.*
- cereal == 0.5.*
- containers == 0.6.*
- cryptohash-sha256 == 0.11.*
- deepseq == 1.5.*
- directory == 1.3.*
- dlist == 1.0.*
- ed25519 == 0.0.*
- edit-distance == 0.2.*
- effectful == 2.3.*
- effectful-core == 2.3.*
- effectful-th == 1.0.*
- exceptions == 0.10.*
- extra == 1.7.*
- file-embed == 0.0.*
- filelock == 0.1.*
- filepath == 1.4.*
- flatparse == 0.5.*
- ghc == 9.8.2
- githash == 0.1.*
- hashable == 1.4.*
- language-c == 0.9.*
- libyaml == 0.1.*
- megaparsec == 9.6.*
- commonmark == 0.2.*
- parsec == 3.1.*
- lens == 5.2.*
- parser-combinators == 1.3.*
- path == 0.9.*
- path-io == 1.8.*
- pretty == 1.1.*
- prettyprinter == 1.7.*
- prettyprinter-ansi-terminal == 1.1.*
- primitive == 0.9.*
- process == 1.6.*
- random == 1.2.*
- safe == 0.3.*
- scientific == 0.3.*
- singletons == 3.0.*
- singletons-base == 3.3.*
- singletons-th == 3.3.*
- splitmix == 0.1.*
- stm == 2.5.*
- Stream == 0.4.*
- string-interpolate == 0.3.*
- template-haskell == 2.21.*
- temporary == 1.3.*
- text == 2.1.*
- th-utilities == 0.2.*
- time == 1.12.*
- transformers == 0.6.*
- typed-process == 0.2.*
- unicode-show == 0.1.*
- uniplate == 1.6.*
- unix-compat == 0.7.*
- unix == 2.8.*
- unordered-containers == 0.2.*
- utf8-string == 1.0.*
- vector == 0.13.*
- vector-builder == 0.3.*
- versions == 6.0.*
- xdg-basedir == 0.2.*
- yaml == 0.11.*
# the tasty dependencies are here to avoid having to recompile
# juvix when running the tests.
- tasty
- tasty-hunit
- Diff == 0.5.*
- pretty-show == 1.10.*
- hedgehog == 1.4.*
- tasty-hedgehog == 1.4.*
# benchmarks
- criterion == 1.6.*
- statistics == 0.16.*
- shake == 0.19.*
- colour == 2.3.*
- palette == 0.3.*
ghc-options:
# Warnings
- -Weverything
- -Wno-all-missed-specialisations
- -Wno-missed-specialisations
- -Wno-missing-export-lists
- -Wno-missing-import-lists
- -Wno-missing-kind-signatures
- -Wno-missing-safe-haskell-mode
- -Wno-missing-role-annotations
- -Wno-missing-poly-kind-signatures
- -Wno-safe
- -Wno-unsafe
- -Wno-unused-packages
# HIE Support
- -fhide-source-paths
- -fwrite-ide-info -hiedir=.hie
# Polysemy Support
- -O2 -flate-specialise -fspecialise-aggressively
default-extensions:
- ApplicativeDo
- DataKinds
- DerivingStrategies
- GADTs
- GeneralizedNewtypeDeriving
- ImportQualifiedPost
- LambdaCase
- MultiWayIf
- NoFieldSelectors
- NoImplicitPrelude
- OverloadedStrings
- PatternSynonyms
- QuasiQuotes
- RecordWildCards
- TemplateHaskell
- TypeFamilyDependencies
library:
source-dirs: src
verbatim:
default-language: GHC2021
executables:
juvixbench:
main: Main.hs
source-dirs: bench2
dependencies:
- juvix
- tasty-bench == 0.3.*
- polysemy == 1.9.*
- random
verbatim:
default-language: GHC2021
juvix:
main: Main.hs
source-dirs: app
dependencies:
- juvix
- haskeline == 0.8.*
- http-conduit == 2.3.*
- mtl == 2.3.*
- optparse-applicative == 0.18.*
- repline == 0.4.*
- string-interpolate == 0.3.*
verbatim:
default-language: GHC2021
ghc-options:
- -threaded
# We enable rtsopts because we've found that tweaking the -A flag can lead
# to great performance gains. However, GHC's decumentation warns that
# enabling this may cause security problems: "...can be used to write logging
# data to arbitrary files under the security context of the running
# program..."
- -rtsopts
# We set -N1 to avoid spending time in thread initialization. We manually
# set the number of cores we want to use through the juvix -N global flag.
- -with-rtsopts=-N1
when:
- condition: flag(static)
ld-options:
- -static
- -pthread
tests:
juvix-test:
main: Main.hs
source-dirs: test
dependencies:
- juvix
verbatim:
default-language: GHC2021
ghc-options:
- -threaded
benchmarks:
juvix-bench:
main: Main.hs
source-dirs: bench
dependencies:
- juvix
verbatim:
default-language: GHC2021