Skip to content
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

Locating a package in a subdirectory #758

Closed
martyall opened this issue Mar 24, 2021 · 8 comments
Closed

Locating a package in a subdirectory #758

martyall opened this issue Mar 24, 2021 · 8 comments

Comments

@martyall
Copy link

martyall commented Mar 24, 2021

Is there any way to refer to a subdirectory in a packages.dhall entry? My situation is that I want monorepo two packages A and B that often move together but B depends on A, and depend on both from another repository C.

A and B are both referenced as Local in the monorepo as per the instructions in the README, and that part works fine. However as they are nested in the monorepo, they are nested in .spago directory in project C and it seems like they can't be found. Ironically at some point before I blew everything in C away and rebuilt, i was getting a duplicate module error as I mentioned here

Basically I am looking for something like the subdirs option for a stack.yaml declaration. here

Anyway, let me know if there is some way to do this, or if this shouldn't be allowed because of the design philosophy. Thanks!

@f-f
Copy link
Member

f-f commented Mar 24, 2021

@blinky3713 could you post the layout of your repo and the content of your packages.dhall? I have trouble understanding how things are structured.

@martyall
Copy link
Author

martyall commented Mar 24, 2021

Sure, sorry about that.

This is the monorepo containing two packages, purescript-web3 and purescript-web3-generator:
https://github.com/f-o-a-m/purescript-web3/tree/monorepo

where web3-generator depends on web3.

Here is the relevant packages.dhall for that monorepo:
https://github.com/f-o-a-m/purescript-web3/blob/monorepo/packages.dhall#L178-L180

Here is the packages.dhall file for the project that depends on the monorepo's libraries:
https://github.com/f-o-a-m/chanterelle/blob/monorepo-web3/packages.dhall#L7-L58

Here is what is pulled into .spago/web3/monorepo .spago/web3-generator/monorepo and after running spago build:
Screen Shot 2021-03-24 at 11 49 11 AM

Which is what I meant by the nesting.

@martyall
Copy link
Author

@f-f Just checking in, any thoughts about this?

@f-f
Copy link
Member

f-f commented Apr 2, 2021

@blinky3713 sorry, I'm travelling until next week and I didn't manage to have a look at this yet, will do ASAP

@martyall
Copy link
Author

martyall commented Apr 7, 2021

@wclr I'm not sure I can really describe the problem much better than what's in the comment above starting with

Sure, sorry about that.

And the error message is that the modules from the web3 and web3-generator packages can't be found when trying to build chanterelle.

The most succinct way I can put it for haskell/stack users is what I said above:

Basically I am looking for something like the subdirs option for a stack.yaml declaration. here

@f-f
Copy link
Member

f-f commented Apr 7, 2021

I finally had some time to look at this - indeed subdirectories are not supported right now.
The main reason is that there's an ecosystem-wide assumption about library sources being in src/**/*.purs. This was discussed mainly in #288 (and this question pops up often, e.g. #755).
We're working to lift this limitation in the new Registry, more discussion about that in purescript/registry#16

@martyall
Copy link
Author

Thanks for getting back to me! I will try to catch myself up to speed on those issues to see what remains. As a general note it's been extremely pleasant to update all of our repos to spago, very much appreciating all of your hard work!

@f-f
Copy link
Member

f-f commented Apr 22, 2021

@blinky3713 thank you! ❤️

I think there are no more actionable points in this issue, so I'll close this 🙂

@f-f f-f closed this as completed Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants