Skip to content

Commit 65d919b

Browse files
authored
Update ubuntu version (#671)
* Update to ubuntu 20.04
1 parent 92f904d commit 65d919b

27 files changed

+290
-88
lines changed

.github/workflows/matrix.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"include": [
33
{
4-
"DOCKER_TAG": "2023.12.0",
5-
"OPERATING_SYSTEM_TAG": "18.04",
4+
"DOCKER_TAG": "2024.03.0",
5+
"OPERATING_SYSTEM_TAG": "20.04",
66
"LLVM_VERSION_MAJOR": "14"
77
}
88
]

DEVNOTE.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ needed dependencies such as Git, LLVM, GRPC, GoogleTest and others. **base_env**
1111
dates. If you are developing the tool, you are most likely to need the most recent version
1212
from [here](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env).
1313

14-
Supported and tested development configuration are Ubuntu 18.04 / 20.04 or Windows Subsystem for Linux (Ubuntu 18.04 /
15-
20.04).
14+
Supported and tested development configuration are Ubuntu 20.04 or Windows Subsystem for Linux (Ubuntu 20.04).
1615

1716
1. Install docker for [Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
1817
or [WSL+Ubuntu](https://docs.docker.com/desktop/windows/wsl/)
@@ -112,4 +111,4 @@ Extensions > UnitTestBot. After UTBot configuration, you can select your source
112111
toolbar on the left. Then, you can generate tests with the use of Command Palette. Press **F1** and type in "UTBot": You
113112
will see tests generation options.
114113

115-
## [Troubleshooting](https://github.com/UnitTestBot/UTBotCpp/wiki/troubleshooting)
114+
## [Troubleshooting](https://github.com/UnitTestBot/UTBotCpp/wiki/troubleshooting)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ More info on [wiki](https://github.com/UnitTestBot/UTBotCpp/wiki)
1616

1717
## How to install and use UTBot
1818

19-
For now, you can only use UTBot under Ubuntu 18.04 and above.
19+
For now, you can only use UTBot under Ubuntu 20.04 and above.
2020
Navigate to the [**Releases**](https://github.com/UnitTestBot/UTBotCpp/releases) GitHub page and download last version of UTBot.
2121

2222
UTBot is distrbuted as an archive that contains:

build.sh

+3
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ pwd=$PWD
55
chmod +x $pwd/submodules/build-klee.sh $pwd/submodules/Bear/build.sh $pwd/server/build.sh
66
cd $pwd/submodules && ./build-klee.sh
77
cd $pwd/submodules/Bear && ./build.sh
8+
if [ "$1" = "gh" ]; then
9+
rm -rf submodules
10+
fi
811
cd $pwd/server && ./build.sh

docker/Dockerfile_base

+17-22
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ RUN echo "Set disable_coredump false" >> /etc/sudo.conf
1818
WORKDIR docker
1919

2020
# Install required system packages
21-
RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install sudo file python3-dateutil wget fakeroot libssl-dev build-essential software-properties-common
21+
RUN apt update
22+
RUN DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends sudo file python3-dateutil wget fakeroot libssl-dev build-essential \
23+
software-properties-common
2224
RUN echo "check_certificate = off" > /etc/wgetrc
2325

2426
# We use C++ 17 for UnitTestBot, it is available in gcc-9; default gcc for ubuntu:18.04 is gcc-7
25-
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
27+
RUN if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]] ; then RUN add-apt-repository ppa:ubuntu-toolchain-r/test ; fi
2628
RUN apt update && apt install -y --no-install-recommends gcc-9 g++-9 gcc-multilib g++-multilib gcc-9-multilib g++-9-multilib
2729

2830
# Set gcc-9 as default gcc version
@@ -31,22 +33,15 @@ RUN sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100
3133
RUN sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 100
3234

3335
# install git
34-
RUN apt install -y software-properties-common
35-
RUN apt update
36-
RUN add-apt-repository -y ppa:git-core/ppa
37-
RUN apt update
38-
RUN apt install -y git libcurl4-openssl-dev
36+
RUN apt install -y software-properties-common git libcurl4-openssl-dev
3937

4038
# install others apt
41-
RUN apt install -y --no-install-recommends ninja-build python3-setuptools
42-
RUN apt install -y --no-install-recommends curl libcap-dev libncurses5-dev unzip libtcmalloc-minimal4 libgoogle-perftools-dev libsqlite3-dev doxygen python3-pip
43-
RUN apt -y install autoconf libtool
39+
RUN apt install -y --no-install-recommends ninja-build python3-setuptools curl libcap-dev libncurses5-dev unzip \
40+
libtcmalloc-minimal4 libgoogle-perftools-dev libsqlite3-dev doxygen python3-pip autoconf libtool
4441

4542
# install vscode dependencies
46-
RUN apt install -y libxshmfence1 libglu1
47-
RUN apt install -y libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev
48-
RUN apt install -y libasound2
49-
RUN apt install -y xvfb
43+
RUN apt install -y libxshmfence1 libglu1 libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 \
44+
libgbm-dev libnss3-dev libxss-dev libasound2 xvfb
5045

5146
RUN mkdir $UTBOT_ALL && cd $UTBOT_ALL
5247

@@ -75,15 +70,15 @@ RUN git clone --single-branch --branch "release/${LLVM_VERSION_MAJOR}.x" --depth
7570
WORKDIR $UTBOT_ALL/llvm-project
7671
RUN mkdir build && cd build \
7772
&& $UTBOT_CMAKE_BINARY \
78-
-DCMAKE_BUILD_TYPE=Release \
73+
-DCMAKE_BUILD_TYPE=MinSizeRel \
7974
-DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR \
8075
-DLLVM_INCLUDE_TESTS=OFF \
8176
-DLLVM_BINUTILS_INCDIR=$UTBOT_ALL/llvm_gold_plugin \
8277
-DLLVM_ENABLE_RTTI=ON \
8378
-DLLVM_ENABLE_EH=ON \
8479
-DLLVM_TARGETS_TO_BUILD="host" \
8580
-DLLVM_INSTALL_UTILS=ON \
86-
-DLLVM_ENABLE_PROJECTS="clang;libclc;lld;lldb;clang-tools-extra" \
81+
-DLLVM_ENABLE_PROJECTS="clang;libclc;lld" \
8782
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libc;libcxx;libcxxabi" \
8883
-G "Ninja" ../llvm \
8984
&& $UTBOT_CMAKE_BINARY --build . --target install
@@ -110,7 +105,7 @@ RUN mkdir libcxx_build && cd libcxx_build \
110105
-DLIBCXX_ENABLE_THREADS:BOOL=OFF \
111106
-DLIBCXX_ENABLE_SHARED:BOOL=ON \
112107
-DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \
113-
-DCMAKE_BUILD_TYPE:STRING=Release \
108+
-DCMAKE_BUILD_TYPE=MinSizeRel \
114109
-DLLVM_TARGETS_TO_BUILD=host \
115110
-DCMAKE_INSTALL_PREFIX=$UTBOT_ALL/libcxx/install \
116111
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON ../llvm \
@@ -131,7 +126,7 @@ RUN cd $UTBOT_ALL/grpc && git submodule update --init
131126
RUN cd $UTBOT_ALL/grpc \
132127
&& mkdir -p cmake/build \
133128
&& cd cmake/build \
134-
&& $UTBOT_CMAKE_BINARY -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR ../.. \
129+
&& $UTBOT_CMAKE_BINARY -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR ../.. \
135130
&& make -j`nproc` \
136131
&& make install \
137132
&& cd $UTBOT_ALL \
@@ -150,7 +145,7 @@ USER utbot
150145
USER root
151146
RUN git clone --single-branch -b z3-4.8.17 --depth=1 https://github.com/Z3Prover/z3.git $UTBOT_ALL/z3-src
152147
RUN cd $UTBOT_ALL/z3-src && mkdir build && cd build && \
153-
$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR .. && \
148+
$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR .. && \
154149
$UTBOT_CMAKE_BINARY --build . --target install && \
155150
cd $UTBOT_ALL && \
156151
rm -rf $UTBOT_ALL/z3-src
@@ -172,11 +167,9 @@ RUN if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]] ; then apt update && apt install
172167
RUN apt update && apt install -y --no-install-recommends nodejs npm openssh-server net-tools gdb vim-nox rsync
173168
RUN pip3 install git+https://chromium.googlesource.com/external/gyp
174169

175-
# Update node and npm since defaults on ubuntu:18.04 have reached end of life
176-
RUN npm config set strict-ssl false
170+
# Update node and npm
177171
RUN npm cache clean -f
178172
RUN sudo -E npm install -g n
179-
RUN echo insecure > ~/.curlrc
180173
RUN sudo -E n 16
181174
RUN sudo -E apt remove -y --purge nodejs npm
182175

@@ -225,6 +218,8 @@ RUN ./configure --make-llvm-lib && make -j`nproc`
225218
# Download library for access private members
226219
RUN git clone https://github.com/martong/access_private.git $UTBOT_ALL/access_private
227220

221+
RUN apt autoclean
222+
228223
RUN chsh -s /bin/bash utbot
229224
EXPOSE 2020
230225
CMD ["/usr/sbin/sshd", "-D", "-p 2020"]

docker/Dockerfile_image_without_utbot

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:20.04
22
# use bash as default shell
33

44
SHELL ["/bin/bash", "--login", "-c"]

docker/action-scripts/build-clean-utbot.sh

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
chmod +x docker/action-scripts/build-utbot.sh
44
docker/action-scripts/build-utbot.sh
55

6-
rm -rf submodules/klee/build
76
rm -rf server/build

docker/action-scripts/build-utbot.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
source docker/building_dependencies/runtime_env.sh
44
chmod +x build.sh
5-
./build.sh
5+
./build.sh gh

docker/building_dependencies/install_packages/debian.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
set -e
55
set -o pipefail
66

7+
export OPERATING_SYSTEM_TAG=$(eval lsb_release -sr)
8+
79
# Downloading apt-rdepends tool which can get all the dependencies for a package
810
apt-get update && apt-get -y --no-install-recommends install apt-rdepends && apt-get update
911
rm -rf /tmp/debian_dependencies && mkdir -p /tmp/debian_dependencies && cd /tmp/debian_dependencies
@@ -12,7 +14,10 @@ shopt -s expand_aliases
1214
# A grep command which clears out the output of apt-rdepends
1315
alias grepdepends='grep -v "^ " | grep -v "^libc-dev$" | grep -v "^debconf-2.0$" | grep -v "^libc6$" | grep -v "^libunwind8-dev$" | grep -v "^awk$"'
1416
# Get all the dependencies of utbot
15-
apt-rdepends libsqlite3-dev libgoogle-perftools-dev libssl-dev libssl1.0-dev python3-pip gzip make gcc-9 g++-9 | grepdepends > all.txt
17+
apt-rdepends libsqlite3-dev libgoogle-perftools-dev libssl-dev python3-pip gzip make gcc-9 g++-9 | grepdepends > all.txt
18+
if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]]; then
19+
apt-rdepends libssl1.0-dev | grepdepends >> all.txt
20+
fi
1621
# Get all the dependencies of libc6-dev
1722
apt-rdepends libc6-dev | grepdepends > debian-libc-dev.txt
1823
# Get all the dependencies of utbot except all the dependencies of libc6-dev

docker/building_dependencies/runtime_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export CC=$UTBOT_INSTALL_DIR/bin/clang
3232
export CXX=$UTBOT_INSTALL_DIR/bin/clang++
3333
export CPATH=$CPATH:$UTBOT_ALL/klee/include
3434
export LD_LIBRARY_PATH=$UTBOT_INSTALL_DIR/lib
35-
export LDFLAGS='-fuse-ld=gold'
35+
export LDFLAGS='-fuse-ld=gold -L/usr/lib/x86_64-linux-gnu'
3636
export CFLAGS="$CFLAGS -gdwarf-4"
3737
export CXXFLAGS="$CXXFLAGS -gdwarf-4"
3838
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$UTBOT_ALL/bear/bin:$UTBOT_ALL/klee/bin:$UTBOT_INSTALL_DIR/bin:$PATH

0 commit comments

Comments
 (0)