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

[BUG] Docker build failing on TOT master #23869

Closed
raju-apple opened this issue Dec 2, 2022 · 1 comment · Fixed by #23874
Closed

[BUG] Docker build failing on TOT master #23869

raju-apple opened this issue Dec 2, 2022 · 1 comment · Fixed by #23874

Comments

@raju-apple
Copy link
Contributor

Reproduction steps

Running this command on TOT master to create a docker image for Test Harness :

SHA : 21245f42393e63dbb16fb4d99d8bf96aef7ae0fc

Running this command from connectedhomeip/integrations/docker/images/chip-cert-bins:
 
docker buildx build --build-arg COMMITHASH=21245f42393e63dbb16fb4d99d8bf96aef7ae0fc --platform linux/arm64 --tag connectedhomeip/chip-cert-bins:21245f42393e63dbb16fb4d99d8bf96aef7ae0fc --push .


Failing at this spot : 

#0 0.274 [48/1984] ACTION //examples/all-clusters-app/all-clusters-common:all-clusters-common_codegen_codegen(//build/toolchain/linux:linux_arm64_gcc)
#0 0.274 FAILED: gen/examples/all-clusters-app/all-clusters-common/app/PluginApplicationCallbacks.h gen/examples/all-clusters-app/all-clusters-common/app/callback-stub.cpp 
#0 0.274 python3 ../../third_party/pigweed/repo/pw_build/py/pw_build/python_runner.py --gn-root ../../ --current-path ../../examples/all-clusters-app/all-clusters-common --default-toolchain=//build/toolchain/linux:linux_arm64_gcc --current-toolchain=//build/toolchain/linux:linux_arm64_gcc --capture-output --python-dep-list-files gen/examples/all-clusters-app/all-clusters-common/all-clusters-common_codegen_codegen_metadata_path_list.txt -- ../../scripts/codegen.py --generator cpp-app --output-dir gen/examples/all-clusters-app/all-clusters-common --expected-outputs gen/examples/all-clusters-app/all-clusters-common/all-clusters-common_codegen.expected.outputs ../../examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
#0 0.274 Traceback (most recent call last):
#0 0.274   File "/root/connectedhomeip/out/debug/../../scripts/codegen.py", line 28, in <module>
#0 0.274     from idl.matter_idl_parser import CreateParser
#0 0.274   File "/root/connectedhomeip/scripts/idl/matter_idl_parser.py", line 7, in <module>
#0 0.274     from lark import Lark
#0 0.274 ModuleNotFoundError: No module named 'lark'
#0 0.274 
#0 0.274 During handling of the above exception, another exception occurred:
#0 0.274 
#0 0.274 Traceback (most recent call last):
#0 0.274   File "/root/connectedhomeip/out/debug/../../scripts/codegen.py", line 32, in <module>
#0 0.274     from idl.matter_idl_parser import CreateParser
#0 0.274   File "/root/connectedhomeip/scripts/idl/matter_idl_parser.py", line 7, in <module>
#0 0.274     from lark import Lark
#0 0.274 ModuleNotFoundError: No module named 'lark'
#0 0.280 [49/1984] ACTION //src/app/tests:TestEventLogging_generate_driver(//build/toolchain/linux:linux_arm64_gcc)
#0 0.283 [50/1984] ACTION //src/app/tests:TestInteractionModelEngine_generate_driver(//build/toolchain/linux:linux_arm64_gcc)
#0 0.283 [51/1984] ACTION //src/app/tests:TestEventPathParams_generate_driver(//build/toolchain/linux:linux_arm64_gcc)
#0 0.292 [52/1984] ACTION //src/controller/tests:TestEventCaching_generate_driver(//build/toolchain/linux:linux_arm64_gcc)
#0 0.293 [53/1984] ACTION //src/app/tests:TestFabricScopedEventLogging_generate_driver(//build/toolchain/linux:linux_arm64_gcc)
#0 0.293 ninja: build stopped: subcommand failed.
------
Dockerfile:191
--------------------
 189 |     RUN scripts/build/gn_bootstrap.sh
 190 |     RUN gn gen out/debug --args='chip_mdns="platform" chip_inet_config_enable_ipv4=false'
 191 | >>> RUN ninja -C out/debug
 192 |     
 193 |     # Stage 2: Build.
--------------------
ERROR: failed to solve: process "/bin/sh -c ninja -C out/debug" did not complete successfully: exit code: 1

Bug prevalence

Happens every time

GitHub hash of the SDK that was being used

21245f4

Platform

raspi

Platform Version(s)

No response

Anything else?

docker_logs_failure.zip

@andy31415
Copy link
Contributor

The code looks like:

RUN scripts/build/gn_bootstrap.sh
RUN gn gen out/debug --args='chip_mdns="platform" chip_inet_config_enable_ipv4=false'
RUN ninja -C out/debug

these are separate invocations so you are NOT running the gn gen and ninja in a chip build environment (i.e. activate.sh is not run).

You should probably have things like source scripts/activate.sh && gn gen out/debug ....

andy31415 added a commit to andy31415/connectedhomeip that referenced this issue Dec 2, 2022
andy31415 added a commit that referenced this issue Dec 2, 2022
* Run cert bins compilation as a single run to preserve build environment

* Need to also checkout submodules for builds to work

* Update to the SHA inside #23869

* Re-create the npm CI logic since the repo SHA is pinned in certbins

* make checkout and bootstrap separate layers, so they can be re-run separately. Checkout and bootstrap is slow.

* update shell to bash to allow for source usage

* Correct naming: in the image version I have, name of the app is without minimal

* Remove minimal all clusters app build because build-examples script is buggy in the given version

* Replace tabs with spaces

* Install zap to make sure builds work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants