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.34k stars 1.97k forks source link

[BUG] Failed to build cryptography #25508

Open olalonde opened 1 year ago

olalonde commented 1 year ago

Reproduction steps

I clone the repo and ran source scripts/bootstrap.sh on MacOS M1.

Relevant logs:

  build/temp.macosx-10.14.6-arm64-cpython-38/cryptography.hazmat.bindings._openssl.c:590:10: fatal error: 'openssl/opensslv.h' file not found
  #include <openssl/opensslv.h>
           ^~~~~~~~~~~~~~~~~~~~
  1 error generated.
  /private/var/folders/h_/17w4t45s5bdgm84gjtrj2vjm0000gn/T/pip-build-env-ie70p3oe/overlay/lib/python3.8/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'cryptography.hazmat.bindings._rust' as data is deprecated, please list it in `packages`.
      !!

bootstrap-log.txt

Bug prevalence

Whenever I do this

GitHub hash of the SDK that was being used

a7cc2cf3ca94693e0ba08578cc1365d4848890dd

Platform

darwin

Platform Version(s)

Darwin mbair 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101 arm64

Anything else?

No response

olalonde commented 1 year ago
brew link openssl --force

seems to fix the issue

bzbarsky-apple commented 1 year ago

That's pretty odd. @olalonde Why is bootstrap trying to compile rust stuff for you?

olalonde commented 1 year ago

I'm not sure. I do have Rust installed. I just tried bootstrapping again with a fresh repo checkout and hitting this bug again.

bzbarsky-apple commented 1 year ago

Do you have some sort of environment variables set that would affect what pigweed is doing? Because the other two bugs you filed also indicate that something very weird is going on with your bootstrap....

For what it's worth, I just tried doing a bootstrap without openssl linked (but installed, so that homebrew python can do https) on an M1 in a clean checkout and it worked fine.

olalonde commented 1 year ago

I can't see anything special. Here are my environment variables:

env.txt

I also tried to brew unlink openssl and check out from scratch again but still getting that openssl error.

$ python3 --version                                                                                                                                                                            master
Python 3.8.9
bzbarsky-apple commented 1 year ago

@mspang @kcoppock any idea what might be going on here?

olalonde commented 1 year ago

Not sure if that helps...

$ rustup show                                                                                                                                                                                  master
Default host: aarch64-apple-darwin
rustup home:  /Users/redacted/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin
nightly-2022-05-15-aarch64-apple-darwin
nightly-2022-10-25-aarch64-apple-darwin
nightly-aarch64-apple-darwin (default)
stage1

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
thumbv7em-none-eabihf

active toolchain
----------------

nightly-aarch64-apple-darwin (default)
rustc 1.68.0-nightly (333ee6c46 2023-01-18)
olalonde commented 1 year ago

I tried to brew install python and brew link --overwrite python@3.11 and bootstrap seemed to work now.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.