-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New linker error when building diesel with rust-beta on windows #139352
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
Yes, @weiznich noted that in comment and patched a fix in sgrif/mysqlclient-sys@2b3ff91 (cross-linking FIY, assuming this issue is about that) |
Just as a heads up: The linked fix does not completely fix the problem due to mistakes on my side. Additionally it only fixes users that actively update to a newer version. Any older |
I think cc: @smmalis37 @ChrisDenton for #138233 |
We could delay the change to give people more time to update but in general crates cannot depend on implementation details of the standard library if they want stability (as most do). |
I can understand how that is considered to be a unstable implementation detail. What's really hard for me as crate author to find out what is such an implementation detail and what not and how to check if I depend on such a detail. So it would be super helpful to have a clear documentation on what's such a implementation detail and how to check if your crate depends on some internal detail. Ideally as some sort of tool/lint or similar. That must not even check for everything at once, but just something that gives you a release cycle or two of warning period that says: This will break soon because it's not considered public API. The problem for me is that it is quite stressful to find out one day that something is broken for (valid) reasons again. |
The problem here is in C a dependency so I'm not sure a lint would help. It doesn't declare the import libraries it depends on as far as I can tell so even changes to it could add an undeclared dependency and therefore break your build. Interestingly some of its "extra" packages do it properly (i.e. https://github.com./search?q=repo%3Aweiznich%2Fmysql-server%20advapi32&type=code) so maybe they rely on that for their own builds. I don't know. In Rust this specific case can be tested for by building a binary that invokes a linker (so an executable or dll) when the standard library is built with the
A no-std build that uses the C libraries generated in your build script would be more robust but perhaps harder to implement. |
We discussed this in the @rust-lang/libs meeting today and concluded that, because this usually happens deep in dependency trees, delaying this change wouldn't help since most users would only notice this once their build actually fails. The compat notes in #138621 should simply advise users to upgrade their dependencies if they encounter this problem. |
I agree with the assessment that it would not be helpful to delay releasing this change. What I still would like to see is the documentation mentioned above. I believe that's something that should be in place for the release so that the compat notes can easily link there and state: By the way that are the dependencies we guarantee to link and those are currently linked, but not guaranteed to be there in the future. You can test for future incompatibilities like that (command from above). Given that this doesn't exist yet I personally do not consider this to be completed and would like to request this issue to be reopened (cc @Amanieu which closed the issue). |
This issue (handling the new linker error) is resolved. Please open a separate issue for adding additional documentation |
I filled #139619 for the additional documentation |
Code
I tried this code: https://github.com./diesel-rs/diesel/tree/2.2.x (2464571)
I'm using the following command to execute tests:
cargo +beta test --manifest-path diesel_derives/Cargo.toml --no-default-features --features "diesel/mysql mysql"
I expected to see this happen: Code compiles successful and tests complete (Link to the relevant CI run)
Instead, this happened: Code fails to compile with a linking error on windows (other systems work fine):
Link to the relevant CI run
Version it worked on
It most recently worked on: Current stable (1.86.0)
Version with regression
rustc --version --verbose
:@rustbot label: O-windows regression-from-stable-to-beta
The text was updated successfully, but these errors were encountered: