Skip to content

Commit ecb0268

Browse files
authored
Update build & dependencies (#464)
* Update SBT build * Close #455, #459, #460, #461, #462, #463 - Update dependencies
1 parent eb81e27 commit ecb0268

10 files changed

Lines changed: 210 additions & 28 deletions

File tree

.ci_scripts/beforeInstall.sh

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /bin/bash
2+
set -euo pipefail
23

34
# Clean cache
45
rm -rf "$HOME/.ivy2/local/org.reactivemongo"
@@ -17,28 +18,42 @@ SSL_MAJOR="1.0.0"
1718
SSL_SUFFIX="10"
1819
SSL_RELEASE="1.0.2"
1920
SSL_FULL_RELEASE="1.0.2u"
20-
SSL_DL_URL="https://www.openssl.org/source/old/$SSL_RELEASE/openssl-$SSL_FULL_RELEASE.tar.gz"
21+
SSL_GH_TAG="OpenSSL_1_0_2u"
22+
SSL_DL_URL="https://github.com/openssl/openssl/releases/download/${SSL_GH_TAG}/openssl-${SSL_FULL_RELEASE}.tar.gz"
23+
SSL_HOME="$HOME/ssl"
24+
SSL_LIB="$SSL_HOME/lib"
2125

22-
if [ ! -L "$HOME/ssl/lib/libssl.so.$SSL_MAJOR" ] && [ ! -f "$HOME/ssl/lib/libcrypto.so.$SSL_MAJOR" ]; then
26+
if [ ! -f "$SSL_LIB/libssl.so.$SSL_MAJOR" ] || [ ! -f "$SSL_LIB/libcrypto.so.$SSL_MAJOR" ]; then
2327
echo "[INFO] Building OpenSSL $SSL_MAJOR ..."
2428

2529
cd /tmp
2630

2731
echo "[INFO] Downloading OpenSSL from $SSL_DL_URL ..."
28-
curl -L -s -o - "$SSL_DL_URL" | tar -xzf -
32+
curl -fL -s -o - "$SSL_DL_URL" | tar -xzf -
2933

30-
cd openssl-$SSL_FULL_RELEASE
31-
rm -rf "$HOME/ssl" && mkdir "$HOME/ssl"
32-
./config -shared enable-ssl2 --prefix="$HOME/ssl" > /dev/null
34+
cd "openssl-${SSL_FULL_RELEASE}"
35+
rm -rf "$SSL_HOME" && mkdir "$SSL_HOME"
36+
37+
echo "[INFO] Configuring OpenSSL build ..."
38+
./config -shared enable-ssl2 --prefix="$SSL_HOME" > /dev/null
39+
40+
echo "[INFO] Resolving dependencies for OpenSSL build ..."
3341
make depend > /dev/null
42+
43+
echo "[INFO] Building and installing OpenSSL ..."
3444
make install > /dev/null
45+
fi
3546

36-
ln -s "$HOME/ssl/lib/libssl.so.$SSL_MAJOR" "$HOME/ssl/lib/libssl.so.$SSL_SUFFIX"
37-
ln -s "$HOME/ssl/lib/libcrypto.so.$SSL_MAJOR" "$HOME/ssl/lib/libcrypto.so.$SSL_SUFFIX"
47+
if [ ! -d "$SSL_LIB" ] || [ ! -f "$SSL_LIB/libssl.so.$SSL_MAJOR" ] || [ ! -f "$SSL_LIB/libcrypto.so.$SSL_MAJOR" ]; then
48+
echo "[ERROR] OpenSSL libraries are missing in $SSL_LIB"
49+
exit 1
3850
fi
3951

40-
export PATH="$HOME/ssl/bin:$PATH"
41-
export LD_LIBRARY_PATH="$HOME/ssl/lib:$LD_LIBRARY_PATH"
52+
ln -sf "$SSL_LIB/libssl.so.$SSL_MAJOR" "$SSL_LIB/libssl.so.$SSL_SUFFIX"
53+
ln -sf "$SSL_LIB/libcrypto.so.$SSL_MAJOR" "$SSL_LIB/libcrypto.so.$SSL_SUFFIX"
54+
55+
export PATH="$SSL_HOME/bin:$PATH"
56+
export LD_LIBRARY_PATH="$SSL_LIB:${LD_LIBRARY_PATH:-}"
4257

4358
# Build MongoDB
4459
MONGO_MINOR="3.6.6"
@@ -60,6 +75,12 @@ if [ ! -x "$MONGO_HOME/bin/mongod" ]; then
6075
chmod u+x "$MONGO_HOME/bin/mongod"
6176
fi
6277

78+
if ldd "$MONGO_HOME/bin/mongod" | grep -q 'not found'; then
79+
echo "[ERROR] Missing shared libraries for $MONGO_HOME/bin/mongod"
80+
ldd "$MONGO_HOME/bin/mongod"
81+
exit 1
82+
fi
83+
6384
echo "[INFO] MongoDB available at $MONGO_HOME"
6485

6586
PATH="$MONGO_HOME/bin:$PATH"
@@ -82,9 +103,26 @@ echo " maxIncomingConnections: $MAX_CON" >> /tmp/mongod.conf
82103
echo "# MongoDB Configuration:"
83104
cat /tmp/mongod.conf
84105

106+
for cmd in mongod mongo; do
107+
if command -v "$cmd" >/dev/null 2>&1; then
108+
echo "[INFO] $cmd location: $(command -v "$cmd")"
109+
else
110+
echo "[ERROR] Missing executable: $cmd"
111+
exit 1
112+
fi
113+
done
114+
115+
if ldd "$(command -v mongo)" | grep -q 'not found'; then
116+
echo "[ERROR] Missing shared libraries for $(command -v mongo)"
117+
ldd "$(command -v mongo)"
118+
exit 1
119+
fi
120+
85121
# Export environment for integration tests
86122

87123
cat > /tmp/integration-env.sh <<EOF
88-
PATH="$PATH"
89-
LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
124+
export PATH="$PATH"
125+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
90126
EOF
127+
128+
echo "[INFO] Integration environment exported to /tmp/integration-env.sh"

.ci_scripts/fork-mongod.sh

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#! /usr/bin/env bash
22

3+
set -euo pipefail
4+
35
ENV_FILE="$1"
46

57
if [ -r "$ENV_FILE" ]; then
@@ -9,10 +11,90 @@ fi
911
export LD_LIBRARY_PATH
1012
export PATH
1113

12-
MONGOD_CMD="mongod -f $MONGO_CONF --fork"
14+
if [ -z "${MONGO_CONF:-}" ]; then
15+
echo "[ERROR] MONGO_CONF is not set"
16+
exit 1
17+
fi
18+
19+
if [ ! -r "$MONGO_CONF" ]; then
20+
echo "[ERROR] MongoDB config is not readable: $MONGO_CONF"
21+
exit 1
22+
fi
23+
24+
echo "[INFO] Starting mongod with config: $MONGO_CONF"
25+
echo "[INFO] PATH: $PATH"
26+
echo "[INFO] LD_LIBRARY_PATH: ${LD_LIBRARY_PATH:-<empty>}"
27+
28+
if ! command -v mongod >/dev/null 2>&1; then
29+
echo "[ERROR] mongod command not found"
30+
exit 1
31+
fi
32+
33+
check_mongod_socket() {
34+
if command -v ss >/dev/null 2>&1; then
35+
ss -lnt 2>/dev/null | grep -Eq '[:.]27017[[:space:]]'
36+
return $?
37+
fi
1338

14-
if [ `which numactl | wc -l` -gt 0 ]; then
15-
numactl --interleave=all $MONGOD_CMD
39+
if command -v netstat >/dev/null 2>&1; then
40+
netstat -lnt 2>/dev/null | grep -Eq '[:.]27017[[:space:]]'
41+
return $?
42+
fi
43+
44+
return 1
45+
}
46+
47+
MONGOD_ARGS=(mongod -f "$MONGO_CONF" --fork)
48+
49+
if command -v numactl >/dev/null 2>&1; then
50+
MONGOD_ARGS=(numactl --interleave=all "${MONGOD_ARGS[@]}")
51+
fi
52+
53+
set +e
54+
START_OUTPUT=$("${MONGOD_ARGS[@]}" 2>&1)
55+
START_STATUS=$?
56+
set -e
57+
58+
if [ -n "$START_OUTPUT" ]; then
59+
echo "$START_OUTPUT"
60+
fi
61+
62+
MONGOD_COUNT=$(ps -ef | grep '[m]ongod' | wc -l)
63+
SOCKET_READY=0
64+
65+
if check_mongod_socket; then
66+
SOCKET_READY=1
67+
fi
68+
69+
if [ "$START_STATUS" -ne 0 ]; then
70+
echo "[WARN] mongod --fork returned non-zero status: $START_STATUS"
71+
fi
72+
73+
if [ "$MONGOD_COUNT" -gt 0 ]; then
74+
echo "[INFO] mongod process count: $MONGOD_COUNT"
75+
else
76+
echo "[WARN] No mongod process currently detected"
77+
fi
78+
79+
if [ "$SOCKET_READY" -eq 1 ]; then
80+
echo "[INFO] mongod is listening on port 27017"
1681
else
17-
$MONGOD_CMD
82+
echo "[WARN] Could not confirm listening socket on port 27017"
83+
fi
84+
85+
if [ "$START_STATUS" -ne 0 ] && [ "$MONGOD_COUNT" -eq 0 ] && [ "$SOCKET_READY" -eq 0 ]; then
86+
echo "[ERROR] mongod did not start successfully"
87+
ps -ef | grep '[m]ongod' || true
88+
89+
if command -v ss >/dev/null 2>&1; then
90+
ss -lntp || true
91+
elif command -v netstat >/dev/null 2>&1; then
92+
netstat -lnt || true
93+
fi
94+
95+
if [ -r /tmp/mongod.log ]; then
96+
cat /tmp/mongod.log
97+
fi
98+
99+
exit "$START_STATUS"
18100
fi

.ci_scripts/validate.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
source /tmp/integration-env.sh
66

77
export LD_LIBRARY_PATH
8+
export PATH
89

910
SCRIPT_DIR=`dirname $0 | sed -e "s|^\./|$PWD/|"`
1011

.circleci/config.yml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,66 @@ commands:
5353
command: |
5454
export MONGO_CONF="/tmp/mongod.conf"
5555
./.ci_scripts/fork-mongod.sh /tmp/integration-env.sh
56-
background: true
56+
57+
- run:
58+
name: Check MongoDB readiness
59+
command: |
60+
. /tmp/integration-env.sh
61+
62+
echo "[INFO] Checking MongoDB readiness"
63+
echo "[INFO] PATH=$PATH"
64+
echo "[INFO] LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-<empty>}"
65+
echo "[INFO] Hosts entry for localhost:"
66+
getent hosts localhost || true
67+
echo "[INFO] IPv4 entry for localhost:"
68+
getent ahostsv4 localhost || true
69+
70+
if command -v mongo >/dev/null 2>&1; then
71+
echo "[INFO] mongo location: $(command -v mongo)"
72+
else
73+
echo "[ERROR] mongo client is not available in PATH"
74+
exit 1
75+
fi
76+
77+
for _ in `seq 1 20`; do
78+
for MONGO_HOST in 127.0.0.1 localhost; do
79+
PING_STATUS=0
80+
PING_OUTPUT=""
81+
82+
if PING_OUTPUT=$(mongo --quiet "mongodb://${MONGO_HOST}:27017/admin" --eval 'db.runCommand({ ping: 1 }).ok' 2>&1); then
83+
PING_STATUS=0
84+
else
85+
PING_STATUS=$?
86+
fi
87+
88+
if echo "$PING_OUTPUT" | grep -q '^1$'; then
89+
echo "[INFO] MongoDB is ready on ${MONGO_HOST}:27017"
90+
exit 0
91+
fi
92+
93+
if [ -n "$PING_OUTPUT" ]; then
94+
echo "[DEBUG] mongo ping non-ready output on ${MONGO_HOST}: ${PING_OUTPUT}"
95+
fi
96+
97+
if [ "$PING_STATUS" -ne 0 ]; then
98+
echo "[DEBUG] mongo ping failed on ${MONGO_HOST}: status=${PING_STATUS}, output=${PING_OUTPUT}"
99+
fi
100+
done
101+
102+
sleep 1
103+
done
104+
105+
echo "MongoDB did not become ready"
106+
ps -ef | grep '[m]ongod' || true
107+
if command -v ss >/dev/null 2>&1; then
108+
ss -lntp || true
109+
elif command -v netstat >/dev/null 2>&1; then
110+
netstat -lnt || true
111+
fi
112+
if [ -r /tmp/mongod.log ]; then
113+
cat /tmp/mongod.log
114+
fi
115+
exit 1
57116
58117
build_n_tests:
59118
description: Build & Run tests
@@ -159,7 +218,7 @@ jobs:
159218
environment:
160219
AKKA_VERSION: 2.6.21
161220
ITERATEES_VERSION: no
162-
SCALA_VERSION: 3.3
221+
SCALA_VERSION: 3.4.3
163222

164223
steps:
165224
- checkout

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.10.7
1+
version = 3.11.0
22
runner.dialect = Scala213Source3
33

44
newlines.alwaysBeforeElseAfterCurlyIf = false

akka-stream/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ libraryDependencies ++= Dependencies.shared.value ++ Seq(
4949
"com.typesafe.akka" %% "akka-stream-testkit" % akkaVer.value % Test
5050
)
5151

52-
libraryDependencies += "commons-codec" % "commons-codec" % "1.21.0" % Test
52+
libraryDependencies += "commons-codec" % "commons-codec" % "1.22.0" % Test
5353

5454
// MiMa
5555
mimaBinaryIssueFilters ++= {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ThisBuild / organization := "org.reactivemongo"
44

55
ThisBuild / scalaVersion := "2.12.21"
66

7-
val scala3Lts = "3.3.7"
7+
val scala3Lts = "3.4.3"
88

99
ThisBuild / crossScalaVersions := Seq(
1010
"2.11.12",

pekko-stream/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Test / sources := {
3737
}
3838
}
3939

40-
val pekkoVer = "1.4.0"
40+
val pekkoVer = "1.5.0"
4141

4242
libraryDependencies ++= Dependencies.shared.value ++ Seq(
4343
"org.apache.pekko" %% "pekko-stream" % pekkoVer,

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.12.4
1+
sbt.version=1.12.9

project/plugins.sbt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
resolvers ++= Seq(
2-
"Tatami Releases" at "https://raw.github.com/cchantep/tatami/master/releases"
2+
"Tatami Releases" at "https://raw.github.com/cchantep/tatami/master/releases",
3+
"Tatami Snapshots" at "https://raw.github.com/cchantep/tatami/master/snapshots",
4+
Resolver.mavenLocal
35
)
46

57
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.6.1")
68

79
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
810

9-
addSbtPlugin("cchantep" % "sbt-scaladoc-compiler" % "0.6")
11+
addSbtPlugin("cchantep" % "sbt-scaladoc-compiler" % "0.7-SNAPSHOT")
1012

11-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.6")
13+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.0")
1214

13-
addSbtPlugin("cchantep" % "sbt-hl-compiler" % "0.9")
15+
addSbtPlugin("cchantep" % "sbt-hl-compiler" % "0.10-SNAPSHOT")
1416

1517
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.5")
1618

1719
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
1820

1921
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.1")
2022

21-
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.5")
23+
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.6")

0 commit comments

Comments
 (0)