#Fails to compile basic plugin

1 messages · Page 1 of 1 (latest)

void stump
#

Heres the logs, basically it fails compiling rsa v0.10.0-rc.5
Im not sure if its because my packages/rust are outdated or if theres an ongoing problem right now?

my source code is just the plugin base from the Plugin Development Docs

#
$ rustc --version
rustc 1.90.0 (1159e78c4 2025-09-14)
#

Im on void linux, so that might be the reason too heh 😅

late vault
#

the code is just broken

void stump
#

what do i do then?

late vault
#

idk

#

fix the errors?

vast spruce
#

I haven't really had time to update the docs yet

void stump
#

hmm i get the same rsa errors with hello pumpkin, i cargo cleaned aswell
im relatively new to rust so i might be doing something wrong

rustic blaze
#

they should match up, if it's not possible to consolidate the error, because pumpkin requires a newer/older version than the one that works with plugin compilation, consider making a pull request 🙂

#

in any case, @vast spruce why is rsa always a problem for plugin compilation? Can this somehow be mitigated?

vast spruce
#

It's an issue because pumpkin uses a release candidate (rc) version of the crate, and for some reason the rc and stable versions have incompatible types that pumpkin uses. So the plugin has to specify that it needs that specific rc version as well

rustic blaze
#

why doesn't the plugin have the same dependencies, when we almost always have to import core crates?

#

I feel like this could be resolved if we had a plugin crate, where we can have method call abstractions and always provide the working rsa version, so devs can just import that instead (if they choose to do so)

#

nvm I think I'm stupid

vast spruce
#

wait, I no longer define the rsa version in the plugin

#

so it has to be something else

#

probably a duplicate dependency in pumpkin with different versions

pale turret
#

I too am having this same issue. Do I need to explicitly add the rsa RC version used in pumpkin to the plugin’s cargo.toml?

dense flint
#

Explicitly setting the rsa version didnt fix it for me

vast spruce
#

Yeah, rsa doesn't seem to be the issue anymore, it's some other dependency, not sure which one tho

pale turret
#

Ah okay, thanks!

dense flint
#

I think its the signature version? Im not really familiar with Rust so I tried fixing it with copilot.

I tried this:

My toml:
[patch.crates-io]
#Use a vendored copy of rsa 0.10.0-rc.5 which depends on signature 3.0.0-rc.2 to avoid the rc.4 API break.
rsa = { path = "vendor/rsa/rsa-0.10.0-rc.5" }

And in the rsa toml of rsa I replaced the signature version of "3.0.0-rc.2" with "=3.0.0-rc.2".

Now I get this error:

error[E0195]: lifetime parameters or bounds on method on_load do not match the trait declaration
--> src/lib.rs:9:1
|
9 | #[plugin_impl]
| ^^^^^^^^^^^^^^ lifetimes do not match method in trait
|
= note: this error originates in the attribute macro plugin_impl (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try rustc --explain E0195.
error: could not compile here-n-there-pumpkin (lib) due to 1 previous error

Does this help? Not really sure what this means

vast spruce
#

hmmm, could you post your on_load method?

dense flint
#

This is my lib.rs file

use pumpkin::plugin::Context;
use pumpkin_api_macros::{plugin_impl, plugin_method};

#[plugin_method]
async fn on_load(&mut self, server: &Context) -> Result<(), String> {
Ok(())
}

#[plugin_impl]
pub struct MyPlugin {}

impl MyPlugin {
pub fn new() -> Self {
MyPlugin {}
}
}

impl Default for MyPlugin {
fn default() -> Self {
Self::new()
}
}

#

Without the on_load method the build succeeds

#

This is my toml for the sake of completeness

[package]
name = "here-n-there-pumpkin"
version = "0.1.0"
edition = "2024"

[lib]
crate-type = ["cdylib"]

[profile.release]
lto = true

[dependencies]
pumpkin = { git = "https://github.com/Pumpkin-MC/Pumpkin.git", branch = "master", package = "pumpkin" }
pumpkin-util = { git = "https://github.com/Pumpkin-MC/Pumpkin.git", branch = "master", package = "pumpkin-util" }
pumpkin-api-macros = { git = "https://github.com/Pumpkin-MC/Pumpkin.git", branch = "master", package = "pumpkin-api-macros" }

async-trait = "0.1"
tokio = { version = "1.47", features = ["full"] }

[patch.crates-io]
#Use a vendored copy of rsa 0.10.0-rc.5 which depends on signature 3.0.0-rc.2 to avoid the rc.4 API break.
rsa = { path = "vendor/rsa/rsa-0.10.0-rc.5" }

vast spruce
# dense flint This is my lib.rs file use pumpkin::plugin::Context; use pumpkin_api_macros::{p...

Sorry for a slightly late reply, yeah that would be the outdated docs (I should really find the time to fix that), the server field is no longer of type &Context but has switched to Arc<Context>, so it should work if you swap that. You can refer to the example plugin which should work (besides the dependency issues) https://github.com/PumpkinPlugins/Hello-Pumpkin

GitHub

An Example Plugin for the Pumpkin Server Software. Contribute to PumpkinPlugins/Hello-Pumpkin development by creating an account on GitHub.

dense flint
#

Ahh I see. Perfect.

If you don’t have the time do you mind if I create a pull request for the docs?

vast spruce
pale turret
#

I looked back into it again today and noticed that RSA 0.10.0-rc.5 depends on signature 3.0.0-rc.2 ( Pumpkin uses 2.2.0 ). I created a PR with the version bump, but I'm actually gonna compile it and test it first to make sure it doesn't break anything.

rustic blaze
#

Man it‘s always that dumbass RSA dependency that fucks it up

tepid hearth
#

should be fixed again