tests: add CMake DESTDIR install coverage in components-build-system#755
Conversation
Signed-off-by: Yi Wu <yi.wu2@arm.com>
Signed-off-by: Yi Wu <yi.wu2@arm.com>
gilles-peskine-arm
left a comment
There was a problem hiding this comment.
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.
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Are we required/expecting to support windows here?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
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