-
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
Import local packages as Location
#301
Conversation
@f-f Thanks for this, I'll try it with our monorepo. Excited that it also properly supports a single |
@f-f Found an interesting bug (I think) with circular imports. Given this setup, which is roughly what we have at Habito:
Where
And each lib has a pretty trivial If I list all my dependencies inline as usual,
I don't think this is to be expected since the |
@elliotdavies wow great catch! I can reproduce the issue locally, and it's not due to circular dependencies per se, but it's because the imports in So the root cause is the kinda-hacky implementation (but I cannot think of many other possible ones, so we'll keep this one) of local packages resolution here: What's happening here is that we:
So if the expression is pure no problem, if it contains relative imports then they are not going to be correct. Two possible solutions here:
|
Right, I recalled there was a nice way to plug this in, so it was an easier fix than I expected. |
@f-f Yep, that's done it! (After a brief moment of panic when Spago just said "aaa" - eventually I realised I'd hit this TODO error case 😂) Glad you were able to find a nice fix. I might have some time Sunday or Monday if you'd like a hand ticking off some of the TODO items for this? |
@elliotdavies thanks, some help would be lovely! There are in fact some independent changes that should be merged in
|
It all looks sensible as far as I can see. 👍 |
as Location
This PR fixes #244, by changing how local packages are specified in the
packages.dhall
(yes this is a breaking change, because the old local syntax will now error out)Taking the README example, we go from this:
to this:
This means a couple of things:
packages.dhall
is in another directory #244 is fixed because Dhall will adjust the relative path properlypackages.dhall
, that will contain e.g. all the packages in your repo (this wasn't possible before as you'd have circular imports in your Dhall file)Things missing:
dhall-lang
release, happening in Version 8.0.0 → 9.0.0 dhall-lang/dhall-lang#635dhall-haskell
release, happening in Version 1.24.0 → 1.25.0 dhall-lang/dhall-haskell#1156list-packages
commandmkPackage
(see Remove mkPackage Dhall function and switch to package-sets releases #322)