Skip to content

Fix extracting PowerSync library from JAR #174

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

Merged
merged 9 commits into from
Apr 24, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Apr 22, 2025

As a workaround for a Windows-specific issue, R::class.java.getResource(path) was used to obtain a path to libpowersync.dylib.
While this works during development, it fails for builds we distribute to users because libpowersync.dylib is inside a JAR, so the path can't be dlopened by SQLite.

This reverts the implementation to extract the library into a temporary file again. I couldn't test this on Windows to debug any potentially regressions there (which was the motivation for the change). I'm using deleteOnClose instead of a custom shutdown hook, I'm not sure if that makes a difference?

Closes #172

@simolus3 simolus3 requested a review from stevensJourney April 22, 2025 16:54
@stevensJourney
Copy link
Contributor

I could not reproduce any crash or error when closing the Supabase demo on Windows. I think deleteOnClose might be the correct solution here. Thanks for fixing this.

windows.1.mp4

stevensJourney
stevensJourney previously approved these changes Apr 24, 2025
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog here needs to be updated, but otherwise LGTM

stevensJourney
stevensJourney previously approved these changes Apr 24, 2025
@simolus3 simolus3 merged commit deee4b1 into main Apr 24, 2025
3 checks passed
@simolus3 simolus3 deleted the fix-loading-extension-from-jar branch April 24, 2025 14:39
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

Successfully merging this pull request may close these issues.

SQLiteException thrown when running jvm only in version 1.0.0-BETA29 and 1.0.0-BETA30
2 participants