From ab8f8ccabac68d0bf18c56066bb400f092b3da74 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 13 Nov 2020 16:00:45 +0100 Subject: [PATCH] clean up dependencies (#2008) * clean up dependencies * use non-prce-mode for metrics * clean up obsolete snappy and gflags deps from manuals * conditional pcre --- .appveyor.yml | 1 - .github/workflows/ci.yml | 8 +------- CHANGELOG.md | 5 +++++ Makefile | 2 ++ README.md | 21 +++++++-------------- azure-pipelines.yml | 1 - config.nims | 1 + docker/Dockerfile | 4 ++-- docker/dist/base_image/Dockerfile | 2 +- docker/shared_testnet/Dockerfile | 2 +- docs/the_nimbus_book/src/developers.md | 5 +---- docs/the_nimbus_book/src/install.md | 16 +++++++--------- docs/the_nimbus_book/src/pi-guide.md | 4 ++-- vendor/nimbus-build-system | 2 +- 14 files changed, 31 insertions(+), 43 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 366b3267c..ba5f41224 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -30,7 +30,6 @@ install: build_script: # the 32-bit build is done on a 64-bit image, so we need to override the architecture - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% CI_CACHE=NimBinaries update - - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% fetch-dlls test_script: - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% LOG_LEVEL=TRACE diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af552a4dc..8ba853421 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,8 +125,7 @@ jobs: sudo dpkg --add-architecture i386 sudo apt-fast update -qq sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ - --no-install-recommends -yq gcc-multilib g++-multilib \ - libssl-dev:i386 libpcre3-dev:i386 + --no-install-recommends -yq gcc-multilib g++-multilib mkdir -p external/bin cat << EOF > external/bin/gcc #!/bin/bash @@ -235,11 +234,6 @@ jobs: make -j$ncpu ARCH_OVERRIDE=$PLATFORM CI_CACHE=NimBinaries V=1 update - # Cached in "windows-dlls-cache" and exported globally - # if [[ '${{ runner.os }}' == 'Windows' ]]; then - # make -j$ncpu ARCH_OVERRIDE=$PLATFORM fetch-dlls - # fi - - name: Get latest fixtures commit hash if: matrix.target.TEST_KIND == 'unit-tests' id: fixtures_version diff --git a/CHANGELOG.md b/CHANGELOG.md index d22fb2d36..552c2a1f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +Next +================= + +* Avoid pcre dependency + 2020-11-12 v0.6.2 ================= diff --git a/Makefile b/Makefile index 631eb4197..949d85f15 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ BUILD_SYSTEM_DIR := vendor/nimbus-build-system # we set its default value before LOG_LEVEL is used in "variables.mk" LOG_LEVEL := INFO +LINK_PCRE := 0 + # we don't want an error here, so we can handle things later, in the ".DEFAULT" target -include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk diff --git a/README.md b/README.md index 03ba3a723..d9de6a684 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ At the moment, Nimbus has to be built from source. Nimbus has the following external dependencies: * Developer tools (C compiler, Make, Bash, Git) -* PCRE Nim is not an external dependency, Nimbus will build its own local copy. @@ -74,13 +73,13 @@ Nim is not an external dependency, Nimbus will build its own local copy. On common Linux distributions the dependencies can be installed with: ```sh # Debian and Ubuntu -sudo apt-get install build-essential git libpcre3-dev +sudo apt-get install build-essential git # Fedora -dnf install @development-tools pcre +dnf install @development-tools -# Archlinux, using an AUR manager for pcre-static -yourAURmanager -S base-devel pcre-static +# Archlinux, using an AUR manager +yourAURmanager -S base-devel ``` ### MacOS @@ -88,7 +87,7 @@ yourAURmanager -S base-devel pcre-static Assuming you use [Homebrew](https://brew.sh/) to manage packages: ```sh -brew install pcre cmake +brew install cmake ``` Make sure you have [CMake](https://cmake.org/) installed, to be able to build libunwind (used for [lightweight stack traces](https://github.com/status-im/nim-libbacktrace)). @@ -96,7 +95,6 @@ Make sure you have [CMake](https://cmake.org/) installed, to be able to build li ### Windows You can install the developer tools by following the instruction in our [Windows dev environment section](#windows-dev-environment). -It also provides a downloading script for prebuilt PCRE. ### Android @@ -107,7 +105,7 @@ Note, the Ubuntu PRoot is known to contain all Nimbus prerequisites compiled on *Assuming Ubuntu PRoot is used* ```sh -apt install build-essential git libpcre3-dev +apt install build-essential git ``` ## For users @@ -350,11 +348,6 @@ and run this in a "Git Bash" terminal: git config --global core.longpaths true ``` -If you don't want to compile PCRE separately, you can fetch pre-compiled DLLs with: -```bash -mingw32-make fetch-dlls # this will place the right DLLs for your architecture in the "build/" directory -``` - > If you were following the Windows testnet instructions, you can jump back to [Connecting to testnets](#connecting-to-testnets) now You can now follow those instructions in the previous section by replacing `make` with `mingw32-make` (regardless of your 32-bit or 64-bit architecture): @@ -412,7 +405,7 @@ sudo vi /etc/dphys-swapfile sudo reboot # Install prerequisites -sudo apt-get install git libgflags-dev libsnappy-dev libpcre3-dev +sudo apt-get install git # Then you can follow instructions for Linux. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dd6b10b19..db9a4d4e4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -63,7 +63,6 @@ jobs: git config --global core.longpaths true git config --global core.autocrlf false mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update - mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} fetch-dlls mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} LOG_LEVEL=TRACE if [[ $PLATFORM == "x64" ]]; then # everything builds more slowly on 32-bit, since there's no libbacktrace support diff --git a/config.nims b/config.nims index 8cc851e04..172d33bd0 100644 --- a/config.nims +++ b/config.nims @@ -63,6 +63,7 @@ else: const currentDir = currentSourcePath()[0 .. ^(len("config.nims") + 1)] switch("define", "nim_compiler_path=" & currentDir & "env.sh nim") +switch("define", "withoutPCRE") switch("import", "testutils/moduletests") diff --git a/docker/Dockerfile b/docker/Dockerfile index 37b8ba205..26bf5af6a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,7 @@ FROM debian:bullseye-slim AS build SHELL ["/bin/bash", "-c"] RUN apt-get -qq update \ - && apt-get -qq -y install build-essential libpcre3-dev git &>/dev/null \ + && apt-get -qq -y install build-essential git &>/dev/null \ && apt-get -qq clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -36,7 +36,7 @@ FROM debian:bullseye-slim as deploy SHELL ["/bin/bash", "-c"] RUN apt-get -qq update \ - && apt-get -qq -y install libpcre3 psmisc &>/dev/null \ + && apt-get -qq -y install psmisc &>/dev/null \ && apt-get -qq clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker/dist/base_image/Dockerfile b/docker/dist/base_image/Dockerfile index eb5c2b443..e6fcf6fdf 100644 --- a/docker/dist/base_image/Dockerfile +++ b/docker/dist/base_image/Dockerfile @@ -11,7 +11,7 @@ FROM ubuntu:20.04 SHELL ["/bin/bash", "-c"] RUN apt-get -qq update \ - && apt-get -qq -y install build-essential libpcre3-dev git &>/dev/null \ + && apt-get -qq -y install build-essential git &>/dev/null \ && apt-get -qq clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker/shared_testnet/Dockerfile b/docker/shared_testnet/Dockerfile index e7557c667..24f9c911a 100644 --- a/docker/shared_testnet/Dockerfile +++ b/docker/shared_testnet/Dockerfile @@ -3,7 +3,7 @@ FROM debian:bullseye-slim SHELL ["/bin/bash", "-c"] RUN apt-get -qq update \ - && apt-get -qq -y install build-essential libpcre3-dev git &>/dev/null \ + && apt-get -qq -y install build-essential git &>/dev/null \ && apt-get -qq clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docs/the_nimbus_book/src/developers.md b/docs/the_nimbus_book/src/developers.md index b4648e7e4..d433fc406 100644 --- a/docs/the_nimbus_book/src/developers.md +++ b/docs/the_nimbus_book/src/developers.md @@ -28,11 +28,8 @@ Variables -> Path -> Edit -> New -> C:\mingw-w64\mingw64\bin (it's "C:\mingw-w64 Install [Git for Windows](https://gitforwindows.org/) and use a "Git Bash" shell to clone and build nimbus-eth2. -If you don't want to compile PCRE separately, you can fetch pre-compiled DLLs with: - ```bash mingw32-make # this first invocation will update the Git submodules -mingw32-make fetch-dlls # this will place the right DLLs for your architecture in the "build/" directory ``` You can now follow the instructions in this this book by replacing `make` with `mingw32-make` (you should run `mingw32` regardless of whether you're running 32-bit or 64-bit architecture): @@ -88,7 +85,7 @@ sudo vi /etc/dphys-swapfile sudo reboot # Install prerequisites -sudo apt-get install git libgflags-dev libsnappy-dev libpcre3-dev +sudo apt-get install git # Then you can follow instructions for Linux. diff --git a/docs/the_nimbus_book/src/install.md b/docs/the_nimbus_book/src/install.md index 6b547a5ef..098e47b1b 100644 --- a/docs/the_nimbus_book/src/install.md +++ b/docs/the_nimbus_book/src/install.md @@ -21,9 +21,8 @@ If the above sounds like latin to you, don't worry. You should be fine as long a ## External Dependencies - Developer tools (C compiler, Make, Bash, Git) -- [PCRE](https://www.pcre.org/) -Nimbus will build its own local copy of Nim, so Nim is not an external dependency, +Nimbus will build its own local copy of Nim, so Nim is not an external dependency, ## Linux @@ -31,13 +30,13 @@ On common Linux distributions the dependencies can be installed with ```sh # Debian and Ubuntu -sudo apt-get install build-essential git libpcre3-dev +sudo apt-get install build-essential git # Fedora -dnf install @development-tools pcre +dnf install @development-tools -# Archlinux, using an AUR manager for pcre-static -yourAURmanager -S base-devel pcre-static +# Archlinux, using an AUR manager +yourAURmanager -S base-devel ``` ### macOS @@ -45,13 +44,12 @@ yourAURmanager -S base-devel pcre-static Assuming you use [Homebrew](https://brew.sh/) to manage packages ```sh -brew install pcre cmake +brew install cmake ``` ### Windows You can install the developer tools by following the instruction in our [Windows dev environment section](./advanced.md#windows-dev-environment). -We also provide a downloading script for prebuilt PCRE. ### Android @@ -62,6 +60,6 @@ We also provide a downloading script for prebuilt PCRE. Assuming you use Ubuntu PRoot ```sh -apt install build-essential git libpcre3-dev +apt install build-essential git ``` diff --git a/docs/the_nimbus_book/src/pi-guide.md b/docs/the_nimbus_book/src/pi-guide.md index d58742d2a..c3300fe25 100644 --- a/docs/the_nimbus_book/src/pi-guide.md +++ b/docs/the_nimbus_book/src/pi-guide.md @@ -209,11 +209,11 @@ ssh pi@195.177.101.93 ### 11. Install Nimbus dependencies -You'll need to install some packages (`git`, `libgflags-dev`, `libsnappy-dev`, and `libpcre3-dev`) in order for Nimbus to run correctly. +You'll need to install some packages (`git`) in order for Nimbus to run correctly. To do so, run: ``` -sudo apt-get install git libgflags-dev libsnappy-dev libpcre3-dev +sudo apt-get install git ``` ### 12. Install Screen diff --git a/vendor/nimbus-build-system b/vendor/nimbus-build-system index c278412db..a9a8e59b5 160000 --- a/vendor/nimbus-build-system +++ b/vendor/nimbus-build-system @@ -1 +1 @@ -Subproject commit c278412dbf7fce294ca1fabb8264607c2971ea8f +Subproject commit a9a8e59b569dc72b576e3d5b94108181fa46f313