Build native MacOS arm64 artifacts (universal2)#31747
Conversation
|
Whoops. Looks like in the most recent build, only 3.11 artifacts ended up as universal. I guess this need some more work. Ah. It looks like it's just the naming. All of the artifacts actually do have universal shared object libraries bundled: |
|
Yet another issue: It looks like a symbol from boringssl is missing. It seems that this function is written in assembly and expected to be linked in separately. As far as I can tell, there is no arm64 implementation. We'll probably have to turn off boringssl assembly optimizations. Hopefully, we can do it just for the arm64 version and not the x86 version, but I'm not sure yet if that's possible. |
|
It looks like selectively disabling ASM optimizations for just arm64 would be difficult. We'd likely have to compile to object files then link them together into a fat archive using (e.g.) |
|
This should make it into 1.52.0, which is currently scheduled for release December 27th, but may slip by a week or so due to the holidays. |
* Attempt to build universal2 artifacts * Whoops * Reverse the hack * Turn off boringssl assembly optimizations * Whoopsie
* Attempt to build universal2 artifacts * Whoops * Reverse the hack * Turn off boringssl assembly optimizations * Whoopsie
* Attempt to build universal2 artifacts * Whoops * Reverse the hack * Turn off boringssl assembly optimizations * Whoopsie
BoringSSL's gas-compatible assembly files, like its C files, are now wrapped with preprocessor ifdefs to capture which platforms each file should be enabled on. This means that, provided the platform can process .S files it all (i.e. not Windows), we no longer need to detect the exact CPU architecture in the build. Switch gRPC's build to take advantage of this. I've retained BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM, on the off chance anyone is using it to cross-compile between Windows and non-Windows, though I doubt that works particularly well. As part of this, restore assembly optimizations in a few places where they were seemingly disabled for issues relating to this: - grpc#31747 had to disable the assembly, because at the time assembly required the library be built differently for each architecture and then stitched back together. This should now work. - tools/run_tests/run_tests.py disabled x86 assembly due to some issues with CMAKE_SYSTEM_PROCESSOR in a Docker image. This too should now be moot.
BoringSSL's gas-compatible assembly files, like its C files, are now wrapped with preprocessor ifdefs to capture which platforms each file should be enabled on. This means that, provided the platform can process .S files it all (i.e. not Windows), we no longer need to detect the exact CPU architecture in the build. Switch gRPC's build to take advantage of this. I've retained BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM, on the off chance anyone is using it to cross-compile between Windows and non-Windows, though I doubt that works particularly well. As part of this, restore assembly optimizations in a few places where they were seemingly disabled for issues relating to this: - grpc#31747 had to disable the assembly, because at the time assembly required the library be built differently for each architecture and then stitched back together. This should now work. - tools/run_tests/run_tests.py disabled x86 assembly due to some issues with CMAKE_SYSTEM_PROCESSOR in a Docker image. This too should now be moot.
~~NB: I haven't tested this at all and am hoping the CI will tell me where I've (undoubtedly) messed something up.~~ Edit: looks like CI is now clear! BoringSSL's gas-compatible assembly files, like its C files, are now wrapped with preprocessor ifdefs to capture which platforms each file should be enabled on. This means that, provided the platform can process .S files it all (i.e. not Windows), we no longer need to detect the exact CPU architecture in the build. Switch gRPC's build to take advantage of this. I've retained BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM, on the off chance anyone is using it to cross-compile between Windows and non-Windows, though I doubt that works particularly well. As part of this, restore assembly optimizations in a few places where they were seemingly disabled for issues relating to this: - #31747 had to disable the assembly, because at the time assembly required the library be built differently for each architecture and then stitched back together. This should now work. - tools/run_tests/run_tests.py disabled x86 assembly due to some issues with CMAKE_SYSTEM_PROCESSOR in a Docker image. This too should now be moot. <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. -->
This PR builds all MacOS artifacts as
universal2artifacts by default. This builds the.whlwith a shared object library supporting both thex86_64andarm64platforms:This also removes the hack introduced by #29857 since we are now truly building universal artifacts. Fixes #29262