Closed JordanMartinez closed 1 year ago
This doesn't sound right - are you able to put together a small repro that I can look at?
Sure.
$ mkdir spagoPackagesBug
$ cd spagoPackagesBug
$ spago init
-- edit the spago.dhall file
-- so that the packages key shows
-- ` packages = ./packages with metadata.version = "v0.13.0"`
$ cat << EOF > spago.dhall
{ name = "my-project"
, dependencies = [ "console", "effect", "prelude", "psci-support" ]
, packages = ./packages.dhall with metadata.version = "v0.13.0"
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
}
EOF
$ spago ls packages | grep 'metadata'
metadata v0.14.3 Remote "https://github.com/spacchetti/purescript-metadata.git"
Thank you! This is a bug - and it happens because we try to be smart about reading files: for the ls packages
command we don't strictly need the spago.dhall
, so in order to work in places where we only have a packages.dhall
(such as for example in the root of a monorepo) we try to read that first. This is the code:
https://github.com/purescript/spago/blob/7728ce42a1c66968cce7a72dbb6ab05ea0904d9f/src/Spago/RunEnv.hs#L194-L203
The new Spago fixes this, closing
While reviewing this PR, https://github.com/purescript/registry/pull/234#discussion_r711108420, I discovered that modifying the
spago.dhall
file'spackages
' key's content isn't reflected in commands likespago ls packages
.I'm not sure whether this is a bug or if it's intentional.