project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.48k stars 2.01k forks source link

[Build] Bootstraph.sh fails with pip building PyYAML #32589

Closed mringwal closed 6 months ago

mringwal commented 7 months ago

Build issue(s)

Trying to build master (15866ed085e07e03b0e564cf41f4932b3f71b5b5)

Clone, git submodules and run source scripts/bootstrap.sh

Get the error:

[511/1099] python3 ../../third_party/pigweed/repo/pw_build/py/pw_build/python_runner.py --gn-root ../../ --current-path ../.. --default-toolchain=//build/toolchain/host:mac_arm64_gcc --current-toolchain=//third_party/pigweed/repo/pw_build/python_toolchain:python --capture-output --module piptools --python-virtualenv-config python/gen/matter_build_venv/venv_metadata.json --python-dep-list-files python/gen/matter_build_venv._compile_requirements_metadata_path_list.txt -- compile --resolver=backtracking --allow-unsafe --output-file python/gen/matter_build_venv/compiled_requirements.txt python/gen/matter_build_venv/generated_requirements.txt ../../scripts/setup/requirements.build.txt FAILED: python/gen/matter_build_venv/compiled_requirements.txt

Full log: buildlog-mac.txt

Platform

darwin

Anything else?

Running macOS 14.4 with current Xcode This is the first time I try to setup matter for macOS, but used esp-matter before. I've deleted ./environment before

mringwal commented 7 months ago

Trying on other systems gave some insight - on a similar Mac but without Python 3.12 from Homebrew, bootstrap succeeded.

Going back to my system, I was able to complete the bootstrap by temporarily disabling Homebrew (skipping opt/homebrew/bin/brew shellenv). After bootstrap succeeded, compiling the all-clusters example worked eve with Homebrew enabled again.

Please test if you can bootstrap with Python3 from up-to-date Homebrew. I'm happy to dig out more details about my system if this doesn't happen on other systems.

musachy commented 7 months ago

I ran into the same problem and can confirm that not using homebrew pip/python works. Using M2.

noahp commented 6 months ago

This patch does it, I'll open a PR:

diff --git a/scripts/setup/constraints.txt b/scripts/setup/constraints.txt
index b0e9aed4ae..2f91fa14e2 100644
--- a/scripts/setup/constraints.txt
+++ b/scripts/setup/constraints.txt
@@ -49,7 +49,7 @@ colorama==0.4.6
     #   west
 coloredlogs==15.0.1
     # via -r requirements.all.txt
-construct==2.10.54
+construct==2.10.70
     # via
     #   -r requirements.esp32.txt
     #   esp-coredump
@@ -163,7 +163,7 @@ portpicker==1.5.2
     # via
     #   -r requirements.all.txt
     #   mobly
-prompt-toolkit==3.0.38
+prompt-toolkit==3.0.43
     # via ipython
 protobuf==4.24.4
     # via
@@ -208,7 +208,7 @@ python-socketio==4.6.1
     # via -r requirements.esp32.txt
 pytz==2022.7.1
     # via pandas
-pyyaml==6.0
+pyyaml==6.0.1
     # via
     #   esptool
     #   idf-component-manager
mringwal commented 6 months ago

@noahp Thanks!