-
Notifications
You must be signed in to change notification settings - Fork 28
Basic mysql-native dub app does not compile with dmd 2.095.0 #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How are you compiling your app? Are you using dub or dmd directly? That error suggests that there is a missing symbol that would normally be included if you are linking against the mysql-native library. It's possible this is a compiler error, but also could just be related to how you are building. Note that the installation of MySQL has nothing to do with building mysql-native. The library does not use any code/library from it, and does not require any access to a running server to build. |
I'll also note that I don't regularly use Windows. So it might be hard to help, though I can certainly try to build if you post some minimal application to try, and how you build it. |
Thanks for your reply! |
oof! That is not good, I'll try it out. Thanks for the clear instructions! |
I tried it, and it worked for me. But I was on compiler 2.094.0. I updated to 2.095, and get the error you are talking about. So it seems like it's a compiler error that either wasn't in 2.094 or was exposed with differences in the library. Can you try building with 2.094 for now? I'll file an issue against the compiler. |
Here is the archive for 2.094.2, if that doesn't work, I think I was on 2.094.0. |
It happens without vibe-d as a dependency as well. I will try to narrow this down. |
Thanks a lot! Thanks for the link to the older versions too! |
I tried all three versions of the compiler now (2.094.0, 2.094.2, 2.095) and I got the same error, unfortunately. |
Hm... that's odd. I did not get the error before upgrading to 2.095.0. I'm running dustmite right now. But it's slooooow. Hopefully it will show the minimal case to submit as a compiler bug. |
Yes, I'm surprised too. Thanks! |
Hi, are there any developments? |
Sorry, dustmite is still running. Not sure how long it will take, but I'm afraid to try anything else while it's running. |
Thanks! |
Finished, I'll take a look. In the meantime, I'll try to recreate what worked before (with what I thought was 2.094) |
AAARGGH! dustmite reduced everything to having NO source code. I need to revisit what I need to do here. That was a huge waste of time. |
Thanks for the updates. My computer is offline as Toronto is experiencing heavy snow right now, so I’m using my phone.
Sent from Yahoo Mail for iPhone
On Tuesday, January 26, 2021, 10:58 AM, Steven Schveighoffer <[email protected]> wrote:
AAARGGH! dustmite reduced everything to having NO source code. I need to revisit what I need to do here. That was a huge waste of time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It's most definitely an issue with 2.095, and specifically with the new release of dub. If you download a previous version of dub, and DELETE the The short explanation is that dub is internally now excluding the main file from one configuration in any other configuration. The idea behind it is that if you have a file that is supposed to be the "main" file of a configuration, then it probably isn't for the other configurations. However, mysql-native (for some reason) names Replacing dub with a prior version ALONE will not work. You have to re-download the mysql-native library. That is because dub exports a processed copy of the dub recipe file (which contains these exclusionary items). |
If you use 2.094.0 (at least) and remove the dub directory in AppData, it should work. |
@Abscissa I know that it's been a LONG time since you looked at this, but can you recall why mainSourceFile was used in this configuration? You added it here: 36c6e30 dub just broke mysql-native by adopting the (reasonable but hacky) rule that any mainSourceFile directives should be excluded from other configurations. See dlang/dub#2039 Regardless of the fact that dub shouldn't be breaking existing packages, even if the recipe files are hackish themselves, it would be good to have some rationale to understand why one might want to do this. |
Thanks for the detailed instructions, Steven. Toronto is still down, at least mine is, due to the heavy snow.
Sent from Yahoo Mail for iPhone
On Tuesday, January 26, 2021, 4:00 PM, Steven Schveighoffer <[email protected]> wrote:
If you use 2.094.0 (at least) and remove the dub directory in AppData, it should work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@schveiguy: Umm, wait a minute, I think I might have misunderstood...Are you saying that in the latest dub, if one configuration specifies a mainSourceFile, then that entire file is deliberately not even compiled in other configurations, even if those configurations never asked for the file to be excluded??? I hope I'm misunderstanding this because, if not, then that's boneheaded even by dub standards. (Seriously, I swear to god, ever since its creation, dub and its moronic one-size-fits-all notions have always been dlang's greatest enemy.) To hopefully answer your question: Unless I'm forgetting something (like you said, it's been awhile), there wasn't any big special reason for the mainSourceFile in that commit. GitHub makes it difficult to go from that commit and see all the nearby commits, so I can't be 100% certain, but based on what I'm remembering and seeing in that commit alone, I think I just wanted to be sure all relevant files were included in the unittest builds. Granted, dub doesn't base source-file inclusion upon the import tree like rdmd does, but IIRC, mysql-native's phobos-based tests rely on rdmd instead of dub. So it's entirely possible that setting the "root" file for that configuration was only done to be consistent with with the rdmd-based Phobos-thread unittest build. I say, try making whatever changes are needed to make the latest dub happy. IIRC, there should be a simple envar in the travis stuff to make the testsuite use unitthreaded instead of Druntime's default testrunner. Unitthreaded prints out a list of all test being run, so using that, it should be possible to verify that all tests are still being run even with your changes to dub's mainSourceFile. |
@Abscissa you are not misunderstanding. However, the entire point of mainSourceFile is pretty silly to begin with. If I understand the discussion on slack properly, the sole purpose is to say "this is where the main function lives". It's only used (prior to this change) when issuing You probably should not have ever used this directive. In fact, I'd say most people probably should never have used it. I'm a bit curious as to how many projects used that directive. A better name for that should have been "excludeForUnitTesting" or "excludeInOtherConfigs" (in the latest iteration). And if I may rant even a bit more, the way it's implemented is via a rewrite. The problem I have with the dub change is that nobody can upgrade to 2.095 and still use mysql-native tagged 3.0.0 and prior. So changing it now does not fix that problem (I could go back and add releases for all the branches, but I think this change needs to get reverted). |
There's actually a warning in dub if you don't! So probably quite a few people used it. I wonder if this has something to do with why you added it. |
Thanks for your efforts! Meanwhile I was able to port my app using MongoDB. Now I have two database backends that I can switch to at a moment's notice. But I'll still be waiting for any developments on the MySQL end. Thanks! |
Fix: #229 |
You have to wait for a new release. |
I expect a new release soon. For sure by this weekend. |
I see. Thanks!
On Thursday, May 27, 2021, 11:55:17 a.m. EDT, Steven Schveighoffer ***@***.***> wrote:
I expect a new release soon. For sure by this weekend.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
New release out! I triggered it in code.dlang.org, you just have to wait for it to show up. Should fix this issue. |
Thanks!
On Friday, May 28, 2021, 10:18:31 p.m. EDT, Steven Schveighoffer ***@***.***> wrote:
Closed #224.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Finally built and ran my app! Thanks to everyone for all the hard work! |
Yea, that certainly sounds about right. I definitely remember having to bend over backwards to shut up some of dub's misguided warnings, just so I could trick the goddamn thing into not screwing up...yet again. That's classic dub - you're endlessly dodging a constant stream of cover-fire just to get anything done. (I generally like warnings, but not when they push you towards bad ideas...as I very distinctly remember dub frequently trying to do.) Dub, and its idiotic philosophy of "do it all my way (whatever that happens to mean in the latest, greatest version)", for as long as its been around, has always been D's biggest Achilles's heel, and one of the reasons I finally, gladly, gave up on both D and software dev. |
Uh oh!
There was an error while loading. Please reload this page.
I have an app written and running in Ubuntu but does not compile on Windows 10. I need it to run on Windows ten. The db server is MySQL 8.0.23. Here is the error I get:
empapp.obj : error LNK2001: unresolved external symbol _D5mysql12__ModuleInfoZ
.dub\build\application-debug-windows-x86_64-dmd_v2.095.0-dirty-BB4DEF503CB41185FCFD2A9F67C6DA61\empapp.exe : fatal error LNK1120: 1 unresolved externals
Error: linker exited with status 1120
C:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.
Anybody who knows why? On my Windows machine, I uninstalled MySQL 8.0.23 and installed the older MySQL 5.7.32, then I compiled my project again. Same error.
The text was updated successfully, but these errors were encountered: