Skip to content

Commit df3767f

Browse files
authored
Merge pull request #437 from datastax/2.11.0_prep
2.11.0 prep
2 parents 6eed698 + 2655098 commit df3767f

File tree

206 files changed

+8164
-4120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+8164
-4120
lines changed

.build.linux.sh

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#!/bin/bash
2+
##
3+
# Copyright (c) DataStax, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
##
17+
18+
configure_environment() {
19+
if ! grep -lq "127.254.254.254" /etc/hosts; then
20+
printf "\n\n%s\n" "127.254.254.254 cpp-driver.hostname." | sudo tee -a /etc/hosts
21+
fi
22+
sudo cat /etc/hosts
23+
}
24+
25+
install_libuv() {(
26+
cd packaging
27+
git clone --depth 1 https://github.com/datastax/libuv-packaging.git
28+
29+
(
30+
cd libuv-packaging
31+
32+
# Ensure build directory is cleaned (static nodes are not cleaned)
33+
[[ -d build ]] && rm -rf build
34+
mkdir build
35+
36+
if [ "${OS_NAME}" = "ubuntu" ]; then
37+
./build_deb.sh ${LIBUV_VERSION}
38+
else
39+
./build_rpm.sh ${LIBUV_VERSION}
40+
fi
41+
)
42+
43+
[[ -d packages ]] || mkdir packages
44+
find libuv-packaging/build -type f \( -name "*.deb" -o -name "*.rpm" \) -exec mv {} packages \;
45+
46+
if [ "${OS_NAME}" = "ubuntu" ]; then
47+
sudo dpkg -i packages/libuv*.deb
48+
else
49+
sudo rpm -i packages/libuv*.rpm
50+
fi
51+
)}
52+
53+
install_openssl() {
54+
true # Already installed on image
55+
}
56+
57+
install_driver() {(
58+
cd packaging
59+
60+
(
61+
# Ensure build directory is cleaned (static nodes are not cleaned)
62+
[[ -d build ]] && rm -rf build
63+
mkdir build
64+
65+
if [ "${OS_NAME}" = "ubuntu" ]; then
66+
./build_deb.sh
67+
else
68+
./build_rpm.sh
69+
fi
70+
)
71+
72+
[[ -d packages ]] || mkdir packages
73+
find build -type f \( -name "*.deb" -o -name "*.rpm" \) -exec mv {} packages \;
74+
75+
if [ "${OS_NAME}" = "ubuntu" ]; then
76+
sudo dpkg -i packages/*cpp-driver*.deb
77+
else
78+
sudo rpm -i packages/*cpp-driver*.rpm
79+
fi
80+
)}
81+
82+
test_installed_driver() {
83+
local driver=$1
84+
85+
local test_program=$(mktemp)
86+
gcc -x c -o ${test_program} - -Wno-implicit-function-declaration -l${driver} - <<EOF
87+
#include <${driver}.h>
88+
89+
int main(int argc, char* argv[]) {
90+
CassFuture* connect_future = NULL;
91+
CassCluster* cluster = cass_cluster_new();
92+
CassSession* session = cass_session_new();
93+
94+
cass_cluster_set_contact_points(cluster, "127.0.0.1");
95+
connect_future = cass_session_connect(session, cluster);
96+
cass_future_wait(connect_future);
97+
printf("Success");
98+
return 0;
99+
}
100+
EOF
101+
102+
if [ $? -ne 0 ] ; then
103+
echo "Connection test compilation failed. Marking build as failure."
104+
exit 1
105+
fi
106+
if [ "$($test_program)" != "Success" ] ; then
107+
echo "Connection test did not return success. Marking build as failure."
108+
exit 1
109+
fi
110+
}
111+

.build.osx.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
##
3+
# Copyright (c) DataStax, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
##
17+
18+
configure_environment() {
19+
true
20+
}
21+
22+
install_libuv() {
23+
if brew ls --versions libuv > /dev/null; then
24+
if ! brew outdated libuv; then
25+
brew upgrade --cleanup libuv
26+
fi
27+
else
28+
brew install libuv
29+
fi
30+
}
31+
32+
install_openssl() {
33+
if brew ls --versions openssl > /dev/null; then
34+
if ! brew outdated openssl; then
35+
brew upgrade --cleanup openssl
36+
fi
37+
else
38+
brew install openssl
39+
fi
40+
}
41+
42+
install_driver() {
43+
true
44+
}
45+
46+
test_installed_driver() {
47+
true
48+
}
49+

.build.sh

Lines changed: 15 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@
2121
set -e #Fail fast on non-zero exit status
2222

2323
WORKER_INFORMATION=($(echo ${OS_VERSION} | tr "/" " "))
24-
DISTRO=${WORKER_INFORMATION[0]}
24+
OS_NAME=${WORKER_INFORMATION[0]}
2525
RELEASE=${WORKER_INFORMATION[1]}
2626
SHA=$(echo ${GIT_COMMIT} | cut -c1-7)
27-
PROCS=$(grep -e '^processor' -c /proc/cpuinfo)
27+
28+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
29+
if [ "${OS_NAME}" = "osx" ]; then
30+
PROCS=$(sysctl -n hw.logicalcpu)
31+
. ${SCRIPT_DIR}/.build.osx.sh
32+
else
33+
PROCS=$(grep -e '^processor' -c /proc/cpuinfo)
34+
. ${SCRIPT_DIR}/.build.linux.sh
35+
fi
2836

2937
get_driver_version() {
3038
local header_file=$1
@@ -50,106 +58,25 @@ get_driver_version() {
5058
echo "${driver_version}"
5159
}
5260

53-
configure_environment() {
54-
if ! grep -lq "127.254.254.254" /etc/hosts; then
55-
printf "\n\n%s\n" "127.254.254.254 cpp-driver.hostname." | sudo tee -a /etc/hosts
56-
fi
57-
sudo cat /etc/hosts
58-
}
59-
60-
install_libuv() {
61-
(
62-
cd packaging
63-
git clone --depth 1 https://github.com/datastax/libuv-packaging.git
64-
65-
(
66-
cd libuv-packaging
67-
if [ "${DISTRO}" = "ubuntu" ]; then
68-
./build_deb.sh ${LIBUV_VERSION}
69-
else
70-
./build_rpm.sh ${LIBUV_VERSION}
71-
fi
72-
)
73-
74-
[[ -d packages ]] || mkdir packages
75-
find libuv-packaging/build -type f \( -name "*.deb" -o -name "*.rpm" \) -exec mv {} packages \;
76-
77-
if [ "${DISTRO}" = "ubuntu" ]; then
78-
sudo dpkg -i packages/libuv*.deb
79-
else
80-
sudo rpm -i packages/libuv*.rpm
81-
fi
82-
)
83-
}
84-
8561
install_dependencies() {
8662
install_libuv
63+
install_openssl
8764
}
8865

8966
build_driver() {
9067
local driver_prefix=$1
9168

69+
# Ensure build directory is cleaned (static nodes are not cleaned)
70+
[[ -d build ]] && rm -rf build
71+
mkdir build
72+
9273
(
93-
[[ -d build ]] || mkdir build
9474
cd build
9575
cmake -DCMAKE_BUILD_TYPE=Release -D${driver_prefix}_BUILD_SHARED=On -D${driver_prefix}_BUILD_STATIC=On -D${driver_prefix}_BUILD_EXAMPLES=On -D${driver_prefix}_BUILD_UNIT_TESTS=On ..
9676
make -j${PROCS}
9777
)
9878
}
9979

100-
install_driver() {
101-
(
102-
cd packaging
103-
104-
(
105-
if [ "${DISTRO}" = "ubuntu" ]; then
106-
./build_deb.sh
107-
else
108-
./build_rpm.sh
109-
fi
110-
)
111-
112-
[[ -d packages ]] || mkdir packages
113-
find build -type f \( -name "*.deb" -o -name "*.rpm" \) -exec mv {} packages \;
114-
115-
if [ "${DISTRO}" = "ubuntu" ]; then
116-
sudo dpkg -i packages/*cpp-driver*.deb
117-
else
118-
sudo rpm -i packages/*cpp-driver*.rpm
119-
fi
120-
)
121-
}
122-
123-
test_installed_driver() {
124-
local driver=$1
125-
126-
local test_program=$(mktemp)
127-
gcc -x c -o ${test_program} - -Wno-implicit-function-declaration -l${driver} - <<EOF
128-
#include <${driver}.h>
129-
130-
int main(int argc, char* argv[]) {
131-
CassFuture* connect_future = NULL;
132-
CassCluster* cluster = cass_cluster_new();
133-
CassSession* session = cass_session_new();
134-
135-
cass_cluster_set_contact_points(cluster, "127.0.0.1");
136-
connect_future = cass_session_connect(session, cluster);
137-
cass_future_wait(connect_future);
138-
printf("Success");
139-
return 0;
140-
}
141-
EOF
142-
143-
if [ $? -ne 0 ] ; then
144-
echo "Connection test compilation failed. Marking build as failure."
145-
exit 1
146-
fi
147-
if [ "$($test_program)" != "Success" ] ; then
148-
echo "Connection test did not return success. Marking build as failure."
149-
exit 1
150-
fi
151-
}
152-
15380
check_driver_exports() {(
15481
set +e #Disable fail fast for this subshell
15582
local driver_library=$1

.nav

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
topics
2+
changelog
3+
api

0 commit comments

Comments
 (0)