Skip to content

Can't install on macOS < 15 (dependency issue) #580

@lkekana

Description

@lkekana

Hey scdl devs!

First off, thank you for your work. I've been a happy user for 6+ years. Your efforts are appreciated :)

With that said, when attempting to install the latest version, i got

$ uv tool install scdl
Resolved 16 packages in 1.00s
  × Failed to build `curl-cffi==0.14.0`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)

      [stdout]
      Using /Users/runner/work/_temp/install/lib to store libcurl-impersonate
      Downloading libcurl-impersonate from
      https://github.com/lexiforest/curl-impersonate/releases/download/v1.2.5/libcurl-impersonate-v1.2.5.x86_64-macos.tar.gz...
      Unpacking downloaded files...

      [stderr]
      /Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/wheel/bdist_wheel.py:4:
      FutureWarning: The 'wheel' package is no longer the canonical location
      of the 'bdist_wheel' command, and will be removed in a future release.
      Please update to setuptools v70.1 or later which contains an integrated
      version of this command.
        warn(
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
          requires = get_requires_for_build({})
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/build_meta.py",
      line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/build_meta.py",
      line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/build_meta.py",
      line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 16, in <module>
              requires = []
          ...<5 lines>...
      
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/__init__.py",
      line 117, in setup
          return distutils.core.setup(**attrs)  # type: ignore[return-value]
                 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/_distutils/core.py",
      line 148, in setup
          _setup_distribution = dist = klass(attrs)
                                       ~~~~~^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/dist.py",
      line 321, in __init__
          _Distribution.__init__(self, dist_attrs)
          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/_distutils/dist.py",
      line 307, in __init__
          self.finalize_options()
          ~~~~~~~~~~~~~~~~~~~~~^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/dist.py",
      line 790, in finalize_options
          ep(self)
          ~~^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/setuptools/dist.py",
      line 810, in _finalize_setup_keywords
          ep.load()(self, ep.name, value)
          ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/cffi/setuptools_ext.py",
      line 229, in cffi_modules
          add_cffi_module(dist, cffi_module)
          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/cffi/setuptools_ext.py",
      line 50, in add_cffi_module
          execfile(build_file_name, mod_vars)
          ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File
      "/Users/lesedikekana/.cache/uv/builds-v0/.tmpc3mhFl/lib/python3.13/site-packages/cffi/setuptools_ext.py",
      line 26, in execfile
          exec(code, glob, glob)
          ~~~~^^^^^^^^^^^^^^^^^^
        File "scripts/build.py", line 144, in <module>
          download_libcurl()
          ~~~~~~~~~~~~~~~~^^
        File "scripts/build.py", line 73, in download_libcurl
          os.makedirs(arch["libdir"], exist_ok=True)
          ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen os>", line 218, in makedirs
        File "<frozen os>", line 218, in makedirs
        File "<frozen os>", line 218, in makedirs
        [Previous line repeated 1 more time]
        File "<frozen os>", line 228, in makedirs
      PermissionError: [Errno 13] Permission denied: '/Users/runner'

      hint: This usually indicates a problem with the package or the build
      environment.
  help: `curl-cffi` (v0.14.0) was included because `scdl` (v3.0.4) depends
        on `curl-cffi`

researching this further, i found that this is a known issue in curl-cffi>=14 affecting all versions of macOS < 15.0 (Sequoia)

the YT-DLP team are seemingly aware of this and have worked around it by

  1. making curl-cffi an optional dependency in their pyproject.toml (and specifically skipping v0.14)
[project.optional-dependencies]
...
curl-cffi = [
    "curl-cffi>=0.5.10,!=0.6.*,!=0.7.*,!=0.8.*,!=0.9.*,<0.15; implementation_name=='cpython'",
]
curl-cffi-compat = [
    "curl-cffi==0.13.0",
]
  1. doing some trickery in their build pipeline for macOS by building parts of curl-cffi themselves and other workarounds (this is outside of my understanding)
    https://github.com/yt-dlp/yt-dlp/blob/2d7b278666bfbf12cf287072498dd275c946b968/.github/workflows/build.yml#L323-L375

i'm aware that the most recent commit was in response to the PR at #571 to add support for the --impersonate flag. the changes however break compatibility for numerous macOS versions unnecessarily, since yt-dlp can work just fine without the dependency

in good news, the macOS issue is fixed is the latest RC version of curl-cffi released today (see https://github.com/lexiforest/curl_cffi/releases/tag/v0.15.0rc1) but i think removing the dependency from sc-dl altogether is the best approach, since it's not crucial to yt-dlp and then specifying curl-cffi>=15 once the update is released officially

and also, i've got a fix that i'm about to open a PR for that will fix scdl in spite of the new update. i will link it here once it's open to address this👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions