I've narrowed it down somewhat. With Go 1.17.13 it works. With Go1.18 RC it 
fails. So something in the first release of Go 1.18 seems to have changed 
how trimpath / plugin version matching works, and has broken previously 
working functionality for us (I'm compiling exactly the same code - the 
*only* difference is the compiler version).

On Tuesday 26 March 2024 at 16:36:31 UTC William Ivory wrote:

> Hi,
>
> Wondering if anyone can help me with a golang plugin problem. Apologies 
> for not being able to provide a simple reproduction - the problem is all 
> bound up in the Debian (dh-golang) build system.
>
> Anyway, our product is based on Debian. We have code using plugins that 
> has been working fine with golang 1.11 (Debian10) and golang 1.15 
> (Debian11). For the plugin user, we use dh-golang in the debian/rules file 
> which adds '-trimpath', and when building the plugin, we explicitly build 
> with '-trimpath -buildmode=plugin'. Now that we have upgraded to Debian12 
> (golang 1.19), every attempt to load a plugin results in the following 
> error:
>
> 'plugin.Open("<plugin-name>"): plugin was built with a different version 
> of package plugin'
>
> If I remove '-trimpath' from one half of the build (plugin user, or 
> plugin), I start getting a (seemingly) random assortment of packages being 
> listed, but with trimpath specified, it is 'package plugin' every single 
> time. This makes me think the problem is different to the usual one where 
> we have managed to get mismatches due to the lack of trimpath in one half 
> of the build previously.
>
> I've tried going back from dh-golang version 1.59 (Debian12) to 1.51 
> (Debian11) but no joy. I'm currently trying to step back through Go 1.18 - 
> Go 1.15 to see when it starts working again, but that's proving tricky.
>
> Has anyone seen anything similar / got any suggestions?
>
> Thanks,
>
> William
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/25021a41-4607-43f0-860a-2a9dac0d417dn%40googlegroups.com.

Reply via email to