Skip to content
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

Exclude pylibmc on MacOS and Windows #18291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jaap3
Copy link
Contributor

@jaap3 jaap3 commented Jun 20, 2024

Trac ticket number

N/A

Branch description

Following the quickstart I ran into the following issue:

$ python -m pip install -r requirements/py3.txt
...
Building wheels for collected packages: pylibmc
  Building wheel for pylibmc (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pylibmc (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      In file included from src/_pylibmcmodule.c:34:
      src/_pylibmcmodule.h:42:10: fatal error: 'libmemcached/memcached.h' file not found
      #include <libmemcached/memcached.h>
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pylibmc
Failed to build pylibmc

I'm on MacOS, libmemcached is not available and I'm not sure how to get it.

Seeing as Windows is already exempt from this requirement, I've added MacOS to be excluded as well.

Not sure if this requires a track ticket?

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

pylibmc doesn't install on MacOS either.
@nessita
Copy link
Contributor

nessita commented Jun 27, 2024

Hello @jaap3, thank you for this PR!

From some chats at the DjangoCon Europe sprints, I think that the right solution is to pass a special env var when installing the dependencies. A few search results point to this solution:

brew install libmemcached
pip install pylibmc --install-option="--with-libmemcached=/usr/local/Cellar/libmemcached"

(the path may be different in your specific Mac, perhaps something inside /opt/homebrew? see for example lericson/pylibmc#101)

Could you confirm this works? If so we may need to tweak the docs to mention this (and we could re-purpose this PR for that).

@jaap3
Copy link
Contributor Author

jaap3 commented Jun 27, 2024

@nessita Thanks for the suggestion. I'd rather avoid installing homebrew, I've had terrible experiences with it messing up my system in the past.

Having to install homebrew and compiling code just to run Django's test suite (as part of an exploratory change that is unrelated to memcache) is a bit much. Seeing as the test suite does pass without it installed, it can perhaps be skipped until really desired?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants