Skip to content

Declare framework-internal dependencies in the framework #110

@gilles-peskine-arm

Description

@gilles-peskine-arm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions