#Fails to compile basic plugin
1 messages · Page 1 of 1 (latest)
$ rustc --version
rustc 1.90.0 (1159e78c4 2025-09-14)
Im on void linux, so that might be the reason too heh 😅
the code is just broken
what do i do then?
Yeah, the docs are outdated, try cloning the example project: https://github.com/PumpkinPlugins/Hello-Pumpkin
An Example Plugin for the Pumpkin Server Software. Contribute to PumpkinPlugins/Hello-Pumpkin development by creating an account on GitHub.
I haven't really had time to update the docs yet
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
rsa got recently updated in the pumpkin dependencies, did it not? The example plugin is probably out of date: https://github.com/Pumpkin-MC/Pumpkin/commit/bbf685622bd44587cc3b4f0772383b1722b8273f
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?
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
that's poop
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
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
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?
Explicitly setting the rsa version didnt fix it for me
Yeah, rsa doesn't seem to be the issue anymore, it's some other dependency, not sure which one tho
Ah okay, thanks!
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
hmmm, could you post your on_load method?
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" }
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
Ahh I see. Perfect.
If you don’t have the time do you mind if I create a pull request for the docs?
Wouldn't mind in the slightest
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.
Man it‘s always that dumbass RSA dependency that fucks it up
should be fixed again