Skip to content

tests: add CMake DESTDIR install coverage in components-build-system#755

Merged
gilles-peskine-arm merged 4 commits intoMbed-TLS:developmentfrom
yiwu0b11:destdir_install_env_support-tf-psa
Apr 29, 2026
Merged

tests: add CMake DESTDIR install coverage in components-build-system#755
gilles-peskine-arm merged 4 commits intoMbed-TLS:developmentfrom
yiwu0b11:destdir_install_env_support-tf-psa

Conversation

@yiwu0b11
Copy link
Copy Markdown
Contributor

@yiwu0b11 yiwu0b11 commented Apr 14, 2026

Description

Support for DESTDIR env for build install is already in makefile.
Tests are added

Issue: Mbed-TLS/mbedtls#10627
Side port of: Mbed-TLS/mbedtls#10631

PR checklist

Signed-off-by: Yi Wu <yi.wu2@arm.com>
Signed-off-by: Yi Wu <yi.wu2@arm.com>
@yiwu0b11 yiwu0b11 marked this pull request as ready for review April 16, 2026 18:44
@yiwu0b11 yiwu0b11 added size-s Estimated task size: small (~2d) needs-review Every commit must be reviewed by at least two team members priority-medium Medium priority - this can be reviewed as time permits labels Apr 17, 2026
Copy link
Copy Markdown
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content in TF-PSA-Crypto is very different from Mbed TLS due to differences with generated files and having a single library, so here I don't mind just writing similar code without copying the development history.

So ok for the history. There's just one line that it doesn't make sense to duplicate here given the simpler structure.

Comment thread tests/scripts/components-build-system.sh Outdated
@gilles-peskine-arm gilles-peskine-arm added needs-work and removed needs-review Every commit must be reviewed by at least two team members labels Apr 17, 2026
Signed-off-by: Yi Wu <yi.wu2@arm.com>
msg "install: cmake tf-psa-crypto with DESTDIR staging"
TF_PSA_CRYPTO_ROOT_DIR="$PWD"
cd "$OUT_OF_SOURCE_DIR"
cmake -DGEN_FILES=ON -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_TF_PSA_CRYPTO_LIBRARY=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr "$TF_PSA_CRYPTO_ROOT_DIR"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd be tempted to leave -DENABLE_PROGRAMS on. I suspect it'll make zero difference to the outcome, though I believe the programs are installed. So there's a possibility it'll effect the test.

install_lib_path="$OUT_OF_SOURCE_DIR/stage/usr/${install_lib_subdir}"

[ -f "$install_lib_path/libtfpsacrypto.a" ]
if [[ "$OSTYPE" == darwin* ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we required/expecting to support windows here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long wait, after spend some time double check - No, not expected - only test component that has "_mingw" in its name will be checked on Windows.
https://github.com/Mbed-TLS/mbedtls-framework/blob/c6610dde67ffd2a3a81cc204a73572b9c31a5775/scripts/all-core.sh#L876-L877
Additionally cmake "desdir" functionality only exist on UNIX system https://cmake.org/cmake/help/latest/envvar/DESTDIR.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't try to run all.sh on Windows and I expect that a lot of things would break. It's not a problem to have one more place where Windows isn't supported.

We only run all.sh on Linux and FreeBSD in the CI, but some developers use macOS so it's better if the script also works on macOS.

Even the MinGW component doesn't run on Windows. It runs a cross-compiler on Linux that produces Windows binaries. We also do a MinGW build with a Windows host on the CI, but that doesn't use all.sh, it uses windows_testing.[y.

Signed-off-by: Yi Wu <yi.wu2@arm.com>
Copy link
Copy Markdown
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members needs-backports Backports are missing or are pending review and approval. and removed needs-work labels Apr 27, 2026
@gilles-peskine-arm gilles-peskine-arm changed the title Backport: tests: add CMake DESTDIR install coverage in components-build-system tests: add CMake DESTDIR install coverage in components-build-system Apr 27, 2026
@github-project-automation github-project-automation Bot moved this from In Development to Has Approval in Non-roadmap pull requests Apr 27, 2026
@gilles-peskine-arm gilles-peskine-arm removed the needs-review Every commit must be reviewed by at least two team members label Apr 27, 2026
@gilles-peskine-arm gilles-peskine-arm added the approved Design and code approved - may be waiting for CI or backports label Apr 27, 2026
@gilles-peskine-arm gilles-peskine-arm added this pull request to the merge queue Apr 29, 2026
Merged via the queue into Mbed-TLS:development with commit bbf1eaf Apr 29, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Has Approval to Done in Non-roadmap pull requests Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Design and code approved - may be waiting for CI or backports needs-backports Backports are missing or are pending review and approval. priority-medium Medium priority - this can be reviewed as time permits size-s Estimated task size: small (~2d)

Projects

Development

Successfully merging this pull request may close these issues.

3 participants