thatstoasty/prism

Command::__init__(...) does not reference a KGEN declaration

Closed this issue ยท 2 comments

I'm getting started with Mojo, and I'm getting this error, which seems at first glance like LLVM wizardry:

/Users/aleks/Projects/charm/charm.๐Ÿ”ฅ:10:31: error: @"vendor::prism::command::Command::__init__(prism::command::Command=&,stdlib::builtin::string::String,stdlib::builtin::string::String,stdlib::collections::list::List[stdlib::builtin::string::String],stdlib::collections::list::List[stdlib::builtin::string::String],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> None],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> None],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> None],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> stdlib::builtin::error::Error],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> stdlib::builtin::error::Error],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> stdlib::builtin::error::Error],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> None],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> None],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> stdlib::builtin::error::Error],stdlib::collections::optional::Optional[fn(command: stdlib::memory::_arc::Arc[prism::command::Command], args: stdlib::collections::list::List[stdlib::builtin::string::String]) -> stdlib::builtin::error::Error],fn(stdlib::memory::_arc::Arc[prism::command::Command]) -> stdlib::builtin::string::String)" does not reference a KGEN declaration
    var root_command = Command(
                              ^
mojo: error: failed to run the pass manager

Any ideas?

Here's the code, which is essentially a copy of the example at the moment.

(Yes, I am the same person from the Discord.)

I pulled your repo and rebuilt the package and I ran into the same exact error. I was able to resolve it by moving the prism.mojopkg file out of vendor so it's on the same level as your charm.๐Ÿ”ฅ file.

After updating the import statement, it ran without issue by running mojo run charm.๐Ÿ”ฅ and also after building it into a binary and running that. So, try giving that a go.

mojo build charm.๐Ÿ”ฅ
./charm
./charm init

Maybe this is a bug with .mojopkg files? Doesn't seem like it was working correctly when it was part of another package (vendor).

@aleksrutins Were you able to resolve the issue?