-
Notifications
You must be signed in to change notification settings - Fork 291
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
feat: Update and improve the Windows cross-compilation #2713
feat: Update and improve the Windows cross-compilation #2713
Conversation
50693d4
to
d450019
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change requested in previous review.
893664f
to
8fa52af
Compare
8fa52af
to
84db0f5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2713 +/- ##
==========================================
+ Coverage 73.06% 73.11% +0.05%
==========================================
Files 149 149
Lines 30517 30517
==========================================
+ Hits 22297 22313 +16
+ Misses 8220 8204 -16 ☔ View full report in Codecov by Sentry. |
f0f31a7
to
c396690
Compare
The CI is kind of weird, it only partially tests the changes I have done to the Windows cross-compilation docker in this PR.
Would be nice if Anyway, I'm experiencing an issue locally where wine crashes when creating a 64-bit prefix, so the autotests for the 64-bit build of toxcore do not run. Wanted to see that failure happen on the CI, but alas CI uses a pre-PR image where everything works. This actually fails the entire build, not just autotests, as the wine prefix creation is done within bash's
|
-set_target_properties(toxcore_shared PROPERTIES OUTPUT_NAME toxcore)
+set_target_properties(toxcore_shared PROPERTIES OUTPUT_NAME toxcore WINDOWS_EXPORT_ALL_SYMBOLS ON) @robinlinden that property seems to do nothing on MinGW on Linux. I did a Some post suggests that but then I get this error.
I think I will be sticking with the The cmake build has the strict ABI option tuned on, so only the Tox symbols from the Tox public API headers (tox.h, toxav.h, toxencryptsave.h, tox_private.h, etc.) are listed in |
bdf1b28
to
773bbe2
Compare
The same hardening flags as the slated for the upcoming gcc's `-fhardened` sets, sans `-Wl,-z,relro,-z,now` as MinGW-w64's gcc doesn't support -z flags. This adds a dependency on libssp -- gcc's stack protector library.
We used to make the dll manually as we previously had 3 dlls: libtoxcore.dll, libtoxav.dll and libtoxencryptsave.dll, but for Windows we wanted them to be all combined into libtox.dll with all the dependencies included: libsodium, libopus, libvpx, pthreads, etc, to reduce the overall dll size and simplify linking. However, since CMake now produces a single libtoxcore.dll with toxcore, toxav and toxencryptsave included, we don't have to do this manually anymore. This results in the dll being named libtoxcore.dll instead of the libtox.dll that it previously was, matching the static libtoxcore.a's name.
Including libwinpthread and libssp.
While fun utils are of very low quality, both code-wise and usage-wise -- not checking for failed mallocs, not offering usage instructions, etc., there are a couple of them that Windows users might find useful, like the vanity key generators or a savedata creator, for example. The building of the fun utils was broken on Windows due to the utils failing to find sodium.h, as no libsodium include dirs were set on the fun utils.
For some reason even with -DCMAKE_EXE_LINKER_FLAGS="-static" specified, CMake still links OpenMP dynamically, even though it links other libs statically, e.g. -pthread.
These programs link against libsodium, which already provides bin-to-hex and hex-to-bin conversion functions. Removing the misc_tools dependency shaves ~30KiB (in some cases 10%) off Windows static binaries using it.
A bit infuriating that when you submit a PR modifying the Windows cross-compilation script, the CI *builds* the current image in one job, but then *runs* an older (!) image from Dockerhub in another. So it tests that the modified image builds successfully but doesn't test if it runs successfully, instead testing if an older image runs successfully / testing if the current toxcore changes run successfully in an older image. This should build and run the same image with the current changes.
It's a disableable option since we allow the user to change versions of dependencies and we obviously have hashes only for the default versions, we are not able to verify hashes of any other version, so it might be handy to be able to disable the check in that case.
b22bb6d
to
e742ded
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 approvals obtained (waiting on @iphydf and @robinlinden)
.github/workflows/docker.yml
line 166 at r4 (raw file):
Previously, iphydf wrote…
Nice :)
Done.
That was done by Reviewable, I didn't manually request those. I guess Reviewable really wants @iphydf and @robinlinden to review this PR, even though @iphydf has approved it already. |
Docker doesn't have an IPv6 network by default, so these tests were failing when using IPv6.
Wanted to bump the toxcore dependencies for Windows cross-compilation before the release, but ended up changing a lot more things.
This change is