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] Build Python fails due to Zap Generation on Raspberry Pi (no ARM based version of zap-cli available) #24718

Closed
oidebrett opened this issue Jan 28, 2023 · 6 comments
Assignees

Comments

@oidebrett
Copy link
Contributor

oidebrett commented Jan 28, 2023

Reproduction steps

  • Clone latest master branch of repo:
  • git submodule update --init
  • run scripts/build_python.sh -m platform -i separate

Result: FAILED TO EXECUTE ZAP GENERATION

Error suggests:

There is no compatible version of /zap/releases for ARM based architecture (i.e. Rasp Pi 4B+)

Can ZAP generation be skipped as we only require the python libraries so I can use chip-repl on the Rasp Pi? we would rather not have to download npm etc on the Rasp Pi just to get the ZAP-cli working. There was no previous dependency on zap-cli when running chip-repl previously.

Bug prevalence

When building for Python platform on Raspberry Pi

GitHub hash of the SDK that was being used

master

Platform

raspi

Platform Version(s)

master

Anything else?

No response

@bzbarsky-apple
Copy link
Contributor

@oidebrett You should be able to do the pre-generation thing docs/code_generation.md describes, if the error is clear enough about which exact codegen bits you need.

Can ZAP generation be skipped as we only require the python libraries

Those libraries depend on some generated things, right now.

Also note project-chip/zap#897 but that does not help you for the moment.

@bzbarsky-apple
Copy link
Contributor

And see also #24588 (comment)

@zhouchunli
Copy link

same problem

@oidebrett
Copy link
Contributor Author

I've created a PR to provide a fix for this. Allowing pregenerated files in python build #24752. Hopefully I followed the correct procedures for creating a PR.

@oidebrett
Copy link
Contributor Author

Just to add that I tested the modified build_python.sh script as follows:

I pre-generated the files on a Ubuntu system that has zap-cli using
scripts/codepregen.py ${OUTPUT_DIRECTORY:-./zzz_pregenerated/}

I then transferred the zzz_pregenerated folder to the raspberry pi and ran
scripts/build_python.sh -m platform -i separate -z ./zzz_pregenerated/

That worked and built the python environment without the need for the zap-cli tool installed on the raspberry pi

bzbarsky-apple pushed a commit that referenced this issue Feb 2, 2023
* checking that we can commit

* checking that we can commit by deleting file that was added

* modified build_python.sh to take argument to use pregenerated files as per issues - Build Python fails due to Zap Generation on Raspberry Pi (no ARM based version of zap-cli available) #24718

* Updated matter guide explaining how to use additional args for pregenerated code

* fixed misspelling of Raspberry as picked up by reviewdog in CI tests

* updated guide to state which things need to be pregenerated

* added more information to the matter-repl.md file on pregeneration

* fixed spelling mistakes such as pregeneration, pregenerated, pregen

* patched with what the restyler is suggesting

* Restyled by prettier-markdown

---------

Co-authored-by: oidebrett <[email protected]>
Co-authored-by: oidebrett <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
@oidebrett
Copy link
Contributor Author

This can be resolved by building for arm64 eg. for raspberry pi

A new argument has been added to the build_python.sh to allow the use of pre-generated files.

e.g. scripts/build_python.sh -m platform -i separate -z ./zzz_pregenerated/

lecndav pushed a commit to lecndav/connectedhomeip that referenced this issue Mar 22, 2023
* checking that we can commit

* checking that we can commit by deleting file that was added

* modified build_python.sh to take argument to use pregenerated files as per issues - Build Python fails due to Zap Generation on Raspberry Pi (no ARM based version of zap-cli available) project-chip#24718

* Updated matter guide explaining how to use additional args for pregenerated code

* fixed misspelling of Raspberry as picked up by reviewdog in CI tests

* updated guide to state which things need to be pregenerated

* added more information to the matter-repl.md file on pregeneration

* fixed spelling mistakes such as pregeneration, pregenerated, pregen

* patched with what the restyler is suggesting

* Restyled by prettier-markdown

---------

Co-authored-by: oidebrett <[email protected]>
Co-authored-by: oidebrett <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
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

No branches or pull requests

4 participants