Only source-repository-package
is actually adding a "local package" to your project. It behaves pretty much as listing a package's source folder in packages:
, except that the source code is downloaded as needed. In particular, it will be re-downloaded when running cabal build
after a cabal clean
.
Because it's a local package in your project, other cabal projects are unaware of it. Adding it to other local projects requires recompiling it again.
Meanwhile, local no-index package repositories are repositories in the sense of Hackage or Stackage, only in the local filesystem. They can be specified in both the cabal.project
file of an individual project or in the global cabal configuration (~/.cabal/config
).
Packages found in these repositories are not considered "local packages" of a project. Their libraries are compiled once and shared between all the projects which are aware of the package repository (which will be all projects, if the repository is listed in ~/.cabal/config
). And cabal build
after cabal clean
will not trigger a recompilation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…