Closed sveinugu closed 2 years ago
rpy2 still fails to run on Apple silicon on a clean install. Anyone able to test out a rebuild with the solution I suggested above? @ocefpaf? @xhochy?
Looks like support was added in https://github.com/conda-forge/rpy2-feedstock/pull/71. I'm not a macOS users let alone an expert. Usually @xhochy and @isuruf know how to fix it but they are very busy and may take a while to get here.
@ocefpaf It is a bit strange, and it seems to me that compilation of rpy2 has not been tested on actual Apple Silicon. Which I believe it should be.
rpy2 is at least failing out of the box on two M1 machines I have tried, but adding the abovementioned RPY2_CFFI_MODE=BOTH
environment variable prior to compilation (through pip
) fixes it for me. I am a bit surprised that there are no other complaints about this, though...
We can add RPY2_CFFI_MODE=BOTH
when building. Please send a PR to add this
It is a bit strange, and it seems to me that compilation of rpy2 has not been tested on actual Apple Silicon. Which I believe it should be.
We don't have the resources to do that. If you can provide Apple Silicon hardware to test them, we'd be glad to have them.
@ocefpaf It is a bit strange, and it seems to me that compilation of rpy2 has not been tested on actual Apple Silicon. Which I believe it should be.
So do we but Apple hardware is too expensive for a bunch of volunteers doing free work to buy. If you have some and can test these for us please do! A PR to fix that is also welcomed!
RPY2_CFFI_MODE=API
is likely a better fix if building binary (compiled) packages. The ABI mode only exists to allow the installation of the source of package on machines without the tool chain or dependencies to build Python C extensions and R C extensions.
Issue:
rpy2 running on Apple Silicon unsuccessfully tries to override MacOS X Big Sur security measure.
This issue is related to https://github.com/pyca/pyopenssl/issues/873, but PyOpenSSL is not installed. Rather, this is a problem with rpy2 itself.
https://cffi.readthedocs.io/en/latest/using.html#callbacks points to a workaround for Mac OS X (which I have been unable to understand how to apply), but states: "If you are using the out-of-line API mode, it is recommended to use the extern “Python” mechanism instead of callbacks".
Since version 3.2.0 (https://github.com/rpy2/rpy2/blob/4549736a37a3dd9da1044a9013398f54d04206c7/NEWS#L441), Rpy2 supports compilation to both ABI (default) and API modes, or BOTH:
And it seems the
extern "Python" mechanism
is used in the API case, as per recommendations above: https://github.com/rpy2/rpy2/blob/85ffe7cd2a88e2ad0e735cc0078d6696e2e65658/rpy2/_rinterface_cffi_build.py#L207Currently, however rpy2 is compiled (as default) using the
ABI
mode, notAPI
orBOTH
:I would assume compiling with
RPY2_CFFI_MODE=BOTH
would be the best option, in order to not break current behaviour.Uninstalling rpy2 and installing from
pip
works, using the conda-forge compilers installed together withr-base
:RPY2_CFFI_MODE=BOTH
at compilation time for rpy >= 3.2.0 should fix the issue. I do not have conda-forge workflow set up to test this.test_on_native_only
be set tofalse
in order to test this? Or are there other issues/concerns (I do not know the details of the conda-forgeosx-arm64
compilation setup)?Environment (
conda list
):Details about
conda
and system (conda info
):