Skip to content

Commit

Permalink
RCORE-1928 Make dependencies.list a YAML file (#7394)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreams authored Mar 6, 2024
1 parent 919a4b1 commit b4b01be
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

----------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 0 additions & 7 deletions dependencies.list

This file was deleted.

7 changes: 7 additions & 0 deletions dependencies.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions evergreen/install_baas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,16 @@ git config --global url."[email protected]:".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}/.."
Expand Down
4 changes: 2 additions & 2 deletions evergreen/setup_baas_host_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=()
Expand Down
12 changes: 8 additions & 4 deletions tools/cmake/GetVersion.cmake
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
5 changes: 2 additions & 3 deletions tools/generate-version-numbers-for-soong.sh
Original file line number Diff line number Diff line change
@@ -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]}

Expand Down
6 changes: 3 additions & 3 deletions tools/release-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/release-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit b4b01be

Please sign in to comment.