www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - mysql-native and _D5mysql12__ModuleInfoZ

reply Guillaume <guillaume spam.spam> writes:
Hi,

I have a vibed project that uses mysql-native version 3.0.1. It 
compiles fine with dmd 2.094.2 but not with any version after 
that, even with the latest beta. At link I get the following 
error:

undefined reference to `_D5mysql12__ModuleInfoZ'

It looks to be related to this 
https://github.com/dlang/dub/pull/2039 and to this 
https://github.com/mysql-d/mysql-native/issues/224

Are there any ways to fix this or if I'm stuck with 2.094.2 until 
there's a fix somewhere?

Thanks,

Guillaume
May 21 2021
next sibling parent surlymoor <surlymoor cock.li> writes:
On Friday, 21 May 2021 at 15:47:47 UTC, Guillaume wrote:
 Hi,

 I have a vibed project that uses mysql-native version 3.0.1. It 
 compiles fine with dmd 2.094.2 but not with any version after 
 that, even with the latest beta. At link I get the following 
 error:

 undefined reference to `_D5mysql12__ModuleInfoZ'

 It looks to be related to this 
 https://github.com/dlang/dub/pull/2039 and to this 
 https://github.com/mysql-d/mysql-native/issues/224

 Are there any ways to fix this or if I'm stuck with 2.094.2 
 until there's a fix somewhere?

 Thanks,

 Guillaume
If you downgrade to [DUB 1.23.0](https://github.com/dlang/dub/releases/tag/v1.23.0), you should be able to build mysql-native.
May 21 2021
prev sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 5/21/21 11:47 AM, Guillaume wrote:
 Hi,
 
 I have a vibed project that uses mysql-native version 3.0.1. It compiles 
 fine with dmd 2.094.2 but not with any version after that, even with the 
 latest beta. At link I get the following error:
 
 undefined reference to `_D5mysql12__ModuleInfoZ'
 
 It looks to be related to this https://github.com/dlang/dub/pull/2039 
 and to this https://github.com/mysql-d/mysql-native/issues/224
 
 Are there any ways to fix this or if I'm stuck with 2.094.2 until 
 there's a fix somewhere?
Yes, that's exactly the problem. My hope was that the DUB PR would be reverted, but it hasn't. However, as others have pointed out, you can downgrade dub to that version and it will work. Note that you still have to re-download mysql-native from the registry after downgrading because the modified dub.json file is cached the first time it's downloaded by the new dub. This change to DUB has really been a terrible idea. It is not only significantly changing the semantics of existing recipes, but it rewrites the recipe file on the fly for caching! Code that depends on the feature will not work with prior versions of dub, and some projects (such as mysql-native) will not work with newer versions of dub. IMO, this should be reverted, and the feature enabled with a new directive, instead of changing the behavior of an existing directive. To that end: https://github.com/dlang/dub/pull/2134 I can potentially modify mysql-native to not use this directive, but this means mysql-native prior to this version is NOT USABLE with newer versions of the compiler. And to require an upgrade (possibly a major upgrade) just to use a new compiler because the build tool changed is unacceptable. Another example of a needless breaking change in D... -Steve
May 21 2021