cptpiepmatz / nu-jupyter-kernel

📓 A wip jupyter raw kernel for nu
MIT License
21 stars 2 forks source link

Plugin failed to decode: Missing description #2

Open kubouch opened 3 weeks ago

kubouch commented 3 weeks ago

On the latest main of Nushell (0.97.2, commit 712fec166d7fed06022c654b756c7c130215d5f0), attempting to plugin add ~/.cargo/bin/nu_plugin_plotters gives the following error message:

Error: nu::shell::plugin_failed_to_decode

  × Plugin failed to decode: missing field `description`

I cloned this repo (commit 10195b35770e903b18b38a60c47d81220df7306c) and ran cd crates/nu_plugin_plotters + cargo install --path . to install the plugin.

kubouch commented 3 weeks ago

Now it succeeded, but all other plugins report the following message:

Error: nu::shell::plugin_registry_data_invalid

  × The registered plugin data for `gstat` is invalid
  help: plugin add '/home/zadnik/.cargo/bin/nu_plugin_gstat'

So I'm not sure what's going on actually...

After deleting $nu.plugin-path and plugin adding all my plugins except nu_plugin_plotters, the plugins work fine, but plugin add ~/.cargo/bin/nu_plugin_plotters yields again the error in the OP.

cptpiepmatz commented 3 weeks ago

Ok, I found the issue, https://github.com/nushell/nushell/pull/13598 changed the Command and SimplePluginCommand traits to use description instead of usage, this causes the plugin to break as it builds against 0.97.1.

To isolate this I created a little Dockerfile that shows that issue:

FROM rust:1.80
RUN cargo install --git https://github.com/nushell/nushell.git --tag 0.97.1 nu
# RUN cargo install --git https://github.com/nushell/nushell.git --rev 712fec166d7fed06022c654b756c7c130215d5f0 nu
RUN cargo install --git https://github.com/cptpiepmatz/nu-jupyter-kernel.git nu_plugin_plotters
RUN mkdir -p /root/.config/nushell/
RUN nu -c "plugin add /usr/local/cargo/bin/nu_plugin_plotters"
ENTRYPOINT ["nu"]

Building with 0.97.1 works just fine, but the commit you mentioned, which includes https://github.com/nushell/nushell/pull/13598, won't build.

I try to build this repo against a tagged version, so this issue will stay open until a new version of nu gets released or I need a feature from the nushell repo.

fdncred commented 3 weeks ago

I didn't have issues with 0.97.2 but I had to change all the "usage" and "extra_usage" instance to "description" and "extra_description", and of course point the cargo.toml to my nushell local repo. After that, everything worked fine yesterday.