Skip to content
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

Build error on mingwX64 #13

Closed
blurkidi opened this issue Feb 5, 2024 · 7 comments
Closed

Build error on mingwX64 #13

blurkidi opened this issue Feb 5, 2024 · 7 comments

Comments

@blurkidi
Copy link

blurkidi commented Feb 5, 2024

How to reproduce:

  • Environment: Windows 11 (latest updates)
  • Check out the main branch and load the project on Android Studio
  • Run "dev.whyoleg.cryptography.providers.openssl3.prebuilt.PrebuiltLibCrypto3Test" on mingwX64 target

Expected result: Test runs and passes

Actual result:
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':cryptography-provider-openssl3-prebuilt:mingwX64ReleaseTest'.

command 'C:\Users\blurk\git\cryptography-kotlin\cryptography-providers\openssl3\prebuilt\build\bin\mingwX64\releaseTest\test.exe' exited with errors (exit code: -1073741515)

Comments:
I run into the same issue when adding the the lib through a gradle dependency: "implementation("dev.whyoleg.cryptography:cryptography-provider-openssl3-prebuilt-mingwx64:0.2.0")". Think makes cryptography-kotlin unusable on Windows targets.
I wanted to further debug the problem before posting the issue, but I don't know where to start from.

@whyoleg
Copy link
Owner

whyoleg commented Feb 5, 2024

Hey!
Hm, I'm not sure what's going on here (I don't have Windows machine at my side), but on CI with Windows server 2022 (windows 10) everything works fine.

Could you please check dev branch locally and run :cryptography-provider-openssl3-prebuilt:mingwX64ReleaseTest and :cryptography-provider-openssl3-prebuilt:mingwX64Test? There were a lot of changes regarding how openssl is integrated there.

@blurkidi
Copy link
Author

blurkidi commented Feb 5, 2024

Hi,
I tried the dev branch and sadly, I had the same result.

I might have a clue though. I realized that the build is successful, but running the test fails, so I tried to run the generated executable (...\bin\mingwX64\debugTest\test.exe) and I get the following error:
"The code execution cannot process because zlib1.dll was not found"

It is not much, but that is all I have.

@whyoleg
Copy link
Owner

whyoleg commented Feb 5, 2024

Thank you! This is really helpful!
Now looks like I understand what's going on: zlib is installed by default everywhere except windows (why am I not surprised?), so looks like for mingw in prebuilt variant we need to link to libz.a statically.
On CI it most likely works because zlib is installed there... Not sure now, how I will be able to test the fix without windows machine at my side.
Will it be fine for you if I will publish some snapshot versions for you to test If I will not be able to reproduce it on CI somehow?

@whyoleg
Copy link
Owner

whyoleg commented Feb 5, 2024

Good news: I was able to reproduce the issue on CI!
Good news[2]: I was able to fix the issue.
Good news[3]: I was able to setup testing of this issue consistently on CI!

So, when the build will be finished (specifically publish step), will you be able to re-check the fix at your side using the 0.3.0-SNAPSHOT version? For this you will need to additionally add "https://s01.oss.sonatype.org/content/repositories/snapshots/" to repositories.
Example is available here https://github.com/whyoleg/cryptography-kotlin?tab=readme-ov-file#using-in-your-projects (under a drop-down)

Stable release (0.3.0, not snapshot) is planned in coming weeks, on current moment it will be hard for me to make a patch release for this...

@blurkidi
Copy link
Author

blurkidi commented Feb 6, 2024

Good news! I just tested '0.3.0-SNAPSHOT' and my tests run perfectly 🎉

Thanks you very much for the fix, and glad I could help (a little 😊)

PS: Kudos for this library! Extremely useful, plus I love your take on Providers that leverage platform specific implementation.

@whyoleg
Copy link
Owner

whyoleg commented Feb 6, 2024

Cool! Thanks for testing! And thanks for such great words!
I will close the issue after the release of 0.3.0, so you will be notified.

@whyoleg
Copy link
Owner

whyoleg commented Feb 21, 2024

0.3.0 is released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants