How to compile module with dependencies

Hi! I have a module that has following imports

0x0.Vector
{{address}}.CustomModule

and I already have the CustomModule published but as I try compiling the module with above imports I see the following error

thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: Dependency not provided for 00000000000000000000000000000000.Vector’,

What does this mean ? Also, as I am adding a dependency to a custom module, should both these modules be compiled/published together in the same transaction ?

Are you using the Move IR? It doesn’t have a friendly user experience and you are likely to hit a lot of road bumps like this. If so, I’d suggest switching to the Move source language (in language/move-lang). It is sadly severely under-documented. We will be improving that in the coming months.

Now on your specific error. It is hard to diagnose without seeing the code specifically. And how you are invoking the command line tool. Can you provide that information?

2 Likes

Yes I am using MVIR, I started with it few months back and had been working with it. I am trying to compile the module through CLI client as the following

dev compile <module_path> module

The modules looks somewhat as the following with two different modules. I can compile and publish the first module but I get the error when I try to compile the second.

module Proofs {
    import 0x0.Vector;
    import 0x0.LibraAccount;

    resource T{
        ...
    }

    // Adds Student as enrolled students
    public update_proof_resource() acquires T {
        ...
    }
}

module EarmarkedProofs{
    import {{address}}.Proofs;
    import 0x0.Vector;

    resource T{
        ...
    }

    // Adds Student as enrolled students
    public update() acquires T {
        Proofs.update_proof_resource()
        return;
    }
}

I believe the CLI has been completely switched over to the Move source language. So it is possible perhaps that you are on an old version with bugs?

When did you last pull?

I am at 718ace82 which still supports MVIR through CLI. I will try converting all my code to move. It seems trivial to compile/publish/execute now with move.

1 Like