Skip to content

Commit

Permalink
Add configuration files so the project can be built with cabal (#1667)
Browse files Browse the repository at this point in the history
* Add files to embed in the exe to extra-source-files

Cabal requires the files to be specified here because it uses an isolated
build work directory.

* Add cabal configuration files

* Document how to use `cabal` with the project
  • Loading branch information
paulcadman authored Dec 14, 2022
1 parent d091322 commit e8a3cd0
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ juvix compile --target wasm HelloWorld.juvix
wasmer HelloWorld.wasm
#+end_src

** Building the project with `cabal`

We recommend that contributors use the `stack` build tool with this project.

If you would prefer to use the `cabal` build tool instead then you must generate
the `juvix.cabal` file using [[https://github.com/sol/hpack][hpack]] before running `cabal build`.

To configure the Haskell LSP server to use `cabal` then replace `hie.yaml` with
`cabal.hie.yaml` in the root of the repostiory.

** The Juvix programming language

Juvix allows us to write programs with a high degree of assurance. The Juvix
Expand Down
10 changes: 10 additions & 0 deletions cabal.hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cradle:
cabal:
- path: "./src"
component: "lib:juvix"

- path: "./app"
component: "exe:juvix"

- path: "./test"
component: "test:juvix-test"
17 changes: 17 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- Generated by stackage-to-hackage

with-compiler: ghc-9.2.5

packages:
./

jobs: $ncpus

allow-older: *
allow-newer: *

import: https://www.stackage.org/lts-20.2/cabal.config

package juvix
ghc-options: -optP-Wno-nonportable-include-path
test-show-details: direct
7 changes: 6 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license-file: LICENSE
copyright: (c) 2022- Heliax AG.
maintainer: The PLT Team at Heliax AG <[email protected]>
author: [ Jonathan Prieto-Cubides , Jan Mas Rovira , Paul Cadman , Lukasz Czajka , Github's contributors ]
tested-with: ghc == 9.2.4
tested-with: ghc == 9.2.5
homepage: https://juvix.org
bug-reports: https://github.com/anoma/juvix/issues
description: The Juvix compiler
Expand All @@ -15,6 +15,11 @@ github: anoma/juvix
extra-source-files:
- README.org
- assets/*
- juvix-stdlib/**/*.juvix
- runtime/include/**/*.h
- runtime/**/*.a
- c-runtime/**/*.h
- c-runtime/walloc/walloc.c

dependencies:
- aeson == 2.0.*
Expand Down

0 comments on commit e8a3cd0

Please sign in to comment.