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

Windows stringzillite might be broken #185

Open
3 tasks done
ashbob999 opened this issue Oct 22, 2024 · 4 comments
Open
3 tasks done

Windows stringzillite might be broken #185

ashbob999 opened this issue Oct 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ashbob999
Copy link
Contributor

Describe the bug

I think after #181, the stringzillite dll may have been broken.
The addition of the static lib changes, might have made the dll dependent on other dlls.

I have not tested this, but I'm quite sure the problem exists and can look into it when I get chance.

Steps to reproduce

Build the stringzillite dll on windows.

Expected behavior

The dll Is completely standalone.

StringZilla version

3.10.5

Operating System

Windows 10

Hardware architecture

x86

Which interface are you using?

C implementation

Contact Details

No response

Are you open to being tagged as a contributor?

  • I am open to being mentioned in the project .git history as a contributor

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ashbob999 ashbob999 added the bug Something isn't working label Oct 22, 2024
@ashvardanian
Copy link
Owner

@ashbob999, I won't be surprised. I've tried dozens of patches until I've passed the CI for existing targets, and those were not guided by some deep understanding - trial and error at its worst. You must be much more experienced with DLL packaging for Windows and help would be appreciated 🤗

@ashbob999
Copy link
Contributor Author

I wouldn't say I'm that experienced, but I know some things.

For these changes:
https://github.com/ashvardanian/StringZilla/blob/main/CMakeLists.txt#L331-L338

Were these just trial and error to get it to build, or from external build issues?

@ashvardanian
Copy link
Owner

It was research-driven, but took multiple attempts 😄

@ashbob999
Copy link
Contributor Author

I could be wrong, but here's my understanding of what has caused this.

Now I do think the solution to #178 was correct, by adding the sz_dispatch_table_init to the .CRT$XCU section. As thus gets called as part of the global static initialisers, from the crt implementation of _DllMainCRTStartup only.

And as for why these functions weren't being called from the rust library, I have a hunch that they were there but either maybe rust inserts a custom _DllMainCRTStartup function, or simply the linker preferred the version in the crt libs instead.
I probably need to read up of how rust creates its library packages, to know for sure why it worked.

crt init docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@ashvardanian @ashbob999 and others