Complete the move of driver wrappers to the dispatch/ directory #809
Open
asmellby wants to merge 16 commits from
asmellby/feature/dispatch-library into development
pull from: asmellby/feature/dispatch-library
merge into: gh-Mbed-TLS:development
gh-Mbed-TLS:development
gh-Mbed-TLS:tf-psa-crypto-1.1
gh-Mbed-TLS:archive/20261005T153337Z-force/pull/927
gh-Mbed-TLS:archive/20261001T141055Z-force/pull/927
gh-Mbed-TLS:archive/20261005T153337Z-force/pull/931
gh-Mbed-TLS:archive/20261001T083616Z-force/pull/927
gh-Mbed-TLS:archive/20260930T232327Z-force/pull/927
gh-Mbed-TLS:archive/20260930T154618Z-force/pull/927
gh-Mbed-TLS:archive/20260929T231919Z-rescue/rohankl-arm/mldsa-pubkey-899
gh-Mbed-TLS:archive/20260929T231919Z-rescue/sigvartmh/pr/spake2p-9342-public-key-import-export
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ManoharPaturi/fix-pem-ct-padding
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ManoharPaturi/fix-asn1write-null-guard
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ManoharPaturi/fix-pbes2-params-validation
gh-Mbed-TLS:archive/20260929T231919Z-rescue/valeriosetti/blake2
gh-Mbed-TLS:archive/20260929T231919Z-rescue/jfdev001/v1.1.1_bump-cmake-minimum-version
gh-Mbed-TLS:archive/20260929T231919Z-rescue/jfdev001/bump-cmake-minimum-version
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ronald-cron-arm/sm3-base
gh-Mbed-TLS:archive/20260929T231919Z-rescue/valeriosetti/blake2-hmac
gh-Mbed-TLS:archive/20260929T231919Z-rescue/v1rtu3x/enforce-hash-length-sign-verify
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/file-backed-keystore-doc
gh-Mbed-TLS:archive/20260929T231919Z-rescue/sigvartmh/pr/spake2p-9344-set-context
gh-Mbed-TLS:archive/20260929T231919Z-rescue/sigvartmh/pr/spake2p-9343-key-pair-import-export-depends-on-9342
gh-Mbed-TLS:archive/20260929T231919Z-rescue/romart/development
gh-Mbed-TLS:archive/20260929T231919Z-rescue/sweetlilmre/constant-time-embedded-perf
gh-Mbed-TLS:archive/20260929T231919Z-rescue/JulioLoayzaM/add-wycheproof-rsa-pss
gh-Mbed-TLS:archive/20260929T231919Z-rescue/JulioLoayzaM/add-wycheproof-ecdsa
gh-Mbed-TLS:archive/20260929T231919Z-rescue/JulioLoayzaM/add-wycheproof-tests
gh-Mbed-TLS:archive/20260929T231919Z-rescue/oubaid-a/dev_psa_driver_wrapper
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/keystoreless-prototype-1
gh-Mbed-TLS:archive/20260929T231919Z-rescue/valeriosetti/issue9580
gh-Mbed-TLS:archive/20260929T231919Z-rescue/LeonieReichertABB/hpke-functionality
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/psa-hash-no-buffer-copy-1.1
gh-Mbed-TLS:archive/20260929T231919Z-rescue/vanhauser-thc/development
gh-Mbed-TLS:archive/20260929T231919Z-rescue/tpambor/key-wrap
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ruiliio/psa_xts
gh-Mbed-TLS:archive/20261011T063515Z-force/pull/538
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/fix-broken-links-1.1
gh-Mbed-TLS:archive/20260929T231919Z-rescue/valeriosetti/issue669
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/prepare-release-test
gh-Mbed-TLS:archive/20260929T231919Z-rescue/krish2718/wpa3-sae-design-note
gh-Mbed-TLS:archive/20260929T231919Z-rescue/nzzlinh/fix_iar_endianness_1.1
gh-Mbed-TLS:archive/20260929T231919Z-rescue/nzzlinh/fix-iar-endianness
gh-Mbed-TLS:archive/20260929T231919Z-rescue/abtom87/fix-pbkdf2-iter-count
gh-Mbed-TLS:archive/20260929T231919Z-rescue/minosgalanakis/tools/prepare_release_lite
gh-Mbed-TLS:archive/20260929T231919Z-rescue/Harshal5/fix/aes-xts-in-place-cts
gh-Mbed-TLS:archive/20260929T231919Z-rescue/sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344
gh-Mbed-TLS:archive/20260929T231919Z-rescue/crabel99/async-hardware-support-c35df962
gh-Mbed-TLS:tf-psa-crypto-1.2.0_mergeback
gh-Mbed-TLS:tf-psa-crypto-1.1.1_mergeback
gh-Mbed-TLS:archive/20260929T231919Z-rescue/asmellby/feature/dispatch-library
gh-Mbed-TLS:tf-psa-crypto-release-sync
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ChakshuGupta13/fix/ecdsa-zeroize-stack-key
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/security-md-option-names
gh-Mbed-TLS:archive/20260929T231919Z-rescue/parmi93/patch-2
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/remove-mldsa-sign-from-build
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/tf-m-build-issues
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/test-context-population
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/iar-1.1.0
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/fork-helper-unit-tests-create-crypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/redundant-declarations
gh-Mbed-TLS:archive/20260929T231919Z-rescue/hasheddan/docs/fix-broken-links
gh-Mbed-TLS:main
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/reintroduce-dh
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/cipher-update-incorrect-error
gh-Mbed-TLS:archive/20260929T231919Z-rescue/Marandil/fix/mbedtls-4314-parse-explicit-curve
gh-Mbed-TLS:archive/20260929T231919Z-rescue/schneider-electric/dev/plaj-se/parse-rsassa-pss
gh-Mbed-TLS:archive/20260929T231919Z-rescue/minosgalanakis/bugfix/program-fuzz-mscv
gh-Mbed-TLS:archive/20260929T231919Z-rescue/daverodgman/aesgcm
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/sha3-coverity-20260224
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bensze01/undef
gh-Mbed-TLS:archive/20260929T231919Z-rescue/valeriosetti/issue523
gh-Mbed-TLS:archive/20260929T231919Z-rescue/dannytsen/ppc-dev
gh-Mbed-TLS:archive/20260929T231919Z-rescue/daverodgman/aes12
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/ascon-prototype
gh-Mbed-TLS:archive/20260929T231919Z-rescue/daverodgman/chacha10
gh-Mbed-TLS:archive/20260929T231919Z-rescue/kusumitg/implement_psa_pake_set_context_for_spake2p
gh-Mbed-TLS:archive/20260929T231919Z-rescue/davidhorstmann-arm/add-code-size-target
gh-Mbed-TLS:archive/20260929T231919Z-rescue/bjwtaylor/simplify-sign_func
gh-Mbed-TLS:archive/20260929T231919Z-rescue/mfil/feature/aes_ni_parallel
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ivv19041994/patch-1
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/psa-verify-policy-relax
gh-Mbed-TLS:public_2/main
gh-Mbed-TLS:archive/20260929T231919Z-rescue/mpg/pk-sign-proto
gh-Mbed-TLS:release/tf-psa-crypto1.0.0-documentation
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/0e-plans-july-updates
gh-Mbed-TLS:archive/20260929T231919Z-rescue/davidhorstmann-arm/guard-context-types-in-client-only
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/psa-driver-interface-spec-remove
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/ecp-self-test-race-crypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/KiruthikPrakash/feature/9342_add-support-for-spake2p-public-key-import-export
gh-Mbed-TLS:archive/20260929T231919Z-rescue/ruiliio/chacha20_16
gh-Mbed-TLS:archive/20260929T231919Z-rescue/irwir/winsock2
gh-Mbed-TLS:archive/20260929T231919Z-rescue/aphroteus/development
gh-Mbed-TLS:archive/20260929T231919Z-rescue/amjoul01/amjoul01/psa-mac-out-of-bound-fix
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/everest-submodule-crypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/yamt/xtensa-ccount
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/all.sh-generate-only-before-checks-crypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/Harshal5/feat/builtin_cmac_driver_use_psa_crypto_interface
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/test-data_t-empty_is_empty-crypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/jean-baptisteboric-eaton/oids-pkcs7-authenticated-attributes
gh-Mbed-TLS:dev/bensze01/public-only-commit
gh-Mbed-TLS:archive/20260929T231919Z-rescue/waleed-elmelegy-arm/psa-key-wrap-aes-kw
gh-Mbed-TLS:archive/20260929T231919Z-rescue/tfloch/psa_add_xts_algorithm
gh-Mbed-TLS:archive/20260929T231919Z-rescue/gilles-peskine-arm/msancf-clang16-crypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/DemiMarie/document-unexpected-tags
gh-Mbed-TLS:archive/20260929T231919Z-rescue/DemiMarie/strict-len
gh-Mbed-TLS:archive/20260929T231919Z-rescue/valeriosetti/issue9255-tfpsacrypto
gh-Mbed-TLS:archive/20260929T231919Z-rescue/daantimmer/use-compiler-frontend
gh-Mbed-TLS:archive/20260929T231919Z-rescue/benmcollins/enable-rsassa-pss-pkparse
gh-Mbed-TLS:dev/paul-elliott-arm/add_iop_key_agreement_negative_tests
gh-Mbed-TLS:add-iop-export-pub-key-get-num-ops
gh-Mbed-TLS:dev/rc/new-2-d635ea1
gh-Mbed-TLS:dev/bensze01/jenkins
No reviewers
Labels
Clear labels
api-break
This issue/PR breaks the API and must wait for a new major version
approved
Design and code approved - may be waiting for CI or backports
bug
Something isn't working
component-docs
Docs / website issues filed here for tracking
component-platform
Portability layer and build scripts
component-test
Test framework and CI scripts
dependencies
Pull requests that update a dependency file
deprecation
needs deprecation announcement
DO-NOT-MERGE
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
This issue is not being actively worked on, but PRs welcome.
needs-adoption
stalled PR that someone should pick up and complete
needs-backports
Backports are missing or are pending review and approval.
needs-ci
Needs to pass CI tests
needs-design-approval
Needs design discussion / approval
needs-info
An issue or PR which needs further info from the reporter / author
needs-preceding-pr
Requires another PR to be merged first
needs-review
Every commit must be reviewed by at least two team members
needs-reviewer
This PR needs someone to pick it up for review
needs-work
priority-high
High priority - will be reviewed soon
priority-low
Low priority - this may not receive review soon
priority-medium
Medium priority - this can be reviewed as time permits
priority-scheduled
This PR is big - it will require time to be scheduled for review
priority-very-high
Highest priority - prioritise this over other review work
resolved-after-1.1
The issue is resolved in development, but still present in 1.1 LTS.
single-reviewer
This PR qualifies for having only one reviewer
size-l
Estimated task size: large (2w+)
size-m
Estimated task size: medium (~1w)
size-optimisation
size-s
Estimated task size: small (~2d)
size-xs
Estimated task size: extra small (a few hours at most)
No labels
api-break
approved
bug
component-docs
component-platform
component-test
dependencies
deprecation
DO-NOT-MERGE
enhancement
good first issue
help wanted
needs-adoption
needs-backports
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
resolved-after-1.1
single-reviewer
size-l
size-m
size-optimisation
size-s
size-xs
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
gh-Mbed-TLS/TF-PSA-Crypto!809
Loading…
Reference in a new issue
No description provided.
Delete branch "asmellby/feature/dispatch-library"
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?
Description
The TF-PSA-Crypto 1.1 release introduced a
dispatchdirectory with the following description:This PR completes the move of generated driver wrapper files and API headers to the dispatch directory.
Resolves https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/833
PR checklist
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.
I think this is moving in the direction we want, thanks. But I've asked Ronald to review as well, as he's the architect of the directory structure and build scripts. We're currently focusing on some security fixes for our next release, so it might be a while before he can review.
I'm not sure what users are supposed to be able to do. Whatever it is, it needs to be documented and tested.
I reviewed 56449b86ac563df1daa921a7a929d522ecfc8256
@ -68,3 +76,4 @@# Put the version numbers into relevant filesset(version_number_filesdoxygen/input/doc_mainpage.hAs I understand it,
TF_PSA_CRYPTO_DISPATCH_DIRis now an option that can be set when running CMake. Please document it.From prior experience, I think
CMakeLists.txtin Mbed TLS will need to know about the new location to populateTF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS. It isn't properly extracting the information from TF-PSA-Crypto.@ -415,3 +425,4 @@${TF_PSA_CRYPTO_DISPATCH_DIR}${CMAKE_CURRENT_SOURCE_DIR}/extras${CMAKE_CURRENT_SOURCE_DIR}/platform${CMAKE_CURRENT_SOURCE_DIR}/utilitiesMy understanding is that the point of having
TF_PSA_CRYPTO_DISPATCH_DIRas a variable is that users can pass an out-of-tree directory to be used instead ofdispatch, but it doesn't work.tests/scripts/components-build-system.shthat demonstrates the intended feature.Please add a changelog entry file (see
ChangeLog.d/00README.md) that briefly explains the user-visible aspect of the changes.@ -0,0 +1,52 @@# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-laterI asked Codex to review and it tells me:
This looks superficially legitimate to me, but I don't know much about CMake.
Added a changelog entry.
@ -68,3 +76,4 @@# Put the version numbers into relevant filesset(version_number_filesdoxygen/input/doc_mainpage.hAdded documentation to the top of CMakeLists.txt, where the existing CMake variables were documented.
@ -415,3 +425,4 @@${TF_PSA_CRYPTO_DISPATCH_DIR}${CMAKE_CURRENT_SOURCE_DIR}/extras${CMAKE_CURRENT_SOURCE_DIR}/platform${CMAKE_CURRENT_SOURCE_DIR}/utilitiesGood catch! Fixed and added tests.
@ -0,0 +1,52 @@# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-laterFixed!
Looks good to me, except I'd like one point clarified in the documentation. I don't know much about CMake, so my review of CMake code is superficial.
Our CI appears to be stuck today (ticket filed), so results might not be available until Monday.
@ -14,6 +14,11 @@# calling CMake in order to avoid target name clashes, via the use ofPlease state that this must be an absolute path.
Note that the CI isn't happy. There's at least a missing include directory in CMake builds.
Opened Mbed-TLS/mbedtls#10780
@ -14,6 +14,11 @@# calling CMake in order to avoid target name clashes, via the use ofDone.
I manually kicked the CI because it didn't automatically start after the last push
@asmellby Sorry for the delay.
I've started looking at this PR. It seems to me that it addresses two separate things:
dispatchdirectory.dispatchdirectory.I would prefer to handle (1) first and (2) in a follow-up PR. Would you be able to split the changes accordingly?
I could do that, but that will require a rebase, which the contribution guidelines tell me not to do without approval from reviewers. So I'll need some guidance: To what degree should I clean up the commits when I rebase? Am I allowed to merge fixup commits into the initial commits to create a more reviewable changeset, or should I keep them separate to preserve the (now no longer entirely real) history?
I would prefer to keep (1) and (2) in the same pull request, because (2) checks that (1) has been done right.
But if (1) and (2) are separate, please provide histories that help me review incrementally:
git range-diff development 1c6cde11420cf17340a385dfb43b9453dc211c44 head1.step1in one PR, and a stepstep2such thathead1andstep2have the same content.(Where rebases get really bad is if there's both a change of base and a change of commit structure.)
By the way, for reviewing, the merge conflict on the framework submodule is not a concern. However, I haven't made this review a priority due to the CI failure.
Note, I will be offline from tomorrow to 19 July.
CI passes for the TF-PSA-Crypto tests as far as I can tell. The CI failure is on the Mbed TLS tests, which needs the corresponding change in https://github.com/Mbed-TLS/mbedtls/pull/10780 to pass. How can I tell the TF-PSA-Crypto CI to use that Mbed TLS PR?
You cannot. We will need to merge the Mbed TLS PR first.
@gilles-peskine-arm I am not sure what do you mean by that. Could you elaborate?
If we've moved too few files or too many files, the test with an alternative dispatch directory has a good change of telling us. Without this test, nothing will tell us.
The tests with an alternative dispatch directory mostly reproduce the content of the
dispatchdirectory into acustomdirectory, so I am not sure how they would help check whether we have moved too few or too many files into that directory.More generally, I may have missed some discussion, but I am not sure what we are trying to achieve with the
TF_PSA_CRYPTO_DISPATCH_DIRoption. What are the intended use cases for this option?Ah, yes, they wouldn't really help with that, my bad.
Ah, my bad, I've mentioned it before but I hadn't put it in writing. I've filed https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/833.
At
7655efb69f, LGTM except that I don't understand2de8d4e61c.@ -0,0 +29,4 @@EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/psa_crypto_driver_wrappers_no_static.c")# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the sourceThis should be an elseif.
I don't understand why this condition is needed now. Is it fixing a preexisting bug?
We run our CI with
GEN_FILES=ON. It's supposed to work withGEN_FILES=OFF, but that's not something we test.@ -0,0 +30,4 @@# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the source# directory but does exist in the build directory, use the file fromNot “test cases” (this would be a stanza in
tests/suites/*.data, but “test components”.But it's weird to justify a feature by a test component. I don't quite understand why this is needed.
@ -0,0 +29,4 @@EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/psa_crypto_driver_wrappers_no_static.c")# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the sourceThe test component
tf_psa_crypto_test_memsan_constant_flow_psaruns CMake twice -- first withGEN_FILES=ONto generate the driver wrapper. Then, it runs again withGEN_FILES=OFFandCMAKE_BUILD_TYPE=MemSan, relying on the previous invocation's copy of the generated driver wrapper to still exist and be picked up by the build system.Introduced in
github.com/Mbed-TLS/TF-PSA-Crypto@93a8114276This creates a weird scenario where the build system on that second pass needs to be able to pick up the file from the generation directory, despite
GEN_FILES=OFF. The previous implementation incorehandled this by using a relative path, which makes CMake check both the source and build directory: https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/development/core/CMakeLists.txt#L3-L14I can simplify this to match the way it was done in
corebefore, they should be equivalent if my reading of https://cmake.org/cmake/help/v3.31/prop_tgt/SOURCES.html is correct -- what I did is just more explicit about the intention.@ -0,0 +29,4 @@EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/psa_crypto_driver_wrappers_no_static.c")# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the sourcehttps://github.com/Mbed-TLS/TF-PSA-Crypto/pull/135#discussion_r1946824568 contains some discussion of why it's done this way for that test component.
@ -0,0 +30,4 @@# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the source# directory but does exist in the build directory, use the file fromAgree that it's weird. Added a comment below about why it's needed, but that it could be made less explicit by relying on implicit CMake search paths for relative paths, which was what the core did before. That would avoid explicitly calling out the test component -- the build system behavior would be exactly the same, though.
@ -0,0 +29,4 @@EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/psa_crypto_driver_wrappers_no_static.c")# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the sourceThanks for the explanation.
I'm ok with this code if you improve the comments explaining why, mainly that it's about
GEN_FILES=ONfollowed byGEN_FILES=OFF. I don't understand why we did that in93a8114276, as opposed to e.g.framework/scripts/make_generated_files.pyor just directly running the build without touchingGEN_FILES.But I'm a CMake novice. Please wait for someone who is more experienced with CMake (Ronald) to give their opinion.
Sorry for the delay. This looks quite good to me. There are a few things I would like to change/improve.
@ -0,0 +1,52 @@# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-laterMy understanding is that the commit "Remove intermediate generated dispatch target" is the fix. This commit fixes the race between libtfpsacrypto_generated_dispatch_target and the dispatch object target. But there is still a race condition when both the shared and static libraries are built. Both
dispatch_targetanddispatch_static_targettargets have the driver wrapper in their list of sources. The two target builds which can happen in parallel trigger the custom command to generate the driver wrapper.I would restore the
libtfpsacrypto_generated_dispatch_targetcustom target and make bothdispatch_targetanddispatch_static_targetdepends on it. Then as it is already the case now I think, the driver targets depend on the dispatch ones.@ -0,0 +29,4 @@EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/psa_crypto_driver_wrappers_no_static.c")# Some test cases (tf_psa_crypto_test_memsan_constant_flow_psa) rely on# reusing a generated version of the driver wrapper from a previous# CMake invocation. If the driver wrapper doesn't exist in the sourceI haven't dug into the history but as of today I think we should change the test component to something like:
and remove the
if(EXISTS ...code in question in this series of comments.With the MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN config option the generation of some files fails thus we generate them in the source tree (like in releases) and then we build the library with the desired option. There may be other all.sh components to update.
@ -0,0 +1,41 @@cmake_minimum_required(VERSION 3.5.1)Rather than duplicate and then adapt
cmake_package_installI would prefer to just adapt it with a TF_PSA_CRYPTO_DISPATCH_DIR option handled by this CMakeLists.txt file and passed to TF-PSA-Crypto CMake build.Ditto for
cmake_subproject_custom_dispatch().The all.sh component would then look something like:
The logic to copy the content of
dispatchis a bit different to what we have currently to know as little as possible about its content.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.