connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

[Build] [Python] Cannot finish activate.sh

Open angus19 opened this issue 1 year ago • 1 comments

Reproduction steps

Step-by-step commands as follows.

  • git clone https://github.com/project-chip/connectedhomeip.git
  • cd connectedhomeip && git checkout 181b0cb
  • git submodule update --init
  • source scripts/activate.sh

Please check attached log for more details about failing of source scripts/activate.sh. matter_console.log

Bug prevalence

Every time

GitHub hash of the SDK that was being used

181b0cb

Platform

other

Platform Version(s)

Ubuntu 22.04.3 LTS

Type

Platform Issue

Anything else?

Wipe original hard drive before installing a brand new Ubuntu (22.04.3 LTS). Follow the build guide to set up a build environment and start a build by referring to the link below.

  • https://project-chip.github.io/connectedhomeip-doc/guides/BUILDING.html#build-for-the-host-os-linux-or-macos

Launch source scripts/activate.sh and an Assertion failed with related exception or traceback messages come out...

Setting up Python environment.....[] ERROR at /home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_build/facade.gni:187:7: Assertion failed. assert(_dep_is_in_link_dependencies, ^----- /home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_log:impl must be listed in the pw_build_LINK_DEPS build arg when the /home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_log:pw_log facade is in use. Please update your toolchain configuration. See /home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_log/BUILD.gn:47:1: whence it was called. pw_facade("pw_log") { ^-------------------- See /home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/BUILD.gn:50:5: which caused the file to be included. "$dir_pw_log:protos.python", ^-------------------------- ['gn', 'gen', '/home/angus/projects/connectedhomeip/.environment/gn_out', '--args=chip_crypto="boringssl" dir_pigweed="/home/angus/projects/connectedhomeip/third_party/pigweed/repo"']

Traceback (most recent call last): File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 402, in install_packages subprocess.check_call( File "/usr/lib/python3.10/subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['gn', 'gen', '/home/angus/projects/connectedhomeip/.environment/gn_out', '--args=chip_crypto="boringssl" dir_pigweed="/home/angus/projects/connectedhomeip/third_party/pigweed/repo"']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 995, in sys.exit(main()) File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 987, in main return EnvSetup(**vars(parse())).setup() File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 577, in setup result = step(spin) File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 766, in virtualenv if not virtualenv_setup.install( File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 443, in install install_packages(gn_target) File "/home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 410, in install_packages raise subprocess.CalledProcessError( subprocess.CalledProcessError: Command '['gn', 'gen', '/home/angus/projects/connectedhomeip/.environment/gn_out', '--args=chip_crypto="boringssl" dir_pigweed="/home/angus/projects/connectedhomeip/third_party/pigweed/repo"']' returned non-zero exit status 1. ... ...

Is there still anything missing in my Python configuration? Thanks for comments if any. -Angus

angus19 avatar Feb 02 '24 03:02 angus19

+1

atmychen avatar Feb 16 '24 07:02 atmychen

+1

Same hash (which happens to be tag: v1.2.0.1), same OS, same error log.

FWIW, I checked the current tip (177d875707b4ff70b298ae356857ed4bf4f18b59) and it is still broken.

dt-atmosic avatar Feb 28 '24 04:02 dt-atmosic

gn is tripping over system-absolute vs. source-absolute pathnames in the facade.gni assert. If you hack pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py to use a source-absolute pathname for pw_root (literally "//third_party/pigweed/repo"), bootstrap and activate can finish.

dt-atmosic avatar Mar 02 '24 00:03 dt-atmosic

@angus19 check to see if there is a difference between pwd and realpath . in your environment. I was able to get past this issue by making those identical: % cd $(realpath .)

dt-atmosic avatar Mar 02 '24 02:03 dt-atmosic

+1

GnarFang avatar Mar 20 '24 10:03 GnarFang

Could you try:

git submodule update -f --init --recursive

for the submodule update and then try the bootstrap again?

andy31415 avatar Apr 11 '24 13:04 andy31415

@dt-atmosic Thank you for figuring out what the issue is! Fix (or at least workaround) coming up.

bzbarsky-apple avatar Apr 11 '24 14:04 bzbarsky-apple

This sounds like something that should be fixed on the Pigweed side, has an issue been opened there yet?

ksperling-apple avatar Apr 11 '24 21:04 ksperling-apple