all.sh inconsistencies about generated files #188
Labels
No labels
approved
bug
dependencies
DO-NOT-MERGE
enhancement
good-first-issue
help-wanted
historical-reviewed
historical-reviewing
needs-adoption
needs-ci
needs-design-approval
needs-info
needs-preceding-pr
needs-review
needs-reviewer
needs-work
priority-high
priority-low
priority-medium
priority-scheduled
priority-very-high
single-reviewer
size-l
size-m
size-s
size-xs
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Mbed-TLS/mbedtls-framework#188
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
all.shstarts every component with the configuration-independent platform-independent generated files present in Mbed TLS (both 3.6 and 4.x), but not in TF-PSA-Crypto. This means that the same component code in the two repositories can have different effects. For example, in TF-PSA-Crypto,check_test_casesmisses the generated test cases, andcheck_namesmay miss some things (resulting in false positives or false negatives) if we forget to generate enough files.Cleanup before components does not remove generated files. Thus, in TF-PSa-Crypto, when we run a component locally, we may run it in a different state from the CI if we happen to have some generated test cases present. If in the future we group multiple components in the same node instantiation on the CI, components may run in a variable state (with or without generated files present).
Historically, when we first introduced generated files, not all builds could cope with them (at first only Make was supported but not CMake), so
all.shprepared the generated files. We've moved on from that, and now every build should be able to cope with a fresh checkout where the generated files are missing. (Builds should also cope with generated files being present, but that's usually not a problem.) However, some of the checks that don't do builds assume that the generated files are present.I'm not sure what the right thing is, but it should be consistent across repositories and invocation scenarios.
I believe the difference between Mbed TLS and TF-PSA-Crypto is due to the fact that, when we adapted all.sh for TF-PSA-Crypto, there was no equivalent of
make generated_files.Now that we have
make_generated_files.py, I would suggest aligning TF-PSA-Crypto with Mbed TLS in the short term.As for the longer term, I would lean toward reducing the component preparation and clean-up code: less all.sh code to maintain and a workflow that more closely matches local and manual testing.
How about, for the time being, aligning both projects to: start every
checkcomponent with generated files and others without? It's a bit too much magic to my taste, but would solve the minor bugs and friction (took me a while to understand why my check was failing) in crypto, while still checking that cmake builds of crypto work from a blank start.Yes that sounds a good compromise to me. My only concern is the potential issues when we stop generating files for test and build components in mbedtls.
I'll try it out, and consider always-generate as a plan B if either us or the CI turn out not to like it.
After trying this out, this just seems to be too much work to clean up.
HOST_CC=ccin the environment would work, I haven't tried it.)tests/libtestdriver1/library/Makefiletries to invoke../framework/exported.makewhich we aren't creating. This absolutely could be resolved by doing rewriting or copying more stuff, but I haven't gone further down this rabbit hole to see how much more would need to be changed.make && make testdoes not generatetests/opt-test/cases/*.sh, so we miss test coverage.cmake -DGEN_FILES=OFF. Sometimes it seems to be by design (to simulate a release) and sometimes I'm not sure. Where it's by design we need to runmake_generated_files.pyfirst.