diff --git a/.github/workflows/matrix.json b/.github/workflows/matrix.json index 584945c31..a4cd5c4b7 100644 --- a/.github/workflows/matrix.json +++ b/.github/workflows/matrix.json @@ -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" } ] diff --git a/DEVNOTE.md b/DEVNOTE.md index d737e87be..51a4aeb83 100644 --- a/DEVNOTE.md +++ b/DEVNOTE.md @@ -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/) @@ -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) \ No newline at end of file +## [Troubleshooting](https://github.com/UnitTestBot/UTBotCpp/wiki/troubleshooting) diff --git a/README.md b/README.md index e32f579d8..2c312cd67 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/build.sh b/build.sh index 89b051303..6afafadc3 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/docker/Dockerfile_base b/docker/Dockerfile_base index 1403462d5..6a1409026 100644 --- a/docker/Dockerfile_base +++ b/docker/Dockerfile_base @@ -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 @@ -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 @@ -75,7 +70,7 @@ 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 \ @@ -83,7 +78,7 @@ RUN mkdir build && cd build \ -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 @@ -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 \ @@ -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 \ @@ -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 @@ -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 @@ -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"] diff --git a/docker/Dockerfile_image_without_utbot b/docker/Dockerfile_image_without_utbot index 4a622fa96..91e24530d 100644 --- a/docker/Dockerfile_image_without_utbot +++ b/docker/Dockerfile_image_without_utbot @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 # use bash as default shell SHELL ["/bin/bash", "--login", "-c"] diff --git a/docker/action-scripts/build-clean-utbot.sh b/docker/action-scripts/build-clean-utbot.sh index 10cf04c48..897df5408 100644 --- a/docker/action-scripts/build-clean-utbot.sh +++ b/docker/action-scripts/build-clean-utbot.sh @@ -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 diff --git a/docker/action-scripts/build-utbot.sh b/docker/action-scripts/build-utbot.sh index 039f6ded8..f63e5bb2b 100644 --- a/docker/action-scripts/build-utbot.sh +++ b/docker/action-scripts/build-utbot.sh @@ -2,4 +2,4 @@ source docker/building_dependencies/runtime_env.sh chmod +x build.sh -./build.sh +./build.sh gh diff --git a/docker/building_dependencies/install_packages/debian.sh b/docker/building_dependencies/install_packages/debian.sh index fd8c65687..15558ba73 100644 --- a/docker/building_dependencies/install_packages/debian.sh +++ b/docker/building_dependencies/install_packages/debian.sh @@ -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 @@ -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 diff --git a/docker/building_dependencies/runtime_env.sh b/docker/building_dependencies/runtime_env.sh index d6c4a2b68..19ef35ef4 100644 --- a/docker/building_dependencies/runtime_env.sh +++ b/docker/building_dependencies/runtime_env.sh @@ -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 diff --git a/docker/create_env.sh b/docker/create_env.sh new file mode 100644 index 000000000..6a9a728d8 --- /dev/null +++ b/docker/create_env.sh @@ -0,0 +1,213 @@ +#!/bin/bash + +# install ssh +apt update && apt install openssh-server sudo -y + +useradd -m utbot +usermod -aG sudo utbot +passwd utbot + +service ssh start + +export OPERATING_SYSTEM_TAG=$(eval lsb_release -sr) +export LLVM_VERSION_MAJOR=14 + +export UTBOT_ALL=/utbot_distr +export UTBOT_INSTALL_DIR=$UTBOT_ALL/install +export UTBOT_CMAKE_BINARY=$UTBOT_INSTALL_DIR/bin/cmake + +su - utbot +chsh -s /bin/bash + +#RUN echo "Set disable_coredump false" >> /etc/sudo.conf + +sudo apt update +sudo apt install vim +sudo apt install sudo file python3-dateutil wget fakeroot libssl-dev build-essential software-properties-common libtcmalloc-minimal4 + +#echo "check_certificate = off" > /etc/wgetrc + +if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]]; then + add-apt-repository ppa:ubuntu-toolchain-r/test +fi + +sudo apt install gcc-9 g++-9 gcc-multilib g++-multilib gcc-9-multilib g++-9-multilib +sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 +sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100 +sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 100 + +sudo apt install git libcurl4-openssl-dev + +sudo apt install ninja-build python3-setuptools curl libcap-dev libncurses5-dev unzip libtcmalloc-minimal4 libgoogle-perftools-dev libsqlite3-dev doxygen python3-pip autoconf libtool + +#sudo apt install 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 + +sudo mkdir $UTBOT_ALL +sudo chmod 777 $UTBOT_ALL -R +sudo chown utbot $UTBOT_ALL -R +cd $UTBOT_ALL + +#Install cmake +wget https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2.tar.gz -O /tmp/cmake_src.tar.gz +tar xfz /tmp/cmake_src.tar.gz -C $UTBOT_ALL +rm /tmp/cmake_src.tar.gz +cd $UTBOT_ALL/cmake-3.17.2 +./bootstrap --prefix=$UTBOT_INSTALL_DIR --parallel=$(nproc) +make -j$(nproc) +make install +cd $UTBOT_ALL +rm -rf $UTBOT_ALL/cmake-3.17.2 + +sudo pip3 install tabulate==0.8.7 \ + typing==3.7.4.3 \ + lit==17.0.6 \ + wllvm==1.3.1 + +mkdir $UTBOT_ALL/llvm_gold_plugin +wget -P $UTBOT_ALL/llvm_gold_plugin https://raw.githubusercontent.com/bminor/binutils-gdb/fd67aa1129fd006ad49ed5ecb2b063705211553a/include/plugin-api.h +git clone --single-branch --branch "release/${LLVM_VERSION_MAJOR}.x" --depth 1 "https://github.com/llvm/llvm-project.git" $UTBOT_ALL/llvm-project +mkdir -p $UTBOT_ALL/llvm-project/build +cd $UTBOT_ALL/llvm-project/build +$UTBOT_CMAKE_BINARY \ + -DCMAKE_BUILD_TYPE=Release \ + -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_RUNTIMES="compiler-rt;libc;libcxx;libcxxabi" \ + -G "Ninja" ../llvm +$UTBOT_CMAKE_BINARY --build . --target install + +#export CFLAGS="-gdwarf-4" +#export CXXFLAGS="-gdwarf-4" + +export LLVM_COMPILER_PATH=$UTBOT_INSTALL_DIR/bin +export LLVM_COMPILER=clang + +mkdir -p $UTBOT_ALL/llvm-project/libcxx_build +cd $UTBOT_ALL/llvm-project/libcxx_build +CC=wllvm CXX=wllvm++ $UTBOT_CMAKE_BINARY \ + -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \ + -DLLVM_ENABLE_THREADS:BOOL=OFF \ + -DLIBCXX_ENABLE_THREADS:BOOL=OFF \ + -DLIBCXX_ENABLE_SHARED:BOOL=ON \ + -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DLLVM_TARGETS_TO_BUILD=host \ + -DCMAKE_INSTALL_PREFIX=$UTBOT_ALL/libcxx/install \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON ../llvm + +CC=wllvm CXX=wllvm++ make cxx -j$(nproc) +cd projects +CC=wllvm CXX=wllvm++ make install +find $UTBOT_ALL/libcxx/install/lib/lib*.so -print0 | xargs -0 --max-args=1 extract-bc +find $UTBOT_ALL/libcxx/install/lib/lib*.so -print0 | xargs -0 --max-args=1 rm +find $UTBOT_ALL/libcxx/install/lib/lib*.a -print0 | xargs -0 --max-args=1 extract-bc +find $UTBOT_ALL/libcxx/install/lib/lib*.a -print0 | xargs -0 --max-args=1 rm +cp -R $UTBOT_ALL/llvm-project/libcxxabi $UTBOT_ALL/libcxx + +cd $UTBOT_ALL +rm -rf $UTBOT_ALL/llvm-project +rm -rf $UTBOT_ALL/llvm_gold_plugin + +#export CC=$UTBOT_INSTALL_DIR/bin/clang +#export CXX=$UTBOT_INSTALL_DIR/bin/clang++ + +#Install GRPC +git clone --single-branch -b v1.49.0 --depth=1 https://github.com/grpc/grpc --recurse-submodules -j4 $UTBOT_ALL/grpc +mkdir -p $UTBOT_ALL/grpc/cmake_build +cd $UTBOT_ALL/grpc/cmake_build +$UTBOT_CMAKE_BINARY \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR \ + -G "Ninja" .. +#make -j$(nproc) +#make install +$UTBOT_CMAKE_BINARY --build . --target install +cd $UTBOT_ALL +rm -rf $UTBOT_ALL/grpc + +#Instal gtest +git clone --single-branch -b release-1.10.0 https://github.com/google/googletest.git $UTBOT_ALL/gtest +mkdir -p $UTBOT_ALL/gtest/build +cd $UTBOT_ALL/gtest/build +$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR .. +$UTBOT_CMAKE_BINARY --build . --target install +cd $UTBOT_ALL + +#Install z3 +git clone --single-branch -b z3-4.8.17 --depth=1 https://github.com/Z3Prover/z3.git $UTBOT_ALL/z3-src +mkdir -p $UTBOT_ALL/z3-src/build +cd $UTBOT_ALL/z3-src/build +$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR .. +$UTBOT_CMAKE_BINARY --build . --target install +cd $UTBOT_ALL +rm -rf $UTBOT_ALL/z3-src + +#install bitwuzla +#export PATH=$PATH:/utbot_distr/install/bin +#sudo pip3 install meson +#sudo apt install pkg-config libgmp-dev +#git clone --single-branch -b 0.3.1 --depth=1 https://github.com/bitwuzla/bitwuzla.git $UTBOT_ALL/bitwuzla +#cd $UTBOT_ALL/bitwuzla +#./configure.py --build-dir $UTBOT_ALL/bitwuzla/build --prefix $UTBOT_INSTALL_DIR --static --no-unit-testing +#cd $UTBOT_ALL/bitwuzla/build +#ninja . +#ninja install +#cd $UTBOT_ALL +#rm -rf $UTBOT_ALL/bitwuzla + +if [[ "$OPERATING_SYSTEM_TAG" = "18.04" ]]; then + sudo apt install nodejs-dev node-gyp libssl1.0-dev +fi +sudo apt install nodejs npm openssh-server net-tools gdb vim-nox rsync +sudo pip3 install git+https://chromium.googlesource.com/external/gyp + +# Update node and npm +npm cache clean -f +sudo -E npm install -g n +sudo -E n 16 +sudo -E apt remove -y --purge nodejs npm + +# Install cmake which can generate link_commands.json. Installing cmake the second time in order to build base image faster since this cmake may be changed frequently. +git clone --single-branch -b utbot-0.1.2b --depth=1 https://github.com/Software-Analysis-Team/CMake.git $UTBOT_ALL/cmake +cd $UTBOT_ALL/cmake +$UTBOT_CMAKE_BINARY -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR . +$UTBOT_CMAKE_BINARY --build . --target install +cd $UTBOT_ALL +rm -rf $UTBOT_ALL/cmake + +mkdir $UTBOT_ALL/klee +mkdir $UTBOT_ALL/server-install + +sudo pip3 install lit + +wget https://github.com/CLIUtils/CLI11/releases/download/v1.9.1/CLI11.hpp -P $UTBOT_ALL/cli +wget https://github.com/agauniyal/rang/releases/download/v3.1.0/rang.hpp -P $UTBOT_ALL/cli + +#COPY building_dependencies/runtime_env.sh /home/utbot/.bashrc +#COPY building_dependencies/runtime_env.sh /root/.bashrc + +sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100 +git clone -b klee_uclibc_v1.2 https://github.com/klee/klee-uclibc.git $UTBOT_ALL/klee-uclibc-32 +cp $UTBOT_ALL/klee-uclibc-32 $UTBOT_ALL/klee-uclibc-64 -R +cd $UTBOT_ALL/klee-uclibc-32 +./configure --make-llvm-lib +make KLEE_CFLAGS="-m32" -j$(nproc) + +cd $UTBOT_ALL/klee-uclibc-64 +./configure --make-llvm-lib +make -j$(nproc) + +# Download library for access private members +git clone https://github.com/martong/access_private.git $UTBOT_ALL/access_private + + +sudo update-alternatives --install /usr/bin/cc cc $UTBOT_INSTALL_DIR/bin/clang 100 +sudo update-alternatives --install /usr/bin/c++ c++ $UTBOT_INSTALL_DIR/bin/clang++ 100 diff --git a/docker/release_distribution_scripts/utbot_run_system.sh b/docker/release_distribution_scripts/utbot_run_system.sh index 73531ad77..57fd52760 100644 --- a/docker/release_distribution_scripts/utbot_run_system.sh +++ b/docker/release_distribution_scripts/utbot_run_system.sh @@ -8,10 +8,10 @@ os_tag=$(lsb_release -i | cut -f2) os_version=$(lsb_release -r | cut -f2) major_os_version=${os_version%%.*} -if [ "$os_tag" != "Ubuntu" ] || [ "$major_os_version" -lt "18" ] +if [ "$os_tag" != "Ubuntu" ] || [ "$major_os_version" -lt "20" ] then echo "warning: $(lsb_release -d | cut -f2) unsupported system" - echo "UTBotCPP support ubuntu 18.04 and above" + echo "UTBotCPP support ubuntu 20.04 and above" read -r -p "Are want to continue? [y/N] " response if ! [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] then @@ -52,9 +52,7 @@ export LD_LIBRARY_PATH=$UTBOT_ALL/install/lib:$UTBOT_ALL/debs-install/lib/x86_64 export GENERAL_INCLUDES=$UTBOT_ALL/debs-install/usr/lib/gcc/x86_64-linux-gnu/9/include:$UTBOT_ALL/debs-install/usr/local/include:$UTBOT_ALL/debs-install/usr/include/x86_64-linux-gnu:$UTBOT_ALL/debs-install/usr/include export C_INCLUDE_PATH=GENERAL_INCLUDES${C_INCLUDE_PATH:+:${C_INCLUDE_PATH}} export CPLUS_INCLUDE_PATH=$UTBOT_ALL/debs-install/usr/include/c++/9:$UTBOT_ALL/debs-install/usr/include/x86_64-linux-gnu/c++/9:$UTBOT_ALL/debs-install/usr/include/c++/9/backward:GENERAL_INCLUDES${CPLUS_INCLUDE_PATH:+:${CPLUS_INCLUDE_PATH}} -export CFLAGS="$CFLAGS -gdwarf-4" -export CXXFLAGS="$CXXFLAGS -gdwarf-4" -export LDFLAGS="-fuse-ld=gold $LDFLAGS" +export LDFLAGS="-fuse-ld=gold -L$UTBOT_ALL/debs-install/lib/x86_64-linux-gnu" # This function moves dev version of libc into $UTBOT_ALL/debs-install directory # Prerequisites: path/to/directory should exist diff --git a/docker/utbot_docker_dev.sh b/docker/utbot_docker_dev.sh index 3e086ec4e..8d3427a2e 100755 --- a/docker/utbot_docker_dev.sh +++ b/docker/utbot_docker_dev.sh @@ -4,7 +4,6 @@ CONTAINER_NAME=$USER-utbot-dev MOUNT_NAME=$USER-utbot -MOUNT_LOCAL_NAME=$MOUNT_NAME-local-mnt read -e -p "Enter base image tag: " IMAGE_TAG IMAGE="ghcr.io/unittestbot/utbotcpp/base_env:$IMAGE_TAG" @@ -31,21 +30,12 @@ else fi set -e -# Define local mount folder -read -e -p "Enter local folder to mount in UTBot: " -i "$PWD" PROJECT_SRC -if docker volume inspect $MOUNT_LOCAL_NAME > /dev/null 2>&1 ; then - docker volume rm $MOUNT_LOCAL_NAME > /dev/null -fi -docker volume create --driver lebokus/bindfs:latest -o sourcePath=$PROJECT_SRC -o map=$UID/1000:@$UID/@1000 $MOUNT_LOCAL_NAME > /dev/null -echo "'$MOUNT_LOCAL_NAME' docker volume created." - echo "Recreating docker container..." docker run -d --restart=unless-stopped \ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined \ --name=$CONTAINER_NAME \ -p $UTBOT_SSH_PORT:2020 \ -p $UTBOT_SERVER_PORT:2121 \ - -v $MOUNT_LOCAL_NAME:/home/utbot/mnt \ -v /etc/localtime:/etc/localtime:ro \ $IMAGE > /dev/null echo "Container '$CONTAINER_NAME' is up and running." diff --git a/docs/install-docker-windows.md b/docs/install-docker-windows.md index 973b058b0..85e611083 100644 --- a/docs/install-docker-windows.md +++ b/docs/install-docker-windows.md @@ -2,7 +2,7 @@ Get ready for creating a Docker container: -1. Make sure you have created a WSL container with Ubuntu 18.04: +1. Make sure you have created a WSL container with Ubuntu 20.04: ```bash wsl --list --verbose ``` diff --git a/docs/install-server-on-ubuntu.md b/docs/install-server-on-ubuntu.md index 5e0b99b13..4ce06da64 100644 --- a/docs/install-server-on-ubuntu.md +++ b/docs/install-server-on-ubuntu.md @@ -1,6 +1,6 @@ -# Install UnitTestBot C/C++ server on Ubuntu 18.04–20.04 +# Install UnitTestBot C/C++ server on Ubuntu 20.04 -Whether you have Ubuntu 18.04–20.04 on your computer, Ubuntu 18.04 in WSL or a Docker container, follow the +Whether you have Ubuntu 20.04 on your computer, Ubuntu 20.04 in WSL or a Docker container, follow the instructions to install the UnitTestBot C/C++ server. 1. Download a ZIP archive with the release artifact: diff --git a/docs/install-server.md b/docs/install-server.md index 403912b32..ccc110596 100644 --- a/docs/install-server.md +++ b/docs/install-server.md @@ -14,10 +14,10 @@ choose one of the UnitTestBot C/C++ installation options and prepare the corresp **Local or remote?** The easiest way to use UnitTestBot C/C++ is to install it _locally_ — this option is available only if you have -Windows or Ubuntu 18.04–20.04 on your computer. +Windows or Ubuntu 20.04 on your computer. The flip side of local installation is the risk of having dependency conflicts. UnitTestBot C/C++ requires using a specific toolchain: exact LLVM and GCC versions, and a particular solver. The other version of the necessary utility may be installed on a user machine — it may cause a version conflict. _Remote_ installation helps to avoid the conflicts and deploy the necessary toolchain safely. It is also the -only available option for macOS or any Linux distribution except Ubuntu 18.04–20.04. \ No newline at end of file +only available option for macOS or any Linux distribution except Ubuntu 20.04. diff --git a/docs/install-wsl.md b/docs/install-wsl.md index f4c556f2d..17a3cb456 100644 --- a/docs/install-wsl.md +++ b/docs/install-wsl.md @@ -9,9 +9,9 @@ Before installing WSL1 or WSL2 on you Windows 10 or Windows 11 machine, make sur To install WSL2 on you Windows 10 or Windows 11 machine: -1. Create an empty WSL2 container with Ubuntu 18.04: +1. Create an empty WSL2 container with Ubuntu 20.04: ```PowerShell -wsl --install -d Ubuntu-18.04 +wsl --install -d Ubuntu-20.04 ``` 2. Perform the initial setup for WSL2 user (in this example, we use "utbot"): @@ -27,9 +27,9 @@ wsl --install -d Ubuntu-18.04 > To run a command as administrator (user "root"), use "sudo ". > See "man sudo_root" for details. > ``` -3. Check if installation is successful: the new WSL2 container is called _Ubuntu-18.04_ by default: +3. Check if installation is successful: the new WSL2 container is called _Ubuntu-20.04_ by default: ```PowerShell C:\Users\user> wsl --list --verbose NAME STATE VERSION - Ubuntu-18.04 Running 2 <---------- Newly installed WSL2 container + Ubuntu-20.04 Running 2 <---------- Newly installed WSL2 container ``` diff --git a/docs/linux-macos.md b/docs/linux-macos.md index f361e9294..d05775b7a 100644 --- a/docs/linux-macos.md +++ b/docs/linux-macos.md @@ -1,13 +1,13 @@ # Install UnitTestBot C/C++ server: if you have Linux or macOS -To install the UnitTestBot C/C++ server, you need Ubuntu 18.04–20.04. +To install the UnitTestBot C/C++ server, you need Ubuntu 20.04. -If you have Ubuntu 18.04–20.04, you can [install the UnitTestBot C/C++ server](https://github.com/UnitTestBot/UTBotCpp/wiki/install-server-on-ubuntu) +If you have Ubuntu 20.04, you can [install the UnitTestBot C/C++ server](https://github.com/UnitTestBot/UTBotCpp/wiki/install-server-on-ubuntu) right on your OS. -If you want to use Docker with your Ubuntu 18.04–20.04, or you have some other Linux distribution or macOS: +If you want to use Docker with your Ubuntu 20.04, or you have some other Linux distribution or macOS: -1. [Set up Docker and run a container with Ubuntu 18.04](https://github.com/UnitTestBot/UTBotCpp/wiki/set-up-docker-os) +1. [Set up Docker and run a container with Ubuntu 20.04](https://github.com/UnitTestBot/UTBotCpp/wiki/set-up-docker-os) 2. [Install the required dependencies and the compiler](https://github.com/UnitTestBot/UTBotCpp/wiki/install-dependencies-gcc9) 3. [Install the UnitTestBot C/C++ server](https://github.com/UnitTestBot/UTBotCpp/wiki/install-server-on-ubuntu) diff --git a/docs/linux-remote.md b/docs/linux-remote.md index 262c87c01..4d2890765 100644 --- a/docs/linux-remote.md +++ b/docs/linux-remote.md @@ -1,7 +1,7 @@ # Install UnitTestBot C/C++ server: Linux (remote) -To install the UnitTestBot C/C++ server, you need Ubuntu 18.04–20.04: -1. [Set up Docker and run a container with Ubuntu 18.04](set-up-docker-os) +To install the UnitTestBot C/C++ server, you need Ubuntu 20.04: +1. [Set up Docker and run a container with Ubuntu 20.04](set-up-docker-os) 2. [Install the required dependencies and the compiler](install-dependencies-gcc9) 3. [Install the UnitTestBot C/C++ server](install-server-on-ubuntu) diff --git a/docs/linux.md b/docs/linux.md index a751913c8..e5d158892 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -1,12 +1,12 @@ # Install UnitTestBot C/C++ server: Linux -To install the UnitTestBot C/C++ server, you need Ubuntu 18.04–20.04. +To install the UnitTestBot C/C++ server, you need Ubuntu 20.04. -* Local installation: if you already have Ubuntu 18.04–20.04, you can +* Local installation: if you already have Ubuntu 20.04, you can [install the UnitTestBot C/C++ server](install-server-on-ubuntu) right on your OS. * [Remote installation via Docker](linux-remote): - 1. [Set up Docker and run a container with Ubuntu 18.04](set-up-docker-os) + 1. [Set up Docker and run a container with Ubuntu 20.04](set-up-docker-os) 2. [Install the required dependencies and the compiler](install-dependencies-gcc9) 3. [Install the UnitTestBot C/C++ server](install-server-on-ubuntu) diff --git a/docs/macos.md b/docs/macos.md index 8a3095782..20f70ee77 100644 --- a/docs/macos.md +++ b/docs/macos.md @@ -1,7 +1,7 @@ # Install UnitTestBot C/C++ server: macOS -To install the UnitTestBot C/C++ server, you need Ubuntu 18.04–20.04: -1. [Set up Docker and run a container with Ubuntu 18.04](set-up-docker-os) +To install the UnitTestBot C/C++ server, you need Ubuntu 20.04: +1. [Set up Docker and run a container with Ubuntu 20.04](set-up-docker-os) 2. [Install the required dependencies and the compiler](install-dependencies-gcc9) 3. [Install the UnitTestBot C/C++ server](install-server-on-ubuntu) diff --git a/docs/set-up-docker-os.md b/docs/set-up-docker-os.md index 09bea196a..32d6c60d2 100644 --- a/docs/set-up-docker-os.md +++ b/docs/set-up-docker-os.md @@ -1,4 +1,4 @@ -# Set up Docker and run a container with Ubuntu 18.04 +# Set up Docker and run a container with Ubuntu 20.04 Install Docker using the instructions for your OS: @@ -6,11 +6,11 @@ Install Docker using the instructions for your OS: * [Windows](install-docker-windows) * [macOS](https://pilsniak.com/how-to-install-docker-on-mac-os-using-brew) (external link) -Run a Docker container with Ubuntu 18.04: +Run a Docker container with Ubuntu 20.04: 1. Create a container: ```bash -docker container create -i -t -p 5522:22 -p 5521:2121 --name utbot ubuntu:18.04 +docker container create -i -t -p 5522:22 -p 5521:2121 --name utbot ubuntu:20.04 docker start utbot ``` 2. Navigate to a container: diff --git a/docs/system-requirements.md b/docs/system-requirements.md index 8c659daa7..a79d3ce74 100644 --- a/docs/system-requirements.md +++ b/docs/system-requirements.md @@ -10,14 +10,14 @@ To install UnitTestBot C/C++ _client_, it is OK to have a Linux, macOS, or Windows machine. -To install UnitTestBot C/C++ _server_, you need Ubuntu 18.04–20.04. - -| OS | Client | Server | -|:---------------------------|:-------------------|:--------------------------------| -| Ubuntu 18.04–20.04 | :heavy_check_mark: | :heavy_check_mark: | -| other Linux distributions | :heavy_check_mark: | via Docker | -| macOS | :heavy_check_mark: | via Docker | -| Windows | :heavy_check_mark: | via WSL only or WSL with Docker | +To install UnitTestBot C/C++ _server_, you need Ubuntu 20.04. + +| OS | Client | Server | +|:--------------------------|:-------------------|:--------------------------------| +| Ubuntu 20.04 | :heavy_check_mark: | :heavy_check_mark: | +| other Linux distributions | :heavy_check_mark: | via Docker | +| macOS | :heavy_check_mark: | via Docker | +| Windows | :heavy_check_mark: | via WSL only or WSL with Docker | ## IDE diff --git a/docs/windows-local.md b/docs/windows-local.md index 309a54943..b72fbc672 100644 --- a/docs/windows-local.md +++ b/docs/windows-local.md @@ -1,9 +1,9 @@ # Install UnitTestBot C/C++ server: Windows (local) Local installation via Windows Subsystem for Linux (WSL): -1. [Set up WSL with Ubuntu 18.04](install-wsl) +1. [Set up WSL with Ubuntu 20.04](install-wsl) 2. [Install the required dependencies and the compiler](install-dependencies-gcc9) 3. [Install the UnitTestBot C/C++ server](install-server-on-ubuntu) *** -Having installed the server, proceed to [installing the client](install_client). \ No newline at end of file +Having installed the server, proceed to [installing the client](install_client). diff --git a/docs/windows-remote.md b/docs/windows-remote.md index 1f118d978..a08a4b4b4 100644 --- a/docs/windows-remote.md +++ b/docs/windows-remote.md @@ -1,10 +1,10 @@ # Install UnitTestBot C/C++ server: Windows (remote) Remote installation via Docker (in WSL): -1. [Set up WSL with Ubuntu 18.04](install-wsl) -2. [Set up Docker on WSL and run a container with Ubuntu 18.04](set-up-docker-os) +1. [Set up WSL with Ubuntu 20.04](install-wsl) +2. [Set up Docker on WSL and run a container with Ubuntu 20.04](set-up-docker-os) 3. [Install the required dependencies and the compiler](install-dependencies-gcc9) 4. [Install the UnitTestBot C/C++ server](install-server-on-ubuntu) *** -Having installed the server, proceed to [installing the client](install_client). \ No newline at end of file +Having installed the server, proceed to [installing the client](install_client). diff --git a/docs/windows.md b/docs/windows.md index e90969c4f..49e6a529d 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -1,10 +1,10 @@ # Install UnitTestBot C/C++ server: Windows -To install the UnitTestBot C/C++ server, you need Ubuntu 18.04–20.04. +To install the UnitTestBot C/C++ server, you need Ubuntu 20.04. If you have a Windows machine, you have two options: * [Local installation via Windows Subsystem for Linux (WSL)](windows-local) * [Remote installation via Docker (in WSL)](windows-remote) *** -Having installed the server, proceed to [installing the client](install_client). \ No newline at end of file +Having installed the server, proceed to [installing the client](install_client). diff --git a/integration-tests/installation_checks/automated_install_checks.sh b/integration-tests/installation_checks/automated_install_checks.sh index c6a353b8f..1f236a854 100755 --- a/integration-tests/installation_checks/automated_install_checks.sh +++ b/integration-tests/installation_checks/automated_install_checks.sh @@ -13,7 +13,7 @@ WORK_DIR=$(pwd) EXPECTED_PID_FILE_LOCATION=${WORK_DIR}/utbot_distr/server-install/utbot.pid OS_DESCRIPTION_FILE=/etc/os-release declare -a SUPPORTED_DISTRIBUTIONS=("ubuntu") -declare -a SUPPORTED_UBUNTU_RELEASES=("18.04" "18.10" "19.04" "19.10" "20.04" "20.10" "21.04" "21.10") +declare -a SUPPORTED_UBUNTU_RELEASES=("20.04") # COMMON FUNCTIONS: log (){ @@ -122,4 +122,4 @@ unarchive_distro run_installation check_if_server_process_started -log "Smoke test on installation routine for UTBotCpp ${TARGET_ARCHIVE} - completed successfully" \ No newline at end of file +log "Smoke test on installation routine for UTBotCpp ${TARGET_ARCHIVE} - completed successfully"