ZenVoich / mops

Package manager for the Motoko programming language
https://mops.one
MIT License
39 stars 5 forks source link

Issue resolving nested dependencies of local imports #197

Closed tomijaga closed 8 months ago

tomijaga commented 8 months ago

Hey @ZenVoich, When I add local dependencies to a library, it doesn't automatically resolve the nested dependencies of the imported library. As a result, I also have to include its dependencies to the library.

Screenshot 2024-01-02 at 11 38 19 PM
ZenVoich commented 8 months ago

Released in 0.39.0

tomijaga commented 8 months ago

Thanks, @ZenVoich, for quickly fixing the bug!

tomijaga commented 8 months ago

Running mops bench with this new fix

import error [M0009]

"../../../../augmented-btrees/MaxBpTree/lib.mo" does not exist'

Command failed with exit code 1:

 /usr/local/bin/moc -c --idl canister.mo --force-gc --incremental-gc 
--package base ../../base@0.10.2/src 
--package augmented-btrees ../../../../augmented-btrees
--package buffer-deque ../../buffer-deque@0.1.0/src 
--package itertools ../../itertools@0.1.2/src 
--package test ../../test@1.2.0/src 
--package fuzz ../../fuzz@0.1.2/src 
--package bench ../../bench@1.0.0/src'

I think the issue here is that the local dependency (augmented-btrees) is not being pointed to the src folder.

Previously, I would just change the package definition in the mops.toml folder, but the new fix prevents me from doing that because I'm guessing it needs to read the local package's mops.toml in the root directory

augmented-btrees = "../augmented-btrees" -> augmented-btrees = "../augmented-btrees/src"

ZenVoich commented 8 months ago

Fixed in 0.39.1