Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Declare framework-internal dependencies in the framework #110

Open
gilles-peskine-arm opened this issue Jan 2, 2025 · 0 comments
Open

Comments

@gilles-peskine-arm
Copy link
Contributor

The build scripts in Mbed TLS and TF-PSA-Crypto call several scripts from the framework, and need to know the dependencies of those scripts (data files and auxiliary Python modules). Currently, those dependencies are recorded in **/Makefile and **/CMakeLists.txt in the consuming repositories. Since the dependencies result from code in the framework, we should declare them in the framework repository.

The test data generators all follow the pattern that framework/scripts/generate_xxx_tests.py --list prints the list of output files (and there's --list-for-cmake to produce the same list in a CMake-friendly format). We should expand that, or add another option, to list the dependencies.

The dependencies can include:

  • Data files (presumably from framework/data_files) referenced in the script.
  • Python modules from framework/scripts/mbedtls_framework — maybe we can find those automatically using Python introspection?
  • Source code (e.g. crypto_config.h) read by the script.

An example of where this would have been useful is #83, which required an awkward dance to keep the build scripts working:

  1. In the framework, create a Python module psa_test_case.py.
  2. In consuming branches, add psa_test_case.py as a dependency when running generate_psa_tests.py.
  3. In the framework, start using psa_test_case.py in generate_psa_tests.py.
  4. Update consuming branches with the updated generate_psa_tests.py.

The back-and-forth due to steps 1 and 2 complicate the history of framework updates, which is a pain in itself in the best of cases. We wouldn't need steps 1 and 2 if the framework was the authority for its own dependencies.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant