Open ChrisPenner opened 1 year ago
I'm the maintainer of hpack-dhall and this tool (a lightweight dhall layer on top of hpack) could help here as it makes it very easy to import common items you might want in every (or some) generated .cabal
file like ghc-options
. If the imported item is a list you can append items and if a record then fields can be picked off or merged with another record.
It would be a bit of leg work converting package.yaml
to package.dhall
as there are 26 of them but if you have a set of 2 or 3 that you'd like me to convert as a proof of concept then I'd be willing to do that.
$ tree --prune -P '*.cabal'
.
├── codebase2
│  ├── codebase
│  │  └── unison-codebase.cabal
│  ├── codebase-sqlite
│  │  └── unison-codebase-sqlite.cabal
│  ├── codebase-sqlite-hashing-v2
│  │  └── unison-codebase-sqlite-hashing-v2.cabal
│  ├── codebase-sync
│  │  └── unison-codebase-sync.cabal
│  ├── core
│  │  └── unison-core.cabal
│  ├── util-serialization
│  │  └── unison-util-serialization.cabal
│  └── util-term
│  └── unison-util-term.cabal
├── lib
│  ├── unison-hash
│  │  └── unison-hash.cabal
│  ├── unison-hashing
│  │  └── unison-hashing.cabal
│  ├── unison-hash-orphans-aeson
│  │  └── unison-hash-orphans-aeson.cabal
│  ├── unison-hash-orphans-sqlite
│  │  └── unison-hash-orphans-sqlite.cabal
│  ├── unison-prelude
│  │  └── unison-prelude.cabal
│  ├── unison-pretty-printer
│  │  └── unison-pretty-printer.cabal
│  ├── unison-sqlite
│  │  └── unison-sqlite.cabal
│  ├── unison-util-base32hex
│  │  └── unison-util-base32hex.cabal
│  ├── unison-util-bytes
│  │  └── unison-util-bytes.cabal
│  ├── unison-util-cache
│  │  └── unison-util-cache.cabal
│  ├── unison-util-relation
│  │  └── unison-util-relation.cabal
│  └── unison-util-rope
│  └── unison-util-rope.cabal
├── parser-typechecker
│  └── unison-parser-typechecker.cabal
├── unison-cli
│  └── unison-cli.cabal
├── unison-core
│  └── unison-core1.cabal
├── unison-hashing-v2
│  └── unison-hashing-v2.cabal
├── unison-share-api
│  └── unison-share-api.cabal
├── unison-syntax
│  └── unison-syntax.cabal
└── yaks
└── easytest
└── easytest.cabal
29 directories, 26 files
Looking through all the
package.yaml
s and our optimization flags are all over the place;optimize
flag, half of these default to "on", half off-O0
inghc-options
, but then immediately set-O2
using the optimize flag which defaults to on, making the original-O0
completely redundant since I can't find anywhere that we manually disable the optimize flag other than running withstack build --fast
, where the -O0 is redundant anyways.-O1
$locals
in stack.yaml to provide new settings for a lot of flags anyways, so a lot of local ghc-options will be overridden 🤔 , but we don't provide an override for-O
We should decide how we want to arrange this and make everything consistent, I'm pretty confident we're not building with all the desired flags all the time, and things get more complex when we depend on these packages from Enlil because we can't override flags using
$locals
sinceunison
isn't considered local in this case (I think, documentation for this sort of behaviour is scant at best).Goals:
unison-cli
for contributorsunison
dependencies are optimized when building for releases