diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,21 +132,17 @@ If code formatting tools do not install automatically on your system, you will have to install the following: -On Ubuntu 20.04: +Install all the code formatting tools on Debian Bullseye (11) or Ubuntu 20.04: ``` -sudo apt-get install clang-format-11 clang-tidy-11 clang-tools-11 python3-isort python3-autopep8 flake8 php-codesniffer yamllint +sudo apt-get install clang-format-11 clang-tidy-11 clang-tools-11 python3-autopep8 python3-pip flake8 php-codesniffer shellcheck yamllint +pip3 install isort>=5.6.4 mypy>=0.780 +echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc +source ~/.bashrc ``` If not available in the distribution, `clang-format-11` and `clang-tidy-11` can be installed from or . -On Debian (>= 10), the clang-11 family of tools is available from the https://apt.llvm.org/ repository: -``` -wget https://apt.llvm.org/llvm.sh -chmod +x llvm.sh -sudo ./llvm.sh 11 -``` - For example, for macOS: ``` curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/clang+llvm-11.0.0-x86_64-apple-darwin.tar.xz | tar -xJv @@ -154,17 +150,6 @@ ln -s $PWD/clang+llvm-11.0.0-x86_64-apple-darwin/bin/clang-tidy /usr/local/bin/clang-tidy ``` -If you are modifying a python script, you will need to install `mypy` and `isort`. -The minimum required version for `mypy` is 0.780, because the previous ones are -known to have issues with some python type annotations. -On Debian based systems, this can be installed via: -``` -sudo apt-get install python3-pip -pip3 install isort==5.6.4 mypy==0.780 -echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc -source ~/.bashrc -``` - If you are modifying a shell script, you will need to install the `shellcheck` linter. A recent version is required and may not be packaged for your distribution. Standalone binaries are available for download on @@ -174,7 +159,6 @@ if another version is already installed, make sure the recent one is found first. Arcanist will tell you what version is expected and what is found when running `arc lint` against a shell script. - If you are running Debian 10, it is also available in the backports repository: ``` sudo apt-get -t buster-backports install shellcheck diff --git a/contrib/docker/bitcoin-abc-dev/Dockerfile b/contrib/docker/bitcoin-abc-dev/Dockerfile --- a/contrib/docker/bitcoin-abc-dev/Dockerfile +++ b/contrib/docker/bitcoin-abc-dev/Dockerfile @@ -8,7 +8,7 @@ # it after it's done RUN mkdir -p /install WORKDIR /install -RUN /bitcoin-abc/contrib/utils/install-dependencies.sh +RUN /bitcoin-abc/contrib/utils/install-dependencies-buster.sh WORKDIR /bitcoin-abc RUN rm -rf /install diff --git a/contrib/teamcity/setup-debian-buster.sh b/contrib/teamcity/setup-debian-bullseye.sh copy from contrib/teamcity/setup-debian-buster.sh copy to contrib/teamcity/setup-debian-bullseye.sh --- a/contrib/teamcity/setup-debian-buster.sh +++ b/contrib/teamcity/setup-debian-bullseye.sh @@ -7,7 +7,7 @@ TEAMCITY_DIR=$(dirname "$0") # Install all the build dependencies -"${TEAMCITY_DIR}"/../utils/install-dependencies.sh +"${TEAMCITY_DIR}"/../utils/install-dependencies-bullseye.sh # Python library for interacting with teamcity pip3 install teamcity-messages diff --git a/contrib/teamcity/setup-debian-buster.sh b/contrib/teamcity/setup-debian-buster.sh --- a/contrib/teamcity/setup-debian-buster.sh +++ b/contrib/teamcity/setup-debian-buster.sh @@ -7,7 +7,7 @@ TEAMCITY_DIR=$(dirname "$0") # Install all the build dependencies -"${TEAMCITY_DIR}"/../utils/install-dependencies.sh +"${TEAMCITY_DIR}"/../utils/install-dependencies-buster.sh # Python library for interacting with teamcity pip3 install teamcity-messages diff --git a/contrib/utils/install-dependencies.sh b/contrib/utils/install-dependencies-bullseye.sh rename from contrib/utils/install-dependencies.sh rename to contrib/utils/install-dependencies-bullseye.sh --- a/contrib/utils/install-dependencies.sh +++ b/contrib/utils/install-dependencies-bullseye.sh @@ -14,14 +14,21 @@ bsdmainutils build-essential ccache + clang-11 + clang-format-11 + clang-tidy-11 + clang-tools-11 + cmake curl default-jdk devscripts doxygen dput flake8 + g++-9 g++-aarch64-linux-gnu g++-arm-linux-gnueabihf + gcc-9 gettext-base git golang @@ -34,7 +41,7 @@ jq lcov less - lib32stdc++-8-dev + lib32stdc++-10-dev libboost-all-dev libbz2-dev libc6-dev:i386 @@ -61,6 +68,7 @@ make ninja-build nsis + pandoc php-codesniffer pkg-config protobuf-compiler @@ -73,6 +81,7 @@ qemu-user-static qttools5-dev qttools5-dev-tools + shellcheck software-properties-common tar wget @@ -90,29 +99,11 @@ apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y $(join_by ' ' "${PACKAGES[@]}") -BACKPORTS=( - cmake - shellcheck -) - -echo "deb http://deb.debian.org/debian buster-backports main" | tee -a /etc/apt/sources.list -apt-get update -DEBIAN_FRONTEND=noninteractive apt-get -t buster-backports install -y $(join_by ' ' "${BACKPORTS[@]}") - - -# Install llvm and clang -apt-key add "$(dirname "$0")"/llvm.pub -add-apt-repository "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" -add-apt-repository "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-11 main" -apt-get update - -LLVM_PACKAGES=( - clang-11 - clang-format-11 - clang-tidy-11 - clang-tools-11 -) -DEBIAN_FRONTEND=noninteractive apt-get install -y $(join_by ' ' "${LLVM_PACKAGES[@]}") +# Use gcc-9/g++-9 by default so it uses libstdc++-9. This prevents from pulling +# the new pthread_cond_clockwait symbol from GLIBC_30 and ensure we are testing +# under the same condition our release it built. +update-alternatives --install /usr/bin/gcc gcc "$(command -v gcc-9)" 100 +update-alternatives --install /usr/bin/g++ g++ "$(command -v g++-9)" 100 # Use the mingw posix variant update-alternatives --set x86_64-w64-mingw32-g++ $(command -v x86_64-w64-mingw32-g++-posix) @@ -129,12 +120,6 @@ # shellcheck source=/dev/null source ~/.bashrc -# Install pandoc. The version from buster is outdated, so get a more recent one -# from github. -wget https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-1-amd64.deb -echo "4515d6fe2bf8b82765d8dfa1e1b63ccb0ff3332d60389f948672eaa37932e936 pandoc-2.10.1-1-amd64.deb" | sha256sum -c -DEBIAN_FRONTEND=noninteractive dpkg -i pandoc-2.10.1-1-amd64.deb - # Install npm v7.x and nodejs v15.x curl -sL https://deb.nodesource.com/setup_15.x | bash - apt-get install -y nodejs diff --git a/contrib/utils/install-dependencies.sh b/contrib/utils/install-dependencies-buster.sh rename from contrib/utils/install-dependencies.sh rename to contrib/utils/install-dependencies-buster.sh diff --git a/depends/README.md b/depends/README.md --- a/depends/README.md +++ b/depends/README.md @@ -65,7 +65,7 @@ Then install the dependencies: - sudo apt-get install lib32stdc++-8-dev libc6-dev:i386 + sudo apt-get install lib32stdc++-10-dev libc6-dev:i386 For linux ARM cross compilation: diff --git a/doc/build-unix.md b/doc/build-unix.md --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -62,9 +62,9 @@ ---------------------------------------------- Build requirements: - sudo apt-get install bsdmainutils build-essential libssl-dev libevent-dev lld ninja-build python3 + sudo apt-get install bsdmainutils build-essential cmake libssl-dev libevent-dev lld ninja-build python3 -**Installing cmake:** +**Installing cmake on older distribution (Debian < 11 or Ubuntu < 20.04):** On Debian Buster (10), `cmake` should be installed from the backports repository: @@ -72,11 +72,7 @@ sudo apt-get update sudo apt-get -t buster-backports install cmake -On Ubuntu 20.04 and later: - - sudo apt-get install cmake - -On previous Ubuntu versions, the `cmake` package is too old and needs to be installed from the Kitware APT repository: +If the `cmake` packaged version is too old it can be installed from the Kitware APT repository: sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - diff --git a/doc/build-windows.md b/doc/build-windows.md --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -5,7 +5,7 @@ The options known to work for building Bitcoin ABC on Windows are: -* On Linux, using the [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Debian Buster is recommended +* On Linux, using the [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Debian Bullseye is recommended and is the platform used to build the Bitcoin ABC Windows release binaries. * On Windows, using [Windows Subsystem for Linux (WSL)](https://msdn.microsoft.com/commandline/wsl/about) and the Mingw-w64 cross compiler tool chain.