diff --git a/Android.bp b/Android.bp index f7f86d156b0..35921e01277 100644 --- a/Android.bp +++ b/Android.bp @@ -115,7 +115,7 @@ cc_object { genrule { name: "version_numbers.hpp", srcs: [ - "dependencies.list", + "dependencies.yml", "src/realm/version_numbers.hpp.in", ], out: ["realm/version_numbers.hpp"], diff --git a/CHANGELOG.md b/CHANGELOG.md index accecb82988..3fed1fd8bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ### Internals * Fix several crashes when running the object store benchmarks ([#7403](https://github.com/realm/realm-core/pull/7403)). +* The `dependencies.list` file that defines the realm core library version and the versions of its dependencies is now a YAML file called `dependencies.yml` ([PR #7394](https://github.com/realm/realm-core/pull/7394)). * Remove SetElementEquals and SetElementLessThan, as Mixed now uses the same comparisons as Set did. ---------------------------------------------- diff --git a/Jenkinsfile b/Jenkinsfile index a450d2b919f..3d0b8d849c5 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,8 +28,8 @@ jobWrapper { getSourceArchive() stash includes: '**', name: 'core-source', useDefaultExcludes: false - dependencies = readProperties file: 'dependencies.list' - echo "Version in dependencies.list: ${dependencies.VERSION}" + dependencies = readYaml file: 'dependencies.yml' + echo "Version in dependencies.yml: ${dependencies.VERSION}" gitTag = readGitTag() gitSha = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(8) gitDescribeVersion = sh(returnStdout: true, script: 'git describe --tags').trim() diff --git a/dependencies.list b/dependencies.list deleted file mode 100644 index 07276c9bb74..00000000000 --- a/dependencies.list +++ /dev/null @@ -1,7 +0,0 @@ -PACKAGE_NAME=realm-core -VERSION=14.1.0 -OPENSSL_VERSION=3.2.0 -ZLIB_VERSION=1.2.13 -# https://github.com/10gen/baas/commits -# 5087f is 2024 Jan 13 -BAAS_VERSION=5087ffd5a0e4975e625f0fbcceed23107f611055 diff --git a/dependencies.yml b/dependencies.yml new file mode 100644 index 00000000000..4d500b196c5 --- /dev/null +++ b/dependencies.yml @@ -0,0 +1,7 @@ +PACKAGE_NAME: realm-core +VERSION: 14.1.0 +OPENSSL_VERSION: 3.2.0 +ZLIB_VERSION: 1.2.13 +# https://github.com/10gen/baas/commits +# dd016 is 2024 Feb 22 +BAAS_VERSION: dd01629d83b86292af9c59ebe2a28673c2e559cf diff --git a/evergreen/install_baas.sh b/evergreen/install_baas.sh index 7e636cdfa31..aa009d10eb4 100755 --- a/evergreen/install_baas.sh +++ b/evergreen/install_baas.sh @@ -365,16 +365,16 @@ git config --global url."git@github.com:".insteadOf "https://github.com/" # If a baas branch or commit version was not provided use the one locked in our dependencies if [[ -z "${BAAS_VERSION}" ]]; then - dep_file="dependencies.list" + dep_file="dependencies.yml" test_path1="${BASE_PATH}/../${dep_file}" test_path2="${BASE_PATH}/${dep_file}" if [[ -f "${test_path1}" ]]; then # if this was run locally then check up a directory - get_var_from_file BAAS_VERSION "${test_path1}" + BAAS_VERSION=$(sed -rn 's/^BAAS_VERSION: (.*)/\1/p' < "${test_path1}") elif [[ -f "${test_path2}" ]]; then # if this is run from an evergreen remote host - # then the dependencies.list file has been copied over - get_var_from_file BAAS_VERSION "${test_path2}" + # then the dependencies.yml file has been copied over + BAAS_VERSION=$(sed -rn 's/^BAAS_VERSION: (.*)/\1/p' < "${test_path2}") else echo "could not find '${test_path1}' or '${test_path2}'" ls "${BASE_PATH}/.." diff --git a/evergreen/setup_baas_host_local.sh b/evergreen/setup_baas_host_local.sh index 35c24caf0db..d1cc4e907e4 100755 --- a/evergreen/setup_baas_host_local.sh +++ b/evergreen/setup_baas_host_local.sh @@ -223,9 +223,9 @@ echo "Transferring setup scripts to ${SSH_USER}:${FILE_DEST_DIR}" scp "${SSH_OPTIONS[@]}" -o ConnectTimeout=60 "${BAAS_HOST_VARS}" "${SSH_USER}:${FILE_DEST_DIR}/" # Copy the entire evergreen/ directory from the working copy of realm-core to the remote host # This ensures the remote host the latest copy, esp when running evergreen patches -# dependencies.list contains the BAAS_VERSION to use +# dependencies.yml contains the BAAS_VERSION to use echo "Transferring evergreen scripts to ${SSH_USER}:${FILE_DEST_DIR}" -cp "${EVERGREEN_PATH}/../dependencies.list" "${EVERGREEN_PATH}/" +cp "${EVERGREEN_PATH}/../dependencies.yml" "${EVERGREEN_PATH}/" scp -r "${SSH_OPTIONS[@]}" -o ConnectTimeout=60 "${EVERGREEN_PATH}/" "${SSH_USER}:${FILE_DEST_DIR}/" BAAS_TUNNELS=() diff --git a/tools/cmake/GetVersion.cmake b/tools/cmake/GetVersion.cmake index e0c5649f5f6..dde82d0ba55 100644 --- a/tools/cmake/GetVersion.cmake +++ b/tools/cmake/GetVersion.cmake @@ -1,13 +1,17 @@ -file(STRINGS "${RealmCore_SOURCE_DIR}/dependencies.list" DEPENDENCIES) +file(STRINGS "${RealmCore_SOURCE_DIR}/dependencies.yml" DEPENDENCIES) set(VALID_DEPENDENCIES "") foreach(LINE IN LISTS DEPENDENCIES) - string(REGEX MATCHALL "([^=]+)" KEY_VALUE ${LINE}) + string(REGEX MATCHALL "([^:]+)" KEY_VALUE ${LINE}) list(LENGTH KEY_VALUE MATCH_SIZE) if (MATCH_SIZE GREATER_EQUAL 2) list(GET KEY_VALUE 0 KEY) + if ("${KEY}" MATCHES "^#") + continue() + endif() list(GET KEY_VALUE 1 VALUE) - set(DEP_${KEY} ${VALUE}) - set(VALID_DEPENDENCIES "${VALID_DEPENDENCIES} ${LINE}") + string(STRIP "${VALUE}" STRIPPED_VALUE) + set(DEP_${KEY} ${STRIPPED_VALUE}) + set(VALID_DEPENDENCIES "${VALID_DEPENDENCIES} ${KEY}=\"${STRIPPED_VALUE}\"") endif() endforeach() diff --git a/tools/generate-version-numbers-for-soong.sh b/tools/generate-version-numbers-for-soong.sh index 2f24d3ff228..1d53bccb1be 100755 --- a/tools/generate-version-numbers-for-soong.sh +++ b/tools/generate-version-numbers-for-soong.sh @@ -1,8 +1,7 @@ #!/bin/bash -source $1 - -version_and_extra=( ${VERSION//-/ } ) +realm_version=$(sed -rn 's/^VERSION: (.*)/\1/p' < "$1") +version_and_extra=( ${$realm_version//-/ } ) version_only=${version_and_extra[0]} extra=${version_and_extra[1]} diff --git a/tools/release-init.sh b/tools/release-init.sh index d4628678ec2..aabfb7e8bae 100755 --- a/tools/release-init.sh +++ b/tools/release-init.sh @@ -17,9 +17,9 @@ git branch release/${realm_version} git push -u origin release/${realm_version} git checkout -b prepare-$realm_version -# update dependencies.list -sed -i.bak -e "s/^VERSION.*/VERSION=${realm_version}/" "${project_dir}/dependencies.list" -rm "${project_dir}/dependencies.list.bak" || exit 1 +# update dependencies.yml +sed -i.bak -e "s/^VERSION.*/VERSION: ${realm_version}/" "${project_dir}/dependencies.yml" +rm "${project_dir}/dependencies.yml.bak" || exit 1 # update Package.swift sed -i.bak -e "s/^let versionStr =.*/let versionStr = \"${realm_version}\"/" "${project_dir}/Package.swift" diff --git a/tools/release-tag.sh b/tools/release-tag.sh index a76611b451c..d6a7314a872 100755 --- a/tools/release-tag.sh +++ b/tools/release-tag.sh @@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi project_dir=$(git rev-parse --show-toplevel) -realm_version=$(grep ^VERSION "${project_dir}/dependencies.list" | cut -f 2 -d=) +realm_version=$(sed -rn 's/^VERSION: (.*)/\1/p' < "${project_dir}/dependencies.yml") tag=v${realm_version} git tag -m \""$1"\" "${tag}" git push origin "${tag}"