-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monorepo as Location
logic breaks reformatting of spago.dhall
#594
Comments
Update: it’s not the record projection, this example works:
|
This, however, fails again:
Maybe it’s a dhall library bug? |
Update: It works with the following workaround:
I assume this works because we have a |
@Profpatsch yeah sorry for that, the way we treat the config file is fairly magick for a series of historical reasons. I hope to solve all of this by switching the place where |
I just ran into this and found it to be very confusing. |
I think this is also the cause of my problem here: #607 (comment) |
This will likely be fixed properly once the new Registry is deployed, so most of my focus is going to be on moving that forward rather than trying to find a solution to this that works in the meanwhile. I am open for proposals/PRs here, but I have the feeling that fixing this will require a breaking change anyways |
When @Gabriel439 helped me to debug #607 (comment) I believe he had a concrete suggestion on an alternative way to do this but I can't recall what it was now. |
There is a spago bug that prevents a spago.dhall that has local dependents from being parsed correctly if it has additional attributes. See purescript/spago#594.
There is a spago bug that prevents a spago.dhall that has local dependents from being parsed correctly if it has additional attributes. See purescript/spago#594.
The new Spago does not use Dhall anymore, closing |
We are using spago 0.14.0 from easy-purescript-nix: https://github.com/justinwoo/easy-purescript-nix/blob/14e7d85431e9f9838d7107d18cb79c7fa534f54e/spago.nix
When you have a monorepo as described in https://github.com/purescript/spago/blob/0.14.0/README.md#monorepo, you use something like
in
packages.dhall
to break the import recursion that would otherwise exist, because thesubpackage/spago.dhall
references../packages.dhall
again.In our case, we (royal we 😛) cannot reference
packages.dhall
directly from the subpackage, because we need information like the package name and dependency list for our nix build.So the idea is to split the “data” into a different file
package.dhall:
{ name = "subpackage", dependencies = … }
and have
spago.dhall
which looks like it should work, it’s valid dhall after all. But suddenly, we got this confusing error message:
Where does this
List Text
type annotation come from‽Turns out the code is doing some magic, ostensibly to avoid reparsing
../packages.dhall
(?):https://github.com/Profpatsch/spago/blob/7a99343e4876a465600eaa64b0697a9f0b2a49a9/src/Spago/Config.hs#L95-L104
where
expr
is created by just parsing the file, and then filtered to extract thedependencies
field viahttps://github.com/Profpatsch/spago/blob/7a99343e4876a465600eaa64b0697a9f0b2a49a9/src/Spago/Config.hs#L378-L387
The
dependencies
field expression is then typed withList Text
and imported as a value.This means that Spago currently implicitly assumes the expression structure of the
spago.dhall
file, and if you differ (by for example using dhall’s import capabilities), you will get strange error messages like the one above.On further experimenting, a
spago.dhall
likeseems to parse fine, so at least some normalizing is done somewhere.
The text was updated successfully, but these errors were encountered: