Skip to content

Commit

Permalink
Update ubuntu version (#671)
Browse files Browse the repository at this point in the history
* Update to ubuntu 20.04
  • Loading branch information
ladisgin authored Mar 13, 2024
1 parent 92f904d commit 65d919b
Show file tree
Hide file tree
Showing 27 changed files with 290 additions and 88 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/matrix.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"include": [
{
"DOCKER_TAG": "2023.12.0",
"OPERATING_SYSTEM_TAG": "18.04",
"DOCKER_TAG": "2024.03.0",
"OPERATING_SYSTEM_TAG": "20.04",
"LLVM_VERSION_MAJOR": "14"
}
]
Expand Down
5 changes: 2 additions & 3 deletions DEVNOTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ needed dependencies such as Git, LLVM, GRPC, GoogleTest and others. **base_env**
dates. If you are developing the tool, you are most likely to need the most recent version
from [here](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env).

Supported and tested development configuration are Ubuntu 18.04 / 20.04 or Windows Subsystem for Linux (Ubuntu 18.04 /
20.04).
Supported and tested development configuration are Ubuntu 20.04 or Windows Subsystem for Linux (Ubuntu 20.04).

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

## [Troubleshooting](https://github.com/UnitTestBot/UTBotCpp/wiki/troubleshooting)
## [Troubleshooting](https://github.com/UnitTestBot/UTBotCpp/wiki/troubleshooting)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ More info on [wiki](https://github.com/UnitTestBot/UTBotCpp/wiki)

## How to install and use UTBot

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

UTBot is distrbuted as an archive that contains:
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ pwd=$PWD
chmod +x $pwd/submodules/build-klee.sh $pwd/submodules/Bear/build.sh $pwd/server/build.sh
cd $pwd/submodules && ./build-klee.sh
cd $pwd/submodules/Bear && ./build.sh
if [ "$1" = "gh" ]; then
rm -rf submodules
fi
cd $pwd/server && ./build.sh
39 changes: 17 additions & 22 deletions docker/Dockerfile_base
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ RUN echo "Set disable_coredump false" >> /etc/sudo.conf
WORKDIR docker

# Install required system packages
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
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends sudo file python3-dateutil wget fakeroot libssl-dev build-essential \
software-properties-common
RUN echo "check_certificate = off" > /etc/wgetrc

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

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

# install git
RUN apt install -y software-properties-common
RUN apt update
RUN add-apt-repository -y ppa:git-core/ppa
RUN apt update
RUN apt install -y git libcurl4-openssl-dev
RUN apt install -y software-properties-common git libcurl4-openssl-dev

# install others apt
RUN apt install -y --no-install-recommends ninja-build python3-setuptools
RUN apt install -y --no-install-recommends curl libcap-dev libncurses5-dev unzip libtcmalloc-minimal4 libgoogle-perftools-dev libsqlite3-dev doxygen python3-pip
RUN apt -y install autoconf libtool
RUN apt install -y --no-install-recommends ninja-build python3-setuptools curl libcap-dev libncurses5-dev unzip \
libtcmalloc-minimal4 libgoogle-perftools-dev libsqlite3-dev doxygen python3-pip autoconf libtool

# install vscode dependencies
RUN apt install -y libxshmfence1 libglu1
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
RUN apt install -y libasound2
RUN apt install -y xvfb
RUN apt install -y libxshmfence1 libglu1 libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 \
libgbm-dev libnss3-dev libxss-dev libasound2 xvfb

RUN mkdir $UTBOT_ALL && cd $UTBOT_ALL

Expand Down Expand Up @@ -75,15 +70,15 @@ RUN git clone --single-branch --branch "release/${LLVM_VERSION_MAJOR}.x" --depth
WORKDIR $UTBOT_ALL/llvm-project
RUN mkdir build && cd build \
&& $UTBOT_CMAKE_BINARY \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_BINUTILS_INCDIR=$UTBOT_ALL/llvm_gold_plugin \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_EH=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_ENABLE_PROJECTS="clang;libclc;lld;lldb;clang-tools-extra" \
-DLLVM_ENABLE_PROJECTS="clang;libclc;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libc;libcxx;libcxxabi" \
-G "Ninja" ../llvm \
&& $UTBOT_CMAKE_BINARY --build . --target install
Expand All @@ -110,7 +105,7 @@ RUN mkdir libcxx_build && cd libcxx_build \
-DLIBCXX_ENABLE_THREADS:BOOL=OFF \
-DLIBCXX_ENABLE_SHARED:BOOL=ON \
-DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DLLVM_TARGETS_TO_BUILD=host \
-DCMAKE_INSTALL_PREFIX=$UTBOT_ALL/libcxx/install \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON ../llvm \
Expand All @@ -131,7 +126,7 @@ RUN cd $UTBOT_ALL/grpc && git submodule update --init
RUN cd $UTBOT_ALL/grpc \
&& mkdir -p cmake/build \
&& cd cmake/build \
&& $UTBOT_CMAKE_BINARY -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR ../.. \
&& $UTBOT_CMAKE_BINARY -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR ../.. \
&& make -j`nproc` \
&& make install \
&& cd $UTBOT_ALL \
Expand All @@ -150,7 +145,7 @@ USER utbot
USER root
RUN git clone --single-branch -b z3-4.8.17 --depth=1 https://github.com/Z3Prover/z3.git $UTBOT_ALL/z3-src
RUN cd $UTBOT_ALL/z3-src && mkdir build && cd build && \
$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR .. && \
$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR .. && \
$UTBOT_CMAKE_BINARY --build . --target install && \
cd $UTBOT_ALL && \
rm -rf $UTBOT_ALL/z3-src
Expand All @@ -172,11 +167,9 @@ RUN if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]] ; then apt update && apt install
RUN apt update && apt install -y --no-install-recommends nodejs npm openssh-server net-tools gdb vim-nox rsync
RUN pip3 install git+https://chromium.googlesource.com/external/gyp

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

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

RUN apt autoclean

RUN chsh -s /bin/bash utbot
EXPOSE 2020
CMD ["/usr/sbin/sshd", "-D", "-p 2020"]
2 changes: 1 addition & 1 deletion docker/Dockerfile_image_without_utbot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:20.04
# use bash as default shell

SHELL ["/bin/bash", "--login", "-c"]
Expand Down
1 change: 0 additions & 1 deletion docker/action-scripts/build-clean-utbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
chmod +x docker/action-scripts/build-utbot.sh
docker/action-scripts/build-utbot.sh

rm -rf submodules/klee/build
rm -rf server/build
2 changes: 1 addition & 1 deletion docker/action-scripts/build-utbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

source docker/building_dependencies/runtime_env.sh
chmod +x build.sh
./build.sh
./build.sh gh
7 changes: 6 additions & 1 deletion docker/building_dependencies/install_packages/debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
set -e
set -o pipefail

export OPERATING_SYSTEM_TAG=$(eval lsb_release -sr)

# Downloading apt-rdepends tool which can get all the dependencies for a package
apt-get update && apt-get -y --no-install-recommends install apt-rdepends && apt-get update
rm -rf /tmp/debian_dependencies && mkdir -p /tmp/debian_dependencies && cd /tmp/debian_dependencies
Expand All @@ -12,7 +14,10 @@ shopt -s expand_aliases
# A grep command which clears out the output of apt-rdepends
alias grepdepends='grep -v "^ " | grep -v "^libc-dev$" | grep -v "^debconf-2.0$" | grep -v "^libc6$" | grep -v "^libunwind8-dev$" | grep -v "^awk$"'
# Get all the dependencies of utbot
apt-rdepends libsqlite3-dev libgoogle-perftools-dev libssl-dev libssl1.0-dev python3-pip gzip make gcc-9 g++-9 | grepdepends > all.txt
apt-rdepends libsqlite3-dev libgoogle-perftools-dev libssl-dev python3-pip gzip make gcc-9 g++-9 | grepdepends > all.txt
if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]]; then
apt-rdepends libssl1.0-dev | grepdepends >> all.txt
fi
# Get all the dependencies of libc6-dev
apt-rdepends libc6-dev | grepdepends > debian-libc-dev.txt
# Get all the dependencies of utbot except all the dependencies of libc6-dev
Expand Down
2 changes: 1 addition & 1 deletion docker/building_dependencies/runtime_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export CC=$UTBOT_INSTALL_DIR/bin/clang
export CXX=$UTBOT_INSTALL_DIR/bin/clang++
export CPATH=$CPATH:$UTBOT_ALL/klee/include
export LD_LIBRARY_PATH=$UTBOT_INSTALL_DIR/lib
export LDFLAGS='-fuse-ld=gold'
export LDFLAGS='-fuse-ld=gold -L/usr/lib/x86_64-linux-gnu'
export CFLAGS="$CFLAGS -gdwarf-4"
export CXXFLAGS="$CXXFLAGS -gdwarf-4"
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
Expand Down
Loading

0 comments on commit 65d919b

Please sign in to comment.