Closed snej closed 1 year ago
Tried using CMake option -DENABLE_TESTING=OFF
but I still hit the same error, albeit in a different way:
...
[ 7%] Generating version_features.c
[ 8%] Generating error.c
[ 8%] Generating psa_crypto_driver_wrappers.c
Traceback (most recent call last):
File "/Users/snej/Projects/coro/vendor/mbedtls/library/../scripts/generate_driver_wrappers.py", line 29, in <module>
import jsonschema
ModuleNotFoundError: No module named 'jsonschema'
Did you follow the instructions in README.md
?
The following tools are required:
* ...
* Python 3.8 and some Python packages, for some library source files, sample programs and test data. To install the necessary packages, run:
python3 -m pip install --user -r scripts/basic.requirements.txt
```
Depending on your Python installation, you may need to invoke `python` instead of `python3`. To install the packages system-wide, omit the `--user` option.
`jsonschema` is used to generate the PSA driver wrappers, part of the generated library source files
To build the library from a release, you only need a C toolchain and make. To build the library from git, you also need Python, jsonschema and jinja2.
By the way, we can make jsonschema optional with not much effort, but the dependency on jinja2 is another matter: we'd have to rewrite the driver wrapper code. Removing the dependency on python is not realistic.
Summary
Just cloned the repo and am trying to build; as the README says, "Mbed TLS should build out of the box”. Nope; the usual CMake build fails very quickly for lack of what appear to be a Python module.
From some other related issues I gather that the Python stuff is just for testing. If that’s true, maybe the default build should not be building the tests? I don’t need to run tests, I just want to use the library.
System information
Mbed TLS version (number or commit id): Commit 41d689f, default branch from Github Operating system and version: macOS 13.4.1 Configuration (if not default, please attach
mbedtls_config.h
): Compiler and options (if you used a pre-built binary, please indicate how you obtained it): Apple Clang from Xcode 15; CMake 3.27.0 Additional environment information:Expected behavior
I can run
mkdir build && cd build && cmake --build .
to build out-of-the-box.Actual behavior
Steps to reproduce
git clone --recursive https://github.com/Mbed-TLS/mbedtls.git mbedtls
cd mbedtls
mkdir build && cd build && cmake --build .