Skip to content

Conversation

gilles-peskine-arm
Copy link
Contributor

Make the behavior of all.sh with respect to generated files at the beginning of a component:

  • consistent across repositories;
  • independent of the initial content of the working directory;
  • dependent on the component: present for check_xxx (where their absence can lead to a failure or silent loss of test coverage), and absent for builds and tests (where we expect the build scripts to generate them as needed).

Fix #188

No change needed in consuming branches (to be confirmed by the CI), but there are a couple of things to clean up in TF-PSA-Crypto.

PR checklist

Please add the numbers (or links) of the associated pull requests for consuming branches. You can omit branches where this pull request is not needed.

  • TF-PSA-Crypto PR
  • development PR provided # | not required because:
  • 3.6 PR provided # | not required because:

@gilles-peskine-arm gilles-peskine-arm added bug Something isn't working needs-ci Needs to pass CI tests labels Jul 18, 2025
@gilles-peskine-arm gilles-peskine-arm added priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Jul 18, 2025
Clean generated files. In Mbed TLS, `make neat`. is equivalent to
`make clean; framework/scripts/make_generated_files.py --clean`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Whether a component started with configuration-independent
platform-independent generated files present or not depended on the
repository and on the state of the working directory:

* In TF-PSA-Crypto, we started with whatever generated files were present
  before invoking the script, and didn't touch them between components.
* In Mbed TLS, we always started with generated files present (for
  subsequent components, only if they hadn't been messed up).

After this change, the behavior is the same across repositories and doesn't
depend on the initial state of the working directory:

* `check_xxx` components start with the generated files present. This is
  either indifferent or necessary depending on the component. (Without
  generated files, some components such as `check_names` fail, while others
  such as `check_test_cases` miss stuff that they should check.)
* Other components (`build_xxx`, `test_xxx`, etc.) start with the generated
  files absent. This is generally desirable so that we test that the build
  scripts generate them as needed.

Fix Mbed-TLS#188

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This is needed for cross-compilation because some scripts to generate
generated files compile and execute a C program, and our scripts aren't set
up to use a different compiler than the one we cross-compile with.

Do this for all build components. It's not ideal but not harmful, and it's
easier than figuring out exactly which build components are problematic.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
We need this because `library/Makefile` and `libtestdriver1_rewrite.pl`
don't set things up properly in `tests/libtestdriver1/library`. The visible
symptom is that when not all generated files are present, the makefile looks
for `../framework/exported.make` which is not present. I have not gone down
this rabbit hole to see how much effort it would be to make it work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm gilles-peskine-arm force-pushed the all.sh-generate-only-before-checks-framework branch from 84fe3f0 to 876b270 Compare July 23, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-ci Needs to pass CI tests priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)
Projects
Status: In Development
Development

Successfully merging this pull request may close these issues.

all.sh inconsistencies about generated files
1 participant