-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix zstd on windows #16293
fix zstd on windows #16293
Conversation
third_party/zstd-jni/zstd-jni.BUILD
Outdated
genrule( | ||
name = "copy_link_jni_md_header", | ||
srcs = select({ | ||
"@io_bazel//src/conditions:darwin": ["@bazel_tools//tools/jdk:jni_md_header-darwin"], |
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.
@bazel_tools//src/conditions:*
is better.
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.
updated throughout
We should try to enable the tests on Windows as well: https://cs.opensource.google/bazel/bazel/+/master:.bazelci/presubmit.yml;l=244-245 |
third_party/zstd-jni/zstd-jni.BUILD
Outdated
"src/windows/include/jni_md.h", | ||
"jni/jni.h", | ||
]) + [ | ||
"jni_md.h", |
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.
prepend :
? e.g. :jni_md.h
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.
done
Sandboxing on Windows is more limited than on other platforms, so two jni_md.h headers were ending up in the include path. This resulted in the wrong jni_md.h header being used on Windows, which meant that the JNIEXPORT macro was not being set to actually export symbols appropriately on Windows. This caused any attempts to use zstd on windows, whether for http_archive, gRPC cache compression, etc. to result in an UnsatisfiedLinkError being thrown. Change to use a similar method as the main bazel jni stuff, which is to copy the jni.h and jni_md.h headers over. This prevents accidentally picking up a header from the wrong architecture. Relates to bazelbuild#16041
Can you also update https://cs.opensource.google/bazel/bazel/+/master:.bazelci/postsubmit.yml;l=252 to the same as the presubmit.yml file? |
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.
LGTM. Thanks!
done! |
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.
Thank you so much for the fix!
Relates to bazelbuild#16041 Partial commit for third_party/*, see bazelbuild#16293. Signed-off-by: Sunil Gowroji <sgowroji@google.com>
Sandboxing on Windows is more limited than on other platforms, so two jni_md.h headers were ending up in the include path. This resulted in the wrong jni_md.h header being used on Windows, which meant that the JNIEXPORT macro was not being set to actually export symbols appropriately on Windows. This caused any attempts to use zstd on windows, whether for http_archive, gRPC cache compression, etc. to result in an UnsatisfiedLinkError being thrown. Change to use a similar method as the main bazel jni stuff, which is to copy the jni.h and jni_md.h headers over. This prevents accidentally picking up a header from the wrong architecture. Relates to bazelbuild#16041 Closes bazelbuild#16293. PiperOrigin-RevId: 475839895 Change-Id: Ia5569c50c8764699abe9858207a256b921980b92
Relates to bazelbuild#16041 Partial commit for third_party/*, see bazelbuild#16293. Signed-off-by: Sunil Gowroji <sgowroji@google.com>
Relates to bazelbuild#16041 Partial commit for third_party/*, see bazelbuild#16293. Signed-off-by: Sunil Gowroji <sgowroji@google.com>
Sandboxing on Windows is more limited than on other platforms, so two jni_md.h headers were ending up in the include path. This resulted in the wrong jni_md.h header being used on Windows, which meant that the JNIEXPORT macro was not being set to actually export symbols appropriately on Windows. This caused any attempts to use zstd on windows, whether for http_archive, gRPC cache compression, etc. to result in an UnsatisfiedLinkError being thrown.
Change to use a similar method as the main bazel jni stuff, which is to copy the jni.h and jni_md.h headers over. This prevents accidentally picking up a header from the wrong architecture.
Relates to #16041