Closed PiotrBzdrega closed 9 months ago
Hi,
Thanks for reporting!
In fact, this is a known issue. All of these files are generated by scripts which do not work on Windows. As you have discovered, the fix for this is to copy the generated files from a release.
Hi,
Thanks for reporting!
In fact, this is a known issue. All of these files are generated by scripts which do not work on Windows. As you have discovered, the fix for this is to copy the generated files from a release.
Thank you for feedback. I checked yet for Ubuntu 22.04.3 LTS and looks smooth. I had to only install additionally jsonschema and jinja2 to run those scripts, but except that like you mentioned it works.
jsonschema:
admin1@k21049859:/home/git$ git clone https://github.com/Mbed-TLS/mbedtls.git
Cloning into 'mbedtls'...
remote: Enumerating objects: 238817, done.
remote: Total 238817 (delta 0), reused 0 (delta 0), pack-reused 238817
Receiving objects: 100% (238817/238817), 114.39 MiB | 10.98 MiB/s, done.
Resolving deltas: 100% (186387/186387), done.
admin1@k21049859:/home/git$ cd mbedtls/
admin1@k21049859:/home/git/mbedtls$ mkdir build
admin1@k21049859:/home/git/mbedtls$ cd build/
admin1@k21049859:/home/git/mbedtls/build$ cmake --build .
[ 0%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/asn1_helpers.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/bignum_helpers.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/certs.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/hash.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/platform_builtin_keys.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_aead.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_asymmetric_encryption.c.o
[ 1%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_cipher.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_key_agreement.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_key_management.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_mac.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_pake.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/drivers/test_driver_signature.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/fake_external_rng_for_test.c.o
[ 2%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/helpers.c.o
[ 3%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/psa_crypto_helpers.c.o
[ 3%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/psa_exercise_key.c.o
[ 3%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/random.c.o
[ 3%] Building C object CMakeFiles/mbedtls_test.dir/tests/src/threading_helpers.c.o
[ 3%] Built target mbedtls_test
[ 3%] Building C object CMakeFiles/mbedtls_test_helpers.dir/tests/src/test_helpers/ssl_helpers.c.o
[ 3%] Built target mbedtls_test_helpers
[ 3%] Building C object 3rdparty/everest/CMakeFiles/everest.dir/library/everest.c.o
[ 3%] Building C object 3rdparty/everest/CMakeFiles/everest.dir/library/x25519.c.o
[ 4%] Building C object 3rdparty/everest/CMakeFiles/everest.dir/library/Hacl_Curve25519_joined.c.o
[ 4%] Linking C static library libeverest.a
[ 4%] Built target everest
[ 4%] Building C object 3rdparty/p256-m/CMakeFiles/p256m.dir/p256-m_driver_entrypoints.c.o
[ 4%] Building C object 3rdparty/p256-m/CMakeFiles/p256m.dir/p256-m/p256-m.c.o
[ 4%] Linking C static library libp256m.a
[ 4%] Built target p256m
[ 5%] Generating version_features.c
[ 5%] Generating error.c
[ 5%] Generating psa_crypto_driver_wrappers.h, psa_crypto_driver_wrappers_no_static.c
Traceback (most recent call last):
File "/home/git/mbedtls/library/../scripts/generate_driver_wrappers.py", line 18, in <module>
import jsonschema
ModuleNotFoundError: No module named 'jsonschema'
gmake[2]: *** [library/CMakeFiles/mbedcrypto.dir/build.make:155: library/psa_crypto_driver_wrappers.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:957: library/CMakeFiles/mbedcrypto.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
jinja2:
admin1@k21049859:/home/git/mbedtls/build$ cmake --build .
Consolidate compiler generated dependencies of target mbedtls_test
[ 3%] Built target mbedtls_test
Consolidate compiler generated dependencies of target mbedtls_test_helpers
[ 3%] Built target mbedtls_test_helpers
Consolidate compiler generated dependencies of target everest
[ 4%] Built target everest
Consolidate compiler generated dependencies of target p256m
[ 4%] Built target p256m
[ 4%] Generating psa_crypto_driver_wrappers.h, psa_crypto_driver_wrappers_no_static.c
Traceback (most recent call last):
File "/home/git/mbedtls/library/../scripts/generate_driver_wrappers.py", line 19, in <module>
import jinja2
ModuleNotFoundError: No module named 'jinja2'
gmake[2]: *** [library/CMakeFiles/mbedcrypto.dir/build.make:155: library/psa_crypto_driver_wrappers.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:957: library/CMakeFiles/mbedcrypto.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Note that these files can be generated on Windows, by running
scripts\make_generated_files.bat
as documented in the README.md section Generated source files in the development branch.
The README file also mentions the Python requirements:
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
Summary
Looks like some files are missing, I copied them from release v3.5.2 and everything was then fine.
Missing files:
System information
Mbed TLS version (number or commit id): development commit: c3d17cd Operating system and version: Windows10 22H2 (Build 19045.3930)
Steps to reproduce