GithubHelp home page GithubHelp logo

pyobjc-core-feedstock's Introduction

About pyobjc-core-feedstock

Feedstock license: BSD-3-Clause

Home: https://github.com/ronaldoussoren/pyobjc

Package license: MIT

Summary: Python<->ObjC Interoperability Module

Documentation: https://pyobjc.readthedocs.io/en/latest/

Current build status

Azure
VariantStatus
osx_64_python3.10.____cpython variant
osx_64_python3.11.____cpython variant
osx_64_python3.12.____cpython variant
osx_64_python3.8.____cpython variant
osx_64_python3.9.____cpython variant
osx_arm64_python3.10.____cpython variant
osx_arm64_python3.11.____cpython variant
osx_arm64_python3.12.____cpython variant
osx_arm64_python3.9.____cpython variant

Current release info

Name Downloads Version Platforms
Conda Recipe Conda Downloads Conda Version Conda Platforms

Installing pyobjc-core

Installing pyobjc-core from the conda-forge channel can be achieved by adding conda-forge to your channels with:

conda config --add channels conda-forge
conda config --set channel_priority strict

Once the conda-forge channel has been enabled, pyobjc-core can be installed with conda:

conda install pyobjc-core

or with mamba:

mamba install pyobjc-core

It is possible to list all of the versions of pyobjc-core available on your platform with conda:

conda search pyobjc-core --channel conda-forge

or with mamba:

mamba search pyobjc-core --channel conda-forge

Alternatively, mamba repoquery may provide more information:

# Search all versions available on your platform:
mamba repoquery search pyobjc-core --channel conda-forge

# List packages depending on `pyobjc-core`:
mamba repoquery whoneeds pyobjc-core --channel conda-forge

# List dependencies of `pyobjc-core`:
mamba repoquery depends pyobjc-core --channel conda-forge

About conda-forge

Powered by NumFOCUS

conda-forge is a community-led conda channel of installable packages. In order to provide high-quality builds, the process has been automated into the conda-forge GitHub organization. The conda-forge organization contains one repository for each of the installable packages. Such a repository is known as a feedstock.

A feedstock is made up of a conda recipe (the instructions on what and how to build the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by Azure, GitHub, CircleCI, AppVeyor, Drone, and TravisCI it is possible to build and upload installable packages to the conda-forge anaconda.org channel for Linux, Windows and OSX respectively.

To manage the continuous integration and simplify feedstock maintenance conda-smithy has been developed. Using the conda-forge.yml within this repository, it is possible to re-render all of this feedstock's supporting files (e.g. the CI configuration files) with conda smithy rerender.

For more information please check the conda-forge documentation.

Terminology

feedstock - the conda recipe (raw material), supporting scripts and CI configuration.

conda-smithy - the tool which helps orchestrate the feedstock. Its primary use is in the construction of the CI .yml files and simplify the management of many feedstocks.

conda-forge - the place where the feedstock and smithy live and work to produce the finished article (built conda distributions)

Updating pyobjc-core-feedstock

If you would like to improve the pyobjc-core recipe or build a new package version, please fork this repository and submit a PR. Upon submission, your changes will be run on the appropriate platforms to give the reviewer an opportunity to confirm that the changes result in a successful build. Once merged, the recipe will be re-built and uploaded automatically to the conda-forge channel, whereupon the built conda packages will be available for everybody to install and use from the conda-forge channel. Note that all branches in the conda-forge/pyobjc-core-feedstock are immediately built and any created packages are uploaded, so PRs should be based on branches in forks and branches in the main repository should only be used to build distinct package versions.

In order to produce a uniquely identifiable distribution:

  • If the version of a package is not being increased, please add or increase the build/number.
  • If the version of a package is being increased, please remember to return the build/number back to 0.

Feedstock Maintainers

pyobjc-core-feedstock's People

Contributors

conda-forge-admin avatar conda-forge-curator[bot] avatar github-actions[bot] avatar kastman avatar leofang avatar mariusvniekerk avatar ocefpaf avatar regro-cf-autotick-bot avatar xhochy avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyobjc-core-feedstock's Issues

Segmentation faults and "library not loaded" errors

I am experiencing segmentation faults or "Library not loaded" errors when running import objc or import CoreFoundation (from the pyobjc-framework-cocoa package). I think both issues are due to an incompatibility with the libffi library, or perhaps with an underlying macOS library:

  • when libffi 3.3 is installed, I experience "Library not loaded" errors when running import objc.

  • when libffi 3.4.2 is installed, I experience segmentation faults when running import CoreFoundation.

I can reproduce this reliably on both Catalina and Big Sur, from a new miniconda installation.

First, download and install miniconda:

mkdir workdir && cd workdir
curl -O https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.sh
sh ./Miniconda3-py39_4.10.3-MacOSX-x86_64.sh -b -p ./miniconda3
PREFIX=<workdir>/miniconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: <workdir>/miniconda3

  added / updated specs:
    - brotlipy==0.7.0=py39h9ed2024_1003
    - ca-certificates==2021.7.5=hecd8cb5_1
    - certifi==2021.5.30=py39hecd8cb5_0
    - cffi==1.14.6=py39h2125817_0
    - chardet==4.0.0=py39hecd8cb5_1003
    - conda-package-handling==1.7.3=py39h9ed2024_1
    - conda==4.10.3=py39hecd8cb5_0
    - cryptography==3.4.7=py39h2fd3fbb_0
    - idna==2.10=pyhd3eb1b0_0
    - libcxx==10.0.0=1
    - libffi==3.3=hb1e8313_2
    - ncurses==6.2=h0a44026_1
    - openssl==1.1.1k=h9ed2024_0
    - pip==21.1.3=py39hecd8cb5_0
    - pycosat==0.6.3=py39h9ed2024_0
    - pycparser==2.20=py_2
    - pyopenssl==20.0.1=pyhd3eb1b0_1
    - pysocks==1.7.1=py39hecd8cb5_0
    - python.app==3=py39h9ed2024_0
    - python==3.9.5=h88f2d9e_3
    - readline==8.1=h9ed2024_0
    - requests==2.25.1=pyhd3eb1b0_0
    - ruamel_yaml==0.15.100=py39h9ed2024_0
    - setuptools==52.0.0=py39hecd8cb5_0
    - six==1.16.0=pyhd3eb1b0_0
    - sqlite==3.36.0=hce871da_0
    - tk==8.6.10=hb0a8c7a_0
    - tqdm==4.61.2=pyhd3eb1b0_1
    - tzdata==2021a=h52ac0ba_0
    - urllib3==1.26.6=pyhd3eb1b0_1
    - wheel==0.36.2=pyhd3eb1b0_0
    - xz==5.2.5=h1de35cc_0
    - yaml==0.2.5=haf1e3a3_0
    - zlib==1.2.11=h1de35cc_3


The following NEW packages will be INSTALLED:

  brotlipy           pkgs/main/osx-64::brotlipy-0.7.0-py39h9ed2024_1003
  ca-certificates    pkgs/main/osx-64::ca-certificates-2021.7.5-hecd8cb5_1
  certifi            pkgs/main/osx-64::certifi-2021.5.30-py39hecd8cb5_0
  cffi               pkgs/main/osx-64::cffi-1.14.6-py39h2125817_0
  chardet            pkgs/main/osx-64::chardet-4.0.0-py39hecd8cb5_1003
  conda              pkgs/main/osx-64::conda-4.10.3-py39hecd8cb5_0
  conda-package-han~ pkgs/main/osx-64::conda-package-handling-1.7.3-py39h9ed2024_1
  cryptography       pkgs/main/osx-64::cryptography-3.4.7-py39h2fd3fbb_0
  idna               pkgs/main/noarch::idna-2.10-pyhd3eb1b0_0
  libcxx             pkgs/main/osx-64::libcxx-10.0.0-1
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.2-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1k-h9ed2024_0
  pip                pkgs/main/osx-64::pip-21.1.3-py39hecd8cb5_0
  pycosat            pkgs/main/osx-64::pycosat-0.6.3-py39h9ed2024_0
  pycparser          pkgs/main/noarch::pycparser-2.20-py_2
  pyopenssl          pkgs/main/noarch::pyopenssl-20.0.1-pyhd3eb1b0_1
  pysocks            pkgs/main/osx-64::pysocks-1.7.1-py39hecd8cb5_0
  python             pkgs/main/osx-64::python-3.9.5-h88f2d9e_3
  python.app         pkgs/main/osx-64::python.app-3-py39h9ed2024_0
  readline           pkgs/main/osx-64::readline-8.1-h9ed2024_0
  requests           pkgs/main/noarch::requests-2.25.1-pyhd3eb1b0_0
  ruamel_yaml        pkgs/main/osx-64::ruamel_yaml-0.15.100-py39h9ed2024_0
  setuptools         pkgs/main/osx-64::setuptools-52.0.0-py39hecd8cb5_0
  six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  sqlite             pkgs/main/osx-64::sqlite-3.36.0-hce871da_0
  tk                 pkgs/main/osx-64::tk-8.6.10-hb0a8c7a_0
  tqdm               pkgs/main/noarch::tqdm-4.61.2-pyhd3eb1b0_1
  tzdata             pkgs/main/noarch::tzdata-2021a-h52ac0ba_0
  urllib3            pkgs/main/noarch::urllib3-1.26.6-pyhd3eb1b0_1
  wheel              pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  yaml               pkgs/main/osx-64::yaml-0.2.5-haf1e3a3_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3


Preparing transaction: done
Executing transaction: |
done
installation finished.

Now create an environment with Python, pyobjc-core, and pyobjc-framework-cocoa. I pin libffi at 3.3 here, to demonstrate the difference in behaviour between libffi 3.3 and 3.4.2:

./miniconda3/bin/conda create -c conda-forge -p ./env python=3.9 pyobjc-core pyobjc-framework-cocoa libffi=3.3
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: <workdir>/env

  added / updated specs:
    - libffi=3.3
    - pyobjc-core
    - pyobjc-framework-cocoa
    - python=3.9


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2021.5.30  |       h033912b_0         136 KB  conda-forge
    libcxx-12.0.1              |       habf9029_0         1.1 MB  conda-forge
    libffi-3.3                 |       h046ec9c_2          45 KB  conda-forge
    libzlib-1.2.11             |    h9173be1_1013          58 KB  conda-forge
    ncurses-6.2                |       h2e338ed_4         881 KB  conda-forge
    openssl-1.1.1l             |       h0d85af4_0         1.9 MB  conda-forge
    pip-21.2.4                 |     pyhd8ed1ab_0         1.1 MB  conda-forge
    pyobjc-core-7.3            |   py39h89e85a6_2         326 KB  conda-forge
    pyobjc-framework-cocoa-7.3 |   py39h6e9494a_0         300 KB  conda-forge
    python-3.9.7               |hd187cdc_0_cpython        12.5 MB  conda-forge
    python_abi-3.9             |           2_cp39           4 KB  conda-forge
    readline-8.1               |       h05e3726_0         266 KB  conda-forge
    setuptools-58.2.0          |   py39h6e9494a_0         1.0 MB  conda-forge
    sqlite-3.36.0              |       h23a322b_2         1.8 MB  conda-forge
    tk-8.6.11                  |       h5dbffcc_1         3.3 MB  conda-forge
    tzdata-2021c               |       he74cb21_0         120 KB  conda-forge
    wheel-0.37.0               |     pyhd8ed1ab_1          31 KB  conda-forge
    xz-5.2.5                   |       haf1e3a3_1         228 KB  conda-forge
    zlib-1.2.11                |    h9173be1_1013          87 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        25.0 MB

The following NEW packages will be INSTALLED:

  ca-certificates    conda-forge/osx-64::ca-certificates-2021.5.30-h033912b_0
  libcxx             conda-forge/osx-64::libcxx-12.0.1-habf9029_0
  libffi             conda-forge/osx-64::libffi-3.3-h046ec9c_2
  libzlib            conda-forge/osx-64::libzlib-1.2.11-h9173be1_1013
  ncurses            conda-forge/osx-64::ncurses-6.2-h2e338ed_4
  openssl            conda-forge/osx-64::openssl-1.1.1l-h0d85af4_0
  pip                conda-forge/noarch::pip-21.2.4-pyhd8ed1ab_0
  pyobjc-core        conda-forge/osx-64::pyobjc-core-7.3-py39h89e85a6_2
  pyobjc-framework-~ conda-forge/osx-64::pyobjc-framework-cocoa-7.3-py39h6e9494a_0
  python             conda-forge/osx-64::python-3.9.7-hd187cdc_0_cpython
  python_abi         conda-forge/osx-64::python_abi-3.9-2_cp39
  readline           conda-forge/osx-64::readline-8.1-h05e3726_0
  setuptools         conda-forge/osx-64::setuptools-58.2.0-py39h6e9494a_0
  sqlite             conda-forge/osx-64::sqlite-3.36.0-h23a322b_2
  tk                 conda-forge/osx-64::tk-8.6.11-h5dbffcc_1
  tzdata             conda-forge/noarch::tzdata-2021c-he74cb21_0
  wheel              conda-forge/noarch::wheel-0.37.0-pyhd8ed1ab_1
  xz                 conda-forge/osx-64::xz-5.2.5-haf1e3a3_1
  zlib               conda-forge/osx-64::zlib-1.2.11-h9173be1_1013


Proceed ([y]/n)?


Downloading and Extracting Packages
python-3.9.7         | 12.5 MB   | #################################################################################################################################################### | 100%
pyobjc-framework-coc | 300 KB    | #################################################################################################################################################### | 100%
tzdata-2021c         | 120 KB    | #################################################################################################################################################### | 100%
xz-5.2.5             | 228 KB    | #################################################################################################################################################### | 100%
ca-certificates-2021 | 136 KB    | #################################################################################################################################################### | 100%
libcxx-12.0.1        | 1.1 MB    | #################################################################################################################################################### | 100%
zlib-1.2.11          | 87 KB     | #################################################################################################################################################### | 100%
readline-8.1         | 266 KB    | #################################################################################################################################################### | 100%
ncurses-6.2          | 881 KB    | #################################################################################################################################################### | 100%
wheel-0.37.0         | 31 KB     | #################################################################################################################################################### | 100%
sqlite-3.36.0        | 1.8 MB    | #################################################################################################################################################### | 100%
pip-21.2.4           | 1.1 MB    | #################################################################################################################################################### | 100%
openssl-1.1.1l       | 1.9 MB    | #################################################################################################################################################### | 100%
tk-8.6.11            | 3.3 MB    | #################################################################################################################################################### | 100%
python_abi-3.9       | 4 KB      | #################################################################################################################################################### | 100%
setuptools-58.2.0    | 1.0 MB    | #################################################################################################################################################### | 100%
libzlib-1.2.11       | 58 KB     | #################################################################################################################################################### | 100%
pyobjc-core-7.3      | 326 KB    | #################################################################################################################################################### | 100%
libffi-3.3           | 45 KB     | #################################################################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate <workdir>/env
#
# To deactivate an active environment, use
#
#     $ conda deactivate

With libffi 3.3, I am unable to import the objc package:

./env/bin/python -c "import objc"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<workdir>/lib/python3.9/site-packages/objc/__init__.py", line 6, in <module>
    from . import _objc
ImportError: dlopen(<workdir>/env/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so, 2): Library not loaded: @rpath/libffi.8.dylib
  Referenced from: <workdir>/env/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so
  Reason: image not found

Now I'll update libffi to the latest available:

./miniconda3/bin/conda update -c conda-forge -p ./env libffi
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: <workdir>/env

  added / updated specs:
    - libffi


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libffi-3.4.2               |       he49afe7_4          50 KB  conda-forge
    openssl-3.0.0              |       h0d85af4_1         2.5 MB  conda-forge
    python-3.9.7               |h38b4d05_3_cpython        12.5 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        15.1 MB

The following packages will be UPDATED:

  libffi                                     3.3-h046ec9c_2 --> 3.4.2-he49afe7_4
  openssl                                 1.1.1l-h0d85af4_0 --> 3.0.0-h0d85af4_1
  python                           3.9.7-hd187cdc_0_cpython --> 3.9.7-h38b4d05_3_cpython


Proceed ([y]/n)? y


Downloading and Extracting Packages
openssl-3.0.0        | 2.5 MB    | #################################################################################################################################################### | 100%
python-3.9.7         | 12.5 MB   | #################################################################################################################################################### | 100%
libffi-3.4.2         | 50 KB     | #################################################################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

After doing this, import objc succeeds, but then import CoreFoundation segfaults:

./env/bin/python
Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:23:19)
[Clang 11.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import objc
>>> import CoreFoundation
Segmentation fault: 11

I traced the location of the segmentation fault to a series of calls to objc.createStructType in the CoreFoundation._metadata module:

./env/bin/python
Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:23:19)
[Clang 11.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import faulthandler
>>> faulthandler.enable()
>>> import CoreFoundation
Fatal Python error: Segmentation fault

Current thread 0x000000010defadc0 (most recent call first):
  File "<workdir>/env/lib/python3.9/site-packages/objc/_bridgesupport.py", line 850 in createStructType
  File "<workdir>/env/lib/python3.9/site-packages/CoreFoundation/_metadata.py", line 40 in <module>
  File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 850 in exec_module
  File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
  File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
  File "<workdir>/env/lib/python3.9/site-packages/CoreFoundation/__init__.py", line 11 in <module>
  File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 850 in exec_module
  File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
  File "<stdin>", line 1 in <module>
Segmentation fault: 11

As an aside, I discovered this issue through (indirect) use of the send2trash project, which attempts to use pyobjc, but then falls back to using the built-in ctypes library:

https://github.com/arsenetar/send2trash/blob/9b0d5796c1e48a3bf294971dc129499876936a36/send2trash/plat_osx.py#L12-L17

I suspect that, with libffi 3.3, the "Library not loaded" error has been occurring for some time, but I did not encounter it due to the conditional logic used in send2trash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.