From 409086aece403556807edc512d5e1f7b95831aa8 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Fri, 9 Aug 2024 15:34:55 -0500 Subject: [PATCH 01/11] Fix Build Issues - One fix is for OpenSSL that's related to renaming our `ANDROID_NDK` variable in https://github.com/OpenDDS/OpenDDS-Android/pull/13. - The other is `configure.sh` assumed it could pass spaces through `--mpcopts`, which changed in https://github.com/OpenDDS/OpenDDS/pull/4574. --- .gitignore | 1 + build_openssl.sh | 1 + configure.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e05b505..3130681 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /ACE+TAO-2.2a_with_latest_patches.tar.gz /secdeps_prefix /android-sdk +/commandlinetools-* diff --git a/build_openssl.sh b/build_openssl.sh index 5c2adb0..e10886c 100755 --- a/build_openssl.sh +++ b/build_openssl.sh @@ -10,6 +10,7 @@ source setenv.sh source make.sh export PATH="$android_toolchain_bin:$PATH" +export ANDROID_NDK_ROOT="${OPENDDS_ANDROID_NDK}" cd openssl_source ./Configure no-tests no-shared android-$arch -D__ANDROID_API__=$api --prefix=$SSL_ROOT diff --git a/configure.sh b/configure.sh index 513ffb2..6865c36 100755 --- a/configure.sh +++ b/configure.sh @@ -55,7 +55,7 @@ pushd $workspace/OpenDDS > /dev/null --tao=$TAO_ROOT \ --tests \ --no-inline \ - --mpcopts "-workers $logical_cores" \ + --mpc:workers $logical_cores \ --macros=ANDROID_ABI:=$abi \ "${extra_configure_flags[@]}" popd > /dev/null From c2b4f7521595a3088e9ef803adba6f8515106685 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Fri, 9 Aug 2024 18:05:39 -0500 Subject: [PATCH 02/11] Try to Add NDK r12 Back --- .github/workflows/matrix.yml | 72 ++++++++++++++++++++++++++++++++++++ README.md | 1 + matrix.py | 7 ++++ 3 files changed, 80 insertions(+) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 7276998..e89ec19 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -41,6 +41,11 @@ jobs: run: | bash print_settings.sh + - name: Install Python 2 + if: ${{ matrix.install_python2 }} + run: | + sudo apt install python2 + - name: Get NDK and Toolchain run: | bash get_ndk.sh @@ -99,6 +104,7 @@ jobs: use_java: true use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-29-doc-group-master arch: arm64 @@ -109,6 +115,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-28-doc-group-master arch: arm64 @@ -119,6 +126,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-27-doc-group-master arch: arm64 @@ -129,6 +137,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-26-doc-group-master arch: arm64 @@ -139,6 +148,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-24-doc-group-master arch: arm64 @@ -149,6 +159,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-23-doc-group-master arch: arm64 @@ -159,6 +170,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-22-doc-group-master arch: arm64 @@ -169,6 +181,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-21-doc-group-master arch: arm64 @@ -179,6 +192,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-20-doc-group-master arch: arm @@ -189,6 +203,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-19-doc-group-master arch: arm @@ -199,6 +214,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-18-doc-group-master arch: arm @@ -209,6 +225,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-17-doc-group-master arch: arm @@ -219,6 +236,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-16-security-java-doc-group-master arch: arm @@ -229,6 +247,7 @@ jobs: use_java: true use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-30-doc-group-master arch: arm64 @@ -239,6 +258,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-16-doc-group-master arch: arm @@ -249,6 +269,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" # r22b --------------------------------------------------------------------------- - name: r22b-arm64-30-doc-group-master @@ -260,6 +281,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r22b-arm-16-doc-group-master arch: arm @@ -270,6 +292,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r22b-arm64-30-toolchain-doc-group-master arch: arm64 @@ -280,6 +303,7 @@ jobs: use_java: false use_toolchain: true target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r22b-arm-16-toolchain-doc-group-master arch: arm @@ -290,6 +314,7 @@ jobs: use_java: false use_toolchain: true target_api: 30 + install_python2: false ace_tao: "doc_group_master" # r20b --------------------------------------------------------------------------- - name: r20b-arm64-29-doc-group-master @@ -301,6 +326,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r20b-arm-16-doc-group-master arch: arm @@ -311,6 +337,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" # r19c --------------------------------------------------------------------------- - name: r19c-arm64-28-doc-group-master @@ -322,6 +349,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" - name: r19c-arm-16-doc-group-master arch: arm @@ -332,6 +360,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_master" # r18b --------------------------------------------------------------------------- - name: r18b-arm-16-java-toolchain-target-api-16-doc-group-master @@ -343,6 +372,7 @@ jobs: use_java: true use_toolchain: true target_api: 16 + install_python2: false ace_tao: "doc_group_master" - name: r18b-arm64-28-toolchain-doc-group-master arch: arm64 @@ -353,6 +383,7 @@ jobs: use_java: false use_toolchain: true target_api: 30 + install_python2: false ace_tao: "doc_group_master" # doc_group_ace6_tao2 ============================================================ # r23b --------------------------------------------------------------------------- @@ -365,6 +396,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-29-doc-group-ace6-tao2 arch: arm64 @@ -375,6 +407,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-28-doc-group-ace6-tao2 arch: arm64 @@ -385,6 +418,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-27-doc-group-ace6-tao2 arch: arm64 @@ -395,6 +429,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-26-doc-group-ace6-tao2 arch: arm64 @@ -405,6 +440,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-24-doc-group-ace6-tao2 arch: arm64 @@ -415,6 +451,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-23-doc-group-ace6-tao2 arch: arm64 @@ -425,6 +462,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-22-doc-group-ace6-tao2 arch: arm64 @@ -435,6 +473,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-21-doc-group-ace6-tao2 arch: arm64 @@ -445,6 +484,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-20-doc-group-ace6-tao2 arch: arm @@ -455,6 +495,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-19-doc-group-ace6-tao2 arch: arm @@ -465,6 +506,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-18-doc-group-ace6-tao2 arch: arm @@ -475,6 +517,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-17-doc-group-ace6-tao2 arch: arm @@ -485,6 +528,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-16-doc-group-ace6-tao2 arch: arm @@ -495,6 +539,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" # r19c --------------------------------------------------------------------------- - name: r19c-arm64-28-doc-group-ace6-tao2 @@ -506,6 +551,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r19c-arm-16-doc-group-ace6-tao2 arch: arm @@ -516,6 +562,7 @@ jobs: use_java: false use_toolchain: false target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" # r18b --------------------------------------------------------------------------- - name: r18b-arm64-28-toolchain-doc-group-ace6-tao2 @@ -527,6 +574,7 @@ jobs: use_java: false use_toolchain: true target_api: 30 + install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r18b-arm-16-toolchain-doc-group-ace6-tao2 arch: arm @@ -537,4 +585,28 @@ jobs: use_java: false use_toolchain: true target_api: 30 + install_python2: false + ace_tao: "doc_group_ace6_tao2" +# r12b --------------------------------------------------------------------------- + - name: r12b-arm64-24-toolchain-install-python2-doc-group-ace6-tao2 + arch: arm64 + ndk: r12b + api: 24 + os: "ubuntu-22.04" + use_security: false + use_java: false + use_toolchain: true + target_api: 30 + install_python2: true + ace_tao: "doc_group_ace6_tao2" + - name: r12b-arm-16-toolchain-install-python2-doc-group-ace6-tao2 + arch: arm + ndk: r12b + api: 16 + os: "ubuntu-22.04" + use_security: false + use_java: false + use_toolchain: true + target_api: 30 + install_python2: true ace_tao: "doc_group_ace6_tao2" diff --git a/README.md b/README.md index 6979264..fa18286 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ machine. | r20b | `M` | - | - | - | - | - | - | - | - | - | - | - | `M` | - | | r19c | `M`,`6` | - | - | - | - | - | - | - | - | - | - | `M`,`6` | - | - | | r18b | `M`,`6` | - | - | - | - | - | - | - | - | - | - | `M`,`6` | - | - | +| r12b | `6` | - | - | - | - | - | - | - | `6` | - | - | - | - | - | ### Modifying the Matrix diff --git a/matrix.py b/matrix.py index 9a35650..bbaf7f1 100755 --- a/matrix.py +++ b/matrix.py @@ -19,6 +19,7 @@ use_java=False, use_toolchain=False, target_api=30, + install_python2=False, ) @@ -107,6 +108,12 @@ def comprehensive(matrix, ndk, extras=False): use_toolchain=True, ), ) + doc_group_ace6_tao2_matrix.add_ndk('r12b', 'minmax', + default_flags=dict( + use_toolchain=True, + install_python2=True, + ), + ) return [ doc_group_master_matrix, From fe3789344a3913fd628617d20638d300b966f240 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Fri, 9 Aug 2024 18:07:55 -0500 Subject: [PATCH 03/11] Force C++17 for ACE/TAO 8 --- build_xerces.sh | 10 +++++++++- configure.sh | 5 +++++ setenv.sh | 8 ++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/build_xerces.sh b/build_xerces.sh index 12299f2..1e50d89 100755 --- a/build_xerces.sh +++ b/build_xerces.sh @@ -26,12 +26,20 @@ then popd fi +extra_configure_opts=() + +if [ ! -z "${force_cpp_std+x}" ] +then + extra_configure_opts+=("-DCMAKE_CXX_STANDARD=$force_cpp_std") +fi + pushd xerces_source cmake \ "-DCMAKE_INSTALL_PREFIX=$XERCESCROOT" \ "-DCMAKE_TOOLCHAIN_FILE=$OPENDDS_ANDROID_NDK/build/cmake/android.toolchain.cmake" \ "-DANDROID_ABI=$abi" "-DANDROID_PLATFORM=android-$api" \ - "-DANDROID_CPP_FEATURES=rtti exceptions" + "-DANDROID_CPP_FEATURES=rtti exceptions" \ + "${extra_configure_opts[@]}" $make mkdir -p $XERCESCROOT make install diff --git a/configure.sh b/configure.sh index 6865c36..e9fcecb 100755 --- a/configure.sh +++ b/configure.sh @@ -40,6 +40,11 @@ then extra_configure_flags+=("--macros=android_force_clang:=0") fi +if [ ! -z "${force_cpp_std+x}" ] +then + extra_configure_flags+=("--std=$force_cpp_std") +fi + if ! $use_toolchain then extra_configure_flags+=( diff --git a/setenv.sh b/setenv.sh index 563dccd..98ca8b0 100644 --- a/setenv.sh +++ b/setenv.sh @@ -10,11 +10,11 @@ download_file() { } # Getting Configuration -if [ -z ${ndk+x} ] +if [ -z "${ndk+x}" -o -z "${arch+x}" -o -z "${api+x}" ] then if ! [ -f ${workspace}/settings.sh ] then - echo "Warning: ndk is not set and there are no settings.sh, copying default.settings.sh" 1>&2 + echo 'Warning: $ndk, $arch, or $api not set and there is no settings.sh, copying default.settings.sh' 1>&2 cp ${workspace}/default.settings.sh ${workspace}/settings.sh fi source ${workspace}/settings.sh @@ -113,6 +113,10 @@ export ace_tao=${ace_tao-'doc_group_master'} case $ace_tao in 'doc_group_master') export ace_tao_default_branch='master' + if [ $ndk_major_rev -lt 27 ] + then + export force_cpp_std="c++17" + fi ;; 'doc_group_ace6_tao2') From 25fd5ee73a5b8fb41d048a555f7a6061cb14a105 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Sun, 11 Aug 2024 18:03:52 -0500 Subject: [PATCH 04/11] Remove API Level 20 (Again) --- .github/workflows/matrix.yml | 113 +++++++++++++++-------------------- README.md | 16 ++--- matrix.py | 12 ++-- 3 files changed, 61 insertions(+), 80 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index e89ec19..74b8a4c 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -84,6 +84,9 @@ jobs: - name: Configure ACE/TAO and OpenDDS run: bash configure.sh + - name: Show Build Config + run: perl OpenDDS/tools/scripts/show_build_config.pl + - name: Build ACE/TAO and OpenDDS run: bash build.sh @@ -100,176 +103,165 @@ jobs: ndk: r23b api: 30 os: "ubuntu-22.04" + install_python2: false use_security: true use_java: true use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-29-doc-group-master arch: arm64 ndk: r23b api: 29 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-28-doc-group-master arch: arm64 ndk: r23b api: 28 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-27-doc-group-master arch: arm64 ndk: r23b api: 27 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-26-doc-group-master arch: arm64 ndk: r23b api: 26 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-24-doc-group-master arch: arm64 ndk: r23b api: 24 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-23-doc-group-master arch: arm64 ndk: r23b api: 23 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-22-doc-group-master arch: arm64 ndk: r23b api: 22 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-21-doc-group-master arch: arm64 ndk: r23b api: 21 os: "ubuntu-22.04" - use_security: false - use_java: false - use_toolchain: false - target_api: 30 install_python2: false - ace_tao: "doc_group_master" - - name: r23b-arm-20-doc-group-master - arch: arm - ndk: r23b - api: 20 - os: "ubuntu-22.04" use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-19-doc-group-master arch: arm ndk: r23b api: 19 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-18-doc-group-master arch: arm ndk: r23b api: 18 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-17-doc-group-master arch: arm ndk: r23b api: 17 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-16-security-java-doc-group-master arch: arm ndk: r23b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: true use_java: true use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm64-30-doc-group-master arch: arm64 ndk: r23b api: 30 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r23b-arm-16-doc-group-master arch: arm ndk: r23b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" # r22b --------------------------------------------------------------------------- - name: r22b-arm64-30-doc-group-master @@ -277,44 +269,44 @@ jobs: ndk: r22b api: 30 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r22b-arm-16-doc-group-master arch: arm ndk: r22b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r22b-arm64-30-toolchain-doc-group-master arch: arm64 ndk: r22b api: 30 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r22b-arm-16-toolchain-doc-group-master arch: arm ndk: r22b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: false ace_tao: "doc_group_master" # r20b --------------------------------------------------------------------------- - name: r20b-arm64-29-doc-group-master @@ -322,22 +314,22 @@ jobs: ndk: r20b api: 29 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r20b-arm-16-doc-group-master arch: arm ndk: r20b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" # r19c --------------------------------------------------------------------------- - name: r19c-arm64-28-doc-group-master @@ -345,22 +337,22 @@ jobs: ndk: r19c api: 28 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" - name: r19c-arm-16-doc-group-master arch: arm ndk: r19c api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_master" # r18b --------------------------------------------------------------------------- - name: r18b-arm-16-java-toolchain-target-api-16-doc-group-master @@ -368,22 +360,22 @@ jobs: ndk: r18b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: true use_toolchain: true target_api: 16 - install_python2: false ace_tao: "doc_group_master" - name: r18b-arm64-28-toolchain-doc-group-master arch: arm64 ndk: r18b api: 28 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: false ace_tao: "doc_group_master" # doc_group_ace6_tao2 ============================================================ # r23b --------------------------------------------------------------------------- @@ -392,154 +384,143 @@ jobs: ndk: r23b api: 30 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-29-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 29 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-28-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 28 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-27-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 27 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-26-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 26 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-24-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 24 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-23-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 23 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-22-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 22 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm64-21-doc-group-ace6-tao2 arch: arm64 ndk: r23b api: 21 os: "ubuntu-22.04" - use_security: false - use_java: false - use_toolchain: false - target_api: 30 install_python2: false - ace_tao: "doc_group_ace6_tao2" - - name: r23b-arm-20-doc-group-ace6-tao2 - arch: arm - ndk: r23b - api: 20 - os: "ubuntu-22.04" use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-19-doc-group-ace6-tao2 arch: arm ndk: r23b api: 19 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-18-doc-group-ace6-tao2 arch: arm ndk: r23b api: 18 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-17-doc-group-ace6-tao2 arch: arm ndk: r23b api: 17 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r23b-arm-16-doc-group-ace6-tao2 arch: arm ndk: r23b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" # r19c --------------------------------------------------------------------------- - name: r19c-arm64-28-doc-group-ace6-tao2 @@ -547,22 +528,22 @@ jobs: ndk: r19c api: 28 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r19c-arm-16-doc-group-ace6-tao2 arch: arm ndk: r19c api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: false target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" # r18b --------------------------------------------------------------------------- - name: r18b-arm64-28-toolchain-doc-group-ace6-tao2 @@ -570,43 +551,43 @@ jobs: ndk: r18b api: 28 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" - name: r18b-arm-16-toolchain-doc-group-ace6-tao2 arch: arm ndk: r18b api: 16 os: "ubuntu-22.04" + install_python2: false use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: false ace_tao: "doc_group_ace6_tao2" # r12b --------------------------------------------------------------------------- - - name: r12b-arm64-24-toolchain-install-python2-doc-group-ace6-tao2 + - name: r12b-arm64-24-install-python2-toolchain-doc-group-ace6-tao2 arch: arm64 ndk: r12b api: 24 os: "ubuntu-22.04" + install_python2: true use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: true ace_tao: "doc_group_ace6_tao2" - - name: r12b-arm-16-toolchain-install-python2-doc-group-ace6-tao2 + - name: r12b-arm-16-install-python2-toolchain-doc-group-ace6-tao2 arch: arm ndk: r12b api: 16 os: "ubuntu-22.04" + install_python2: true use_security: false use_java: false use_toolchain: true target_api: 30 - install_python2: true ace_tao: "doc_group_ace6_tao2" diff --git a/README.md b/README.md index fa18286..94c8adf 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,14 @@ machine. `M` = [`doc_group_master`](https://github.com/DOCGroup/ACE_TAO) `6` = [`doc_group_ace6_tao2`](https://github.com/DOCGroup/ACE_TAO/tree/ace6tao2) -| | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | -| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| r23b | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | -| r22b | `M` | - | - | - | - | - | - | - | - | - | - | - | - | `M` | -| r20b | `M` | - | - | - | - | - | - | - | - | - | - | - | `M` | - | -| r19c | `M`,`6` | - | - | - | - | - | - | - | - | - | - | `M`,`6` | - | - | -| r18b | `M`,`6` | - | - | - | - | - | - | - | - | - | - | `M`,`6` | - | - | -| r12b | `6` | - | - | - | - | - | - | - | `6` | - | - | - | - | - | +| | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| r23b | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | `M`,`6` | +| r22b | `M` | - | - | - | - | - | - | - | - | - | - | - | `M` | +| r20b | `M` | - | - | - | - | - | - | - | - | - | - | `M` | - | +| r19c | `M`,`6` | - | - | - | - | - | - | - | - | - | `M`,`6` | - | - | +| r18b | `M`,`6` | - | - | - | - | - | - | - | - | - | `M`,`6` | - | - | +| r12b | `6` | - | - | - | - | - | - | `6` | - | - | - | - | - | ### Modifying the Matrix diff --git a/matrix.py b/matrix.py index bbaf7f1..1520bd4 100755 --- a/matrix.py +++ b/matrix.py @@ -10,16 +10,16 @@ import argparse # Start of matrix data ======================================================== -# This is what needs to be kept to date +# This is what needs to be kept up to date default_default_flags = dict( # TODO: os='ubuntu-latest', os='ubuntu-22.04', + install_python2=False, use_security=False, use_java=False, use_toolchain=False, target_api=30, - install_python2=False, ) @@ -35,8 +35,8 @@ def define_ndks(): Ndk('r12b', 16, 24) -# API Level 25 was Android Wear-only -skip_apis = set([25]) +# API Level 20 was Android Wear-only and 25 isn't in the NDK +skip_apis = set([20, 25]) def default_arch(api): @@ -55,7 +55,7 @@ def comprehensive(matrix, ndk, extras=False): ), ) - # DOC Group master branch + # DOC Group master branch --------------------------------------------------- doc_group_master_matrix = Matrix( 'doc_group_master', mark='M', url='https://github.com/DOCGroup/ACE_TAO', @@ -95,7 +95,7 @@ def comprehensive(matrix, ndk, extras=False): # ), # ) - # DOC Group master ace6_tao2 branch + # DOC Group master ace6_tao2 branch ----------------------------------------- doc_group_ace6_tao2_matrix = Matrix( 'doc_group_ace6_tao2', mark='6', url='https://github.com/DOCGroup/ACE_TAO/tree/ace6tao2', From c3b91c08bde2ee0e3586a860c54b2341619d90e1 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Sun, 11 Aug 2024 18:05:56 -0500 Subject: [PATCH 05/11] Optional Python2 Scripts --- .gitignore | 23 +++++++++++++---------- build_python2.sh | 14 ++++++++++++++ get_python2.sh | 41 +++++++++++++++++++++++++++++++++++++++++ get_toolchain.sh | 9 +++++++-- 4 files changed, 75 insertions(+), 12 deletions(-) create mode 100755 build_python2.sh create mode 100755 get_python2.sh diff --git a/.gitignore b/.gitignore index 3130681..d2d8db3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,18 @@ +/settings.sh + +/MPC /ACE_TAO +/ACE_wrappers /OpenDDS -/MPC + /android-ndk-* /*-toolchain -/jdk -/xerces_source -/iconv_source -/settings.sh -/openssl_source -/ACE_wrappers -/ACE+TAO-2.2a_with_latest_patches.tar.gz -/secdeps_prefix -/android-sdk /commandlinetools-* +/android-sdk + +/Python-* +/openssl-* +/libiconv-* +/xerces-c-* +/secdeps_prefix +/*_source diff --git a/build_python2.sh b/build_python2.sh new file mode 100755 index 0000000..e498500 --- /dev/null +++ b/build_python2.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -o pipefail +set -o errexit +set -o nounset + +echo build_python2.sh ========================================================= + +source setenv.sh +source make.sh + +cd python2_source +./configure +$make diff --git a/get_python2.sh b/get_python2.sh new file mode 100755 index 0000000..ffdf5f1 --- /dev/null +++ b/get_python2.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -o pipefail +set -o errexit +set -o nounset + +echo get_python2.sh =========================================================== + +source setenv.sh + +function get { + if [ ! -d "$ourname" ] + then + if [ ! \( -f $tarname -o -L $tarname \) ] + then + if [ -f ../$tarname -o -L ../$tarname ] + then + ln -s "../$tarname" "$tarname" + elif [ -f ../../$tarname -o -L ../../$tarname ] + then + ln -s "../../$tarname" "$tarname" + else + download_file "$url" + fi + fi + + if ! ${JUST_CACHE_SOURCES:-false} + then + tar -xzf "$tarname" + mv "$basename" "$ourname" + rm -f "$tarname" + fi + fi +} + +version="2.7.18" +basename="Python-$version" +tarname="$basename.tgz" +url="https://www.python.org/ftp/python/$version/$tarname" +ourname="python2_source" +get diff --git a/get_toolchain.sh b/get_toolchain.sh index a910317..c78ddac 100755 --- a/get_toolchain.sh +++ b/get_toolchain.sh @@ -12,9 +12,14 @@ if $need_toolchain && [ ! -d $toolchain_name ] then echo "Generating Standalone Toolchain" py= - if command -v python2 + if [ -x python2_source/python ] then - py=python2 + py=python2_source/python + else + if command -v python2 + then + py=python2 + fi fi $py $OPENDDS_ANDROID_NDK/build/tools/make_standalone_toolchain.py \ --arch $arch --api $api --install-dir $toolchain_name From 9f121aadf8ee7c36a12393a9a6192d1a4e2a043e Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Sun, 11 Aug 2024 18:06:24 -0500 Subject: [PATCH 06/11] Work Around Issue in ACE for Old NDKs --- configure.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/configure.sh b/configure.sh index e9fcecb..0e0e4f1 100755 --- a/configure.sh +++ b/configure.sh @@ -33,7 +33,13 @@ fi if [ $ndk_major_rev -lt 16 ] then - extra_configure_flags+=("--macros=__NDK_MINOR__:=$ndk_minor_rev" "--macros=__NDK_MAJOR__:=$ndk_major_rev") + extra_configure_flags+=( + "--macros=__NDK_MINOR__:=$ndk_minor_rev" + "--macros=__NDK_MAJOR__:=$ndk_major_rev" + # platform_android.GNU should be defining this automatically, but that + # doesn't seem to be working... + '--configh=#define ACE_ANDROID_NDK_MISSING_NDK_VERSION_H' + ) fi if [ $ndk_major_rev -lt 15 ] then @@ -65,11 +71,6 @@ pushd $workspace/OpenDDS > /dev/null "${extra_configure_flags[@]}" popd > /dev/null -# Avoid Deprecated POSIX Functions in ACE that OpenDDS Doesn't Use -echo '#define ACE_DISABLE_MKTEMP' >> "$ace_target/ace/config.h" -echo '#define ACE_DISABLE_TEMPNAM' >> "$ace_target/ace/config.h" -echo '#define ACE_LACKS_READDIR_R' >> "$ace_target/ace/config.h" - if $build_ace_tests then pushd $ace_target/tests > /dev/null From 52b880375ea2899047cd0401ea1be0ae7e890c23 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Sun, 11 Aug 2024 22:25:08 -0500 Subject: [PATCH 07/11] Fix Clang CC Path for 32-bit ARM Also add check to assert that the NDK files we are defining in setenv.sh actually exist. --- .github/workflows/matrix.yml | 3 ++ assert_ndk_files.sh | 60 ++++++++++++++++++++++++++++++++++++ assert_ndk_files_for.sh | 21 +++++++++++++ known_apis.sh | 41 ++++++++++++++++++++++++ matrix.py | 60 +++++++++++++++++++++++++++++------- setenv.sh | 13 +++++--- 6 files changed, 182 insertions(+), 16 deletions(-) create mode 100755 assert_ndk_files.sh create mode 100644 assert_ndk_files_for.sh create mode 100644 known_apis.sh diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 74b8a4c..91869ba 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -50,6 +50,9 @@ jobs: run: | bash get_ndk.sh bash get_toolchain.sh + # This is an extra check for files in the NDK we need to know about. + # This is not part of run.sh + bash assert_ndk_files.sh - name: Get SDK if: ${{ matrix.use_java }} diff --git a/assert_ndk_files.sh b/assert_ndk_files.sh new file mode 100755 index 0000000..daa194e --- /dev/null +++ b/assert_ndk_files.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +set -o pipefail +set -o nounset + +source "known_apis.sh" + +failed=false + +ndks=() +if [ -z "${ndk+x}" ] +then + ndks=(${known_ndks_ndk_only[@]}) +else + ndks=($ndk) +fi + +archs=() +if [ -z "${arch+x}" ] +then + arches=(${known_archs[@]}) +else + arches=($arch) +fi + +for ndk in ${ndks[@]} +do + dir="android-ndk-$ndk" + if [ -d $dir ] + then + for arch in ${arches[@]} + do + echo "$ndk-$arch ======================================================================" + known_apis_name="known_apis_${ndk}_${arch}" + declare -n known_apis=$known_apis_name + this_failed=false + for api in ${known_apis[@]} + do + ndk=$ndk arch=$arch api=$api bash assert_ndk_files_for.sh + if [ $? -ne 0 ] + then + this_failed=true + failed=true + fi + done + if ! $this_failed + then + echo "OK" + fi + done + else + echo "$dir not present !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + fi + +done + +if $failed +then + exit 1 +fi diff --git a/assert_ndk_files_for.sh b/assert_ndk_files_for.sh new file mode 100644 index 0000000..d54d58e --- /dev/null +++ b/assert_ndk_files_for.sh @@ -0,0 +1,21 @@ +source setenv.sh + +failed=false +for var in android_cc android_cxx android_ld android_cpp_stdlib +do + file=${!var} + if [ ! -x "$file" ] + then + if ! $failed + then + echo $api ---------------------------------------------------------------------- + failed=true + fi + echo -e "Missing $var=\e[31m$file\e[0m" + fi +done + +if $failed +then + exit 1 +fi diff --git a/known_apis.sh b/known_apis.sh new file mode 100644 index 0000000..7f9853f --- /dev/null +++ b/known_apis.sh @@ -0,0 +1,41 @@ +# BEGIN MATRIX +# This part is generated by matrix.py +known_archs=('arm' 'arm64' 'x86' 'x86_64') +known_ndks=('r12b' 'r18b' 'r19c' 'r20b' 'r21e' 'r22b' 'r23b') +known_ndks_ndk_only=('r19c' 'r20b' 'r21e' 'r22b' 'r23b') +known_apis_r12b=('16' '17' '18' '19' '21' '22' '23' '24') +known_apis_r12b_arm=('16' '17' '18' '19' '21' '22' '23' '24') +known_apis_r12b_arm64=('24' '21' '22' '23') +known_apis_r12b_x86=('16' '17' '18' '19' '21' '22' '23' '24') +known_apis_r12b_x86_64=('24' '21' '22' '23') +known_apis_r18b=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28') +known_apis_r18b_arm=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28') +known_apis_r18b_arm64=('21' '22' '23' '24' '26' '27' '28') +known_apis_r18b_x86=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28') +known_apis_r18b_x86_64=('21' '22' '23' '24' '26' '27' '28') +known_apis_r19c=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28') +known_apis_r19c_arm=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28') +known_apis_r19c_arm64=('21' '22' '23' '24' '26' '27' '28') +known_apis_r19c_x86=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28') +known_apis_r19c_x86_64=('21' '22' '23' '24' '26' '27' '28') +known_apis_r20b=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r20b_arm=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r20b_arm64=('21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r20b_x86=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r20b_x86_64=('21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r21e=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r21e_arm=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r21e_arm64=('21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r21e_x86=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r21e_x86_64=('21' '22' '23' '24' '26' '27' '28' '29') +known_apis_r22b=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r22b_arm=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r22b_arm64=('21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r22b_x86=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r22b_x86_64=('21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r23b=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r23b_arm=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r23b_arm64=('21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r23b_x86=('16' '17' '18' '19' '21' '22' '23' '24' '26' '27' '28' '29' '30') +known_apis_r23b_x86_64=('21' '22' '23' '24' '26' '27' '28' '29' '30') +# END MATRIX diff --git a/matrix.py b/matrix.py index 1520bd4..f8b37cc 100755 --- a/matrix.py +++ b/matrix.py @@ -23,6 +23,15 @@ ) +all_archs = dict( + # Before 21, Android was 32-bit only + arm=dict(min_api=16, max_api=99999), + arm64=dict(min_api=21,max_api=99999), + x86=dict(min_api=16,max_api=99999), + x86_64=dict(min_api=21,max_api=99999), +) + + def define_ndks(): # Define NDK versions, their min and max API Levels, and if they have # nicknames. @@ -35,11 +44,12 @@ def define_ndks(): Ndk('r12b', 16, 24) -# API Level 20 was Android Wear-only and 25 isn't in the NDK +# API Level 20 was Android Wear-only and 25 isn't in any NDK skip_apis = set([20, 25]) def default_arch(api): + # Before 21, Android was 32-bit only return "arm64" if api >= 21 else "arm" @@ -143,8 +153,10 @@ class Ndk: def __init__(self, name, min_api, max_api, latest_stable=False, latest_lts=False): self.name = name + self.as_tuple = convert_ndk(name) self.min_api = min_api self.max_api = max_api + self.ndk_only = self.as_tuple[0] >= 19 self.latest_stable = latest_stable self.latest_lts = latest_lts self.latest_beta = 'beta' in name @@ -167,6 +179,12 @@ def get(cls, name): def all_apis(self): return list(get_api_range((self.min_api, self.max_api))) + def all_apis_for_arch(self, arch): + arch_info = all_archs[arch] + return list(get_api_range(( + max(self.min_api, arch_info['min_api']), + min(self.max_api, arch_info['max_api'])))) + def apis_by_name(self, name): if name == 'all': return self.all_apis() @@ -183,9 +201,6 @@ def __str__(self): return self.name -define_ndks() - - class Build: '''Represents a single build for a particular Android target with a particular set of options. @@ -234,6 +249,7 @@ def case_format(self, format_str, flag_convert): name=str(self), arch=self.arch, ndk=self.ndk, api=self.api, **format_flags) + class Matrix: '''Represents information about a group of builds. @@ -473,18 +489,36 @@ def default_settings(matrices, file, **kw): print(line, file=file) +def bash_array(l): + return '(' + ' '.join([f"'{e}'" for e in l]) + ')' + + +def known_apis(matrices, file, **kw): + ndks = list(reversed(Ndk.all_ndks.values())) + print('known_archs=' + bash_array(all_archs.keys()), file=file) + print('known_ndks=' + bash_array([ndk.name for ndk in ndks]), file=file) + print('known_ndks_ndk_only=' + bash_array([ndk.name for ndk in ndks if ndk.ndk_only]), file=file) + for ndk in ndks: + apis = bash_array(ndk.all_apis()) + print(f'known_apis_{ndk.name}={apis}', file=file) + for arch in all_archs.keys(): + apis = bash_array(ndk.all_apis_for_arch(arch)) + print(f'known_apis_{ndk.name}_{arch}={apis}', file=file) + + class Kind(Enum): - GhActions = ('.github/workflows/matrix.yml', '# {}', github), - ReadMe = ('README.md', '', readme), + GhActions = ('.github/workflows/matrix.yml', '# {}', github, {}) + ReadMe = ('README.md', '', readme, {}) DefaultSettings = ('default.settings.sh', '# {}', default_settings, { 'pass_before': True, - }), + }) + KnownApis = ('known_apis.sh', '# {}', known_apis, {}) def get_comment(kind, *args, **kw): kind = Kind(kind) sep = kw['sep'] if 'sep' in kw else ' ' - return kind.value[0][1].format(sep.join(args)) + return kind.value[1].format(sep.join(args)) def comment(file, kind, *args, **kw): @@ -498,7 +532,7 @@ def read_file(kind): mode = 0 before = [] after = [] - filename = kind.value[0][0] + filename = kind.value[0] with open(filename) as file: for line in file: if mode == 0: @@ -521,6 +555,9 @@ def __exit__(self, *args): pass +define_ndks() + + matrices = get_matrices() for matrix in matrices: if args.debug: @@ -534,7 +571,8 @@ def __exit__(self, *args): for kind in Kind: opts = { 'pass_before': False, - } if len(kind.value[0]) < 4 else kind.value[0][3] + } + opts.update(kind.value[3]) filename, before, after = read_file(kind) if args.debug: file_context = NullContext() @@ -549,6 +587,6 @@ def __exit__(self, *args): for line in before: print(line, end='', file=file) comment(file, kind, 'This part is generated by matrix.py') - kind.value[0][2](matrices, file, **opts) + kind.value[2](matrices, file, **opts) for line in after: print(line, end='', file=file) diff --git a/setenv.sh b/setenv.sh index 98ca8b0..e12f148 100644 --- a/setenv.sh +++ b/setenv.sh @@ -29,6 +29,7 @@ fi # Convert arch to target and abi if [ "$arch" = "arm" ] then + export target_compiler=armv7a-linux-androideabi export target=arm-linux-androideabi export abi="armeabi-v7a" elif [ "$arch" = "arm64" ] @@ -50,6 +51,9 @@ else echo "Error: \"$arch\" is invalid, must be arm, arm64, x86, or x86_64" 1>&2 exit 1 fi +export target_cpp_stdlib=${target_cpp_stdlib:-$target} +export target_ld=${target_ld:-$target} +export target_compiler=${target_compiler:-$target} # Android NDK export ndk_major_rev=$(./matrix.py --get-ndk-major $ndk) @@ -83,17 +87,16 @@ case $host_os in esac export OPENDDS_ANDROID_NDK="${OPENDDS_ANDROID_NDK-"$workspace/android-ndk-$ndk"}" export android_toolchain_root="${OPENDDS_ANDROID_NDK}/toolchains/llvm/prebuilt/$ndk_platform_name" -export android_cpp_stdlib="${android_toolchain_root}/sysroot/usr/lib/${target}/libc++_shared.so" +export android_cpp_stdlib="${android_toolchain_root}/sysroot/usr/lib/${target_cpp_stdlib}/libc++_shared.so" export android_toolchain_bin="${android_toolchain_root}/bin" -export android_toolchain_prefix="${android_toolchain_bin}/${target}" -export android_ld="${android_toolchain_prefix}-ld" +export android_ld="${android_toolchain_bin}/${target_ld}-ld" if [ $ndk_major_rev -ge 22 ] then - # ${target}-ld doesn't exist in r22. GNU linker is still there under + # ${target_ld}-ld doesn't exist in r22. GNU linker is still there under # different names, but we should use LLVM linker. export android_ld="${android_toolchain_bin}/ld.lld" fi -export android_cc="${android_toolchain_prefix}${api}-clang" +export android_cc="${android_toolchain_bin}/${target_compiler}${api}-clang" export android_cxx="${android_cc}++" export use_toolchain=${use_toolchain-"false"} export need_toolchain=$use_toolchain From 769c5103ee4e957d7f68aa4f4a3ab47f19516774 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Sun, 11 Aug 2024 22:45:45 -0500 Subject: [PATCH 08/11] Temporarily Override OpenDDS For https://github.com/OpenDDS/OpenDDS/pull/4763 --- override_settings.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/override_settings.sh b/override_settings.sh index fefe689..9b87e6a 100644 --- a/override_settings.sh +++ b/override_settings.sh @@ -1,6 +1,6 @@ # Branch from master and add settings here and push to repo to help test PRs -# export OPENDDS_REPO= -# export OPENDDS_BRANCH= +export OPENDDS_REPO=https://github.com/iguessthislldo/OpenDDS +export OPENDDS_BRANCH=igtd/cross-java # export ACE_TAO_REPO= # export ACE_TAO_BRANCH= From 47458b21309d26d51a251a533bb2f33e7439ed5e Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Sun, 11 Aug 2024 22:57:55 -0500 Subject: [PATCH 09/11] Ignore Invalid NDKs in assert_ndk_files.sh --- assert_ndk_files.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assert_ndk_files.sh b/assert_ndk_files.sh index daa194e..668b0a8 100755 --- a/assert_ndk_files.sh +++ b/assert_ndk_files.sh @@ -12,6 +12,11 @@ if [ -z "${ndk+x}" ] then ndks=(${known_ndks_ndk_only[@]}) else + if ! [[ ${known_ndks_ndk_only[@]} =~ "${ndk}" ]] + then + echo "$ndk is invalid !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 0 + fi ndks=($ndk) fi From 6eab00cfc1427c821315a84a05edc31891b7f6a8 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Mon, 12 Aug 2024 09:52:14 -0500 Subject: [PATCH 10/11] Fix Some Typos in README --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 94c8adf..7153b55 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# An ACE/TAO/OpenDDS Build Matrix for Android [![matrix](https://github.com/iguessthislldo/OpenDDS-Android/workflows/matrix/badge.svg)](https://github.com/iguessthislldo/OpenDDS-Android/actions?query=workflow%3Amatrix) +# An ACE/TAO/OpenDDS Build Matrix for Android + +[![matrix](https://github.com/iguessthislldo/OpenDDS-Android/workflows/matrix/badge.svg)](https://github.com/iguessthislldo/OpenDDS-Android/actions?query=workflow%3Amatrix) Scripts for building [OpenDDS](https://github.com/objectcomputing/OpenDDS) against various combinations of Android NDK and API versions on GitHub Actions. @@ -70,8 +72,7 @@ That's it, assuming nothing goes wrong. There are several environment variables that are the normal settings for the build. These all can be found in `default.settings.sh`. The first three: `ndk`, -`arch`, and `api` are required so set to some example values. The rest are -optional. +`arch`, and `api` are required. The rest are optional. In addition to those, what ACE/TAO and OpenDDS it clones can optionally be controlled using `ACE_TAO_REPO`, `ACE_TAO_BRANCH`, `OPENDDS_REPO`, and From 7e343992c1b9ac83fc4da0994e13240d8aaab18d Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Mon, 12 Aug 2024 09:52:41 -0500 Subject: [PATCH 11/11] Revert "Temporarily Override OpenDDS" This reverts commit 769c5103ee4e957d7f68aa4f4a3ab47f19516774. --- override_settings.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/override_settings.sh b/override_settings.sh index 9b87e6a..fefe689 100644 --- a/override_settings.sh +++ b/override_settings.sh @@ -1,6 +1,6 @@ # Branch from master and add settings here and push to repo to help test PRs -export OPENDDS_REPO=https://github.com/iguessthislldo/OpenDDS -export OPENDDS_BRANCH=igtd/cross-java +# export OPENDDS_REPO= +# export OPENDDS_BRANCH= # export ACE_TAO_REPO= # export ACE_TAO_BRANCH=