diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d9a5a6b402..8ffdbfc050 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,11 @@ Changelog Next release -------------- +- Document the Apple Silicon (M1/M2/M3/M4) ``./configure --dev`` workaround + in ``CONTRIBUTING.rst`` for contributors using an arm64-only Homebrew + Python. + https://github.com/aboutcode-org/scancode-toolkit/issues/4650 + - Fix the optional ``licenses`` extra dependency typo to install ``licensedcode-data``. https://github.com/aboutcode-org/scancode-toolkit/pull/5056 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cba7beaf16..5a379285cf 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -140,6 +140,28 @@ To set up ScanCode for local development: configure --dev + If you are on Apple Silicon (M1/M2/M3/M4) and your ``python3`` is an + arm64-only Homebrew install, ``./configure --dev`` may fail with an + error such as:: + + ERROR: No matching distribution found for extractcode-7z==16.5.210531 + + This happens because some native thirdparty dependencies do not have + pre-built wheels for the arm64 architecture. ``configure`` already + relaunches itself under Rosetta on Apple Silicon, but this only helps + if the Python interpreter it finds is a universal or x86_64 binary; an + arm64-only Homebrew Python still runs natively and the pinned arm64-less + dependencies fail to resolve. To work around this, install an x86_64 + Python via Rosetta and point ``configure`` to it:: + + arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + arch -x86_64 /usr/local/bin/brew install python@3.12 + echo "/usr/local/bin/python3.12" > PYTHON_EXECUTABLE + ./configure --dev + + See `issue #3205 `_ + for more background on Apple Silicon compatibility. + Then activate the virtual environment:: source venv/bin/activate