digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
Other
803 stars 204 forks source link

Use `ghc-pkg register` instead of `ghc-pkg recache` #13320

Open akrmn opened 2 years ago

akrmn commented 2 years ago

As a consequence of https://github.com/digital-asset/daml/pull/13205, DA.Cli.Damlc.Packaging uses ghc-pkg recache once per dependency and data-dependency in the graph, which could have a performance impact. Instead, we should use ghc-pkg register individually, or perhaps bring down the number of calls to ghc-pkg recache to the bare minimum

akrmn commented 1 year ago

this talk from the GHC Contributors' Workshop 2023 might be relevant https://haskell.foundation/assets/other/Duncan%20Coutts%20-%20GHC%20Tool%20Ecosystem.pdf

[ghc-pkg] supports an idempotent mode

  • add or remove ${pkgid}.conf file directly within package db dir
  • run ghc-pkg recache
  • idempotent mode suits package management tools