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 error - missing pigweed libc++.a (M1 Ventura 13.1) #24609

Closed
zcduthie opened this issue Jan 24, 2023 · 6 comments · Fixed by #24927
Closed

[BUG] Build error - missing pigweed libc++.a (M1 Ventura 13.1) #24609

zcduthie opened this issue Jan 24, 2023 · 6 comments · Fixed by #24927

Comments

@zcduthie
Copy link

zcduthie commented Jan 24, 2023

Reproduction steps

Attempting to build both all-clusters-app for darwin arm64 and ./gn_build.sh produce the same error.
clang: error: no such file or directory: '../../.environment/cipd/packages/pigweed/lib/libc++.a'
(full logs attached below)

Fresh checkout/setup and:

cd ~/connectedhomeip
source scripts/activate.sh
./gn_build.sh

gn_build.log

This does not occur when targeting a different (non-mac) architecture. Can successfully build Android CHIP Tool via ./scripts/build/build_examples.py --target android-arm64-chip-tool build

Bug prevalence

Whenever I do this

GitHub hash of the SDK that was being used

ca086f2

Platform

darwin

Platform Version(s)

Apple M1, Ventura 13.1

Anything else?

The entire lib folder is missing from .environment/cipd/packages/pigweed/

Various attempts at different versions of the SDK, pigweed, force removing .environment and re-bootstrapping haven't been able to fix / generate it.

pw_doctor.log

@bzbarsky-apple
Copy link
Contributor

Pigweed does not provide an ARM toolchain for M1/M2 macs, as far as I can tell.

The default "./gn_build.sh" tries to build things with multiple compilers, including this non-existent toolchain, for some of the tests it runs.

I think passing enable_host_clang_boringssl_crypto_tests=false to ./gn_build.sh might help work around that...

@andy31415

@zcduthie
Copy link
Author

Thanks - looks like that must be the culprit.

I originally came across this issue following the instructions at https://github.com/project-chip/connectedhomeip/tree/master/examples/all-clusters-app/linux:

To compile on an Arm Mac, run:
$ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target darwin-arm64-all-clusters-no-ble-asan-clang build"

Does this mean darwin-arm64 targeted scripts won't currently work?

@bzbarsky-apple
Copy link
Contributor

This should work:

$ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target darwin-arm64-all-clusters-no-ble-asan build"

(i.e. without the "-clang" suffix). That suffix means "use pigweed clang instead of the system one" on Mac, as far as I can tell, and on M1 there is no pigweed clang.....

@bzbarsky-apple
Copy link
Contributor

(And we should either fix the script to work or fix the documentation or both....)

@zcduthie
Copy link
Author

zcduthie commented Feb 1, 2023

$ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target darwin-arm64-all-clusters-no-ble-asan build"

Can confirm that this worked for me.

@bzbarsky-apple
Copy link
Contributor

I created #24775 to fix the documentation for now.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 8, 2023
There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip#24609
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 8, 2023
There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip#24609
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 8, 2023
There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip#24609
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 8, 2023
There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip#24609
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 10, 2023
There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip#24609
bzbarsky-apple added a commit that referenced this issue Feb 10, 2023
* Fix default gn_build.sh on M1/M2 macs.

There is no "host clang" (i.e. pigweed clang) there.

Fixes #24609

* Address review comment.

* Fix k32w timeout.
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
* Fix default gn_build.sh on M1/M2 macs.

There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip/connectedhomeip#24609

* Address review comment.

* Fix k32w timeout.
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
* Fix default gn_build.sh on M1/M2 macs.

There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip/connectedhomeip#24609

* Address review comment.

* Fix k32w timeout.
lecndav pushed a commit to lecndav/connectedhomeip that referenced this issue Mar 22, 2023
* Fix default gn_build.sh on M1/M2 macs.

There is no "host clang" (i.e. pigweed clang) there.

Fixes project-chip#24609

* Address review comment.

* Fix k32w timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants