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

add Windows support #12

Merged
merged 13 commits into from
Jan 10, 2021
Merged

add Windows support #12

merged 13 commits into from
Jan 10, 2021

Conversation

erip
Copy link
Contributor

@erip erip commented Jan 7, 2021

This PR seeks to add Windows support to this repo to close #11. As a part of this, it will transition to GitHub Actions for ease of testing.

@erip erip force-pushed the feature/windows-support branch 2 times, most recently from 0f7653e to f2a9944 Compare January 7, 2021 13:57
@erip erip force-pushed the feature/windows-support branch 5 times, most recently from b26ba20 to d876733 Compare January 7, 2021 14:57
@erip erip changed the title [WIP] add Windows support add Windows support Jan 7, 2021
@erip
Copy link
Contributor Author

erip commented Jan 7, 2021

@levyfan CI passes here. If you want to accept this, you can add GitHub Actions support for your repo and it should guarantee the three major platforms are supported.

@erip
Copy link
Contributor Author

erip commented Jan 7, 2021

And, as an aside, this PR could probably be cleaned up by someone who knows Maven better than me. 😄 But this works and isn't too invasive.

Copy link
Owner

@levyfan levyfan left a comment

Choose a reason for hiding this comment

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

Thank you @erip for your great work!

One question, can we remove the file windows-jni/include/jni.h?

@erip
Copy link
Contributor Author

erip commented Jan 8, 2021

I can try, but I suspect there may be issues. Specifically on Windows, jint is an alias to a native long, which causes a lot of issues. The workaround is often to use a custom (in this case, Android-based) JNI header.

@erip erip force-pushed the feature/windows-support branch 2 times, most recently from f94a639 to a5cf8b6 Compare January 8, 2021 12:32
@erip
Copy link
Contributor Author

erip commented Jan 8, 2021

@levyfan, as I suspected this won't work: https://github.com/erip/sentencepiece-jni/runs/1668614105?check_suite_focus=true#step:4:3561

Because a jint is a long on Windows, we can't rely on the Windows JNI. The workaround with the windows-jni/ here is the same approach we took on adding Java runtime support to PyTorch on Windows, so there's some precedent. 😅 If you're OK with adding this dir, this can be merged.

@levyfan levyfan merged commit c9d8eb3 into levyfan:master Jan 10, 2021
@erip erip deleted the feature/windows-support branch January 10, 2021 02:44
@erip erip mentioned this pull request Jan 14, 2021
This pull request was closed.
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.

Repo doesn't work on Windows
2 participants