Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: partial revert dash#4311 (add libgmp detection, make immer a package) #4911

Merged
merged 5 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ LCOV_FILTER_PATTERN = \
-p "/usr/lib/" \
-p "/usr/lib64/" \
-p "src/dashbls/" \
-p "src/immer/" \
-p "src/leveldb/" \
-p "src/crc32c/" \
-p "src/bench/" \
Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1520,9 +1520,6 @@ dnl check if libgmp is present
AC_CHECK_HEADER([gmp.h],, AC_MSG_ERROR(libgmp headers missing))
AC_CHECK_LIB([gmp], [__gmpz_init],GMP_LIBS=-lgmp, AC_MSG_ERROR(libgmp missing))

dnl check if immer headers-only library is present
AC_CHECK_HEADER([immer/map.hpp],, AC_MSG_ERROR(immer map headers missing))

AC_MSG_CHECKING([whether to build dashd])
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
AC_MSG_RESULT($build_bitcoind)
Expand Down
1 change: 1 addition & 0 deletions contrib/devtools/copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# git subtrees
"src/crypto/ctaes/",
"src/dashbls/",
"src/immer/",
"src/leveldb/",
"src/secp256k1/",
"src/univalue/",
Expand Down
41 changes: 0 additions & 41 deletions depends/packages/immer.mk

This file was deleted.

2 changes: 1 addition & 1 deletion depends/packages/packages.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
packages:=boost libevent gmp backtrace cmake immer
packages:=boost libevent gmp backtrace cmake

qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon

Expand Down
8 changes: 7 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ endif #ENABLE_STACKTRACES

BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/secp256k1/include -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
BITCOIN_INCLUDES+=-I$(srcdir)/dashbls/include -I$(srcdir)/dashbls/depends/relic/include -I$(srcdir)/dashbls/depends/minialloc/include
BITCOIN_INCLUDES+=-I$(srcdir)/immer

LIBBITCOIN_SERVER=libbitcoin_server.a
LIBBITCOIN_COMMON=libbitcoin_common.a
Expand Down Expand Up @@ -856,6 +857,7 @@ libdashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libdashconsensus_la_LIBADD = $(LIBDASHBLS) $(LIBSECP256K1) $(GMP_LIBS)
libdashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
libdashconsensus_la_CPPFLAGS += -I$(srcdir)/dashbls/include -I$(srcdir)/dashbls/depends/relic/include -I$(srcdir)/dashbls/depends/minialloc/include
libdashconsensus_la_CPPFLAGS += -I$(srcdir)/immer
libdashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

endif
Expand Down Expand Up @@ -889,9 +891,13 @@ CLEANFILES += wallet/test/*.gcda wallet/test/*.gcno
CLEANFILES += zmq/*.gcda zmq/*.gcno
CLEANFILES += obj/build.h

IMMER_DIST = immer/immer
LIBDASHBLS_DIST = dashbls

EXTRA_DIST = $(CTAES_DIST) $(LIBDASHBLS_DIST)
EXTRA_DIST = \
$(CTAES_DIST) \
$(IMMER_DIST) \
$(LIBDASHBLS_DIST)

config/bitcoin-config.h: config/stamp-h1
@$(MAKE) -C $(top_builddir) $(subdir)/$(@)
Expand Down
39 changes: 39 additions & 0 deletions src/immer/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AlignEscapedNewlines: Right
AlignTrailingComments: 'true'
AllowShortFunctionsOnASingleLine: 'true'
AllowShortBlocksOnASingleLine: 'true'
AlwaysBreakTemplateDeclarations: 'true'
AccessModifierOffset: -4
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Mozilla
BreakBeforeInheritanceComma: 'true'
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: 'true'
ColumnLimit: '80'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
FixNamespaceComments: 'true'
ForEachMacros: ['IMMER_CATCH', 'IMMER_TRY']
IndentCaseLabels: 'false'
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
TabWidth: '4'
UseTab: Never
...
7 changes: 7 additions & 0 deletions src/immer/.dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
((nil .
((indent-tabs-mode . nil)
(show-trailing-whitespace . t)))
(c-mode .
((mode . c++)))
(c++-mode .
((eval add-hook 'before-save-hook #'clang-format-buffer nil t))))
3 changes: 3 additions & 0 deletions src/immer/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: arximboldi
patreon: sinusoidal
custom: ["paypal.me/sinusoidal", sinusoid.al]
123 changes: 123 additions & 0 deletions src/immer/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # needed for fetchGit in default.nix
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
- uses: cachix/cachix-action@v8
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-build

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
- uses: cachix/cachix-action@v8
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-shell --run "mkdir build"
- run: nix-shell --run "cd build && cmake .."
- run: nix-shell --run "cd build && make docs"
- uses: shimataro/ssh-key-action@v2
if: github.ref == 'refs/heads/master'
with:
key: ${{ secrets.SINUSOIDES_SSH_KEY }}
known_hosts: ${{ secrets.SINUSOIDES_KNOWN_HOSTS }}
- run: nix-shell --run "cd build && make upload-docs"
if: github.ref == 'refs/heads/master'

check:
strategy:
matrix:
type: [Debug, Release]
toolchain: [gnu-6, gnu-7, llvm-5, llvm-6]
std: [14]
opts: [[]]
include:
# coverage
- type: Debug
toolchain: gnu-9
std: 14
opts: ['coverage']
# std 17
- type: Debug
toolchain: gnu-8
std: 17
- type: Debug
toolchain: llvm-9
std: 17
opts: ['fuzzers']
# std 20
- type: Debug
toolchain: gnu-11
std: 20
- type: Debug
toolchain: llvm-13
std: 20
# sanitizers
- type: Debug
toolchain: llvm-8
std: 14
opts: ['sanitizer']
# benchmarks
- type: Release
toolchain: gnu-9
std: 14
opts: ['benchmark']
- type: Release
toolchain: llvm-10
std: 14
opts: ['benchmark']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
- uses: cachix/cachix-action@v8
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-shell --argstr toolchain ${{ matrix.toolchain }} --run "mkdir build"
- name: configure CMake
run: |
nix-shell --argstr toolchain ${{ matrix.toolchain }} --run "
cd build && cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.type }} \
-DCHECK_SLOW_TESTS=false \
-DCXX_STANDARD=${{ matrix.std }} \
-DCHECK_BENCHMARKS=${{ contains(matrix.opts, 'benchmark') }} \
-DENABLE_COVERAGE=${{ contains(matrix.opts, 'coverage') }} \
-DENABLE_ASAN=${{ contains(matrix.opts, 'sanitize') }} \
-DENABLE_LSAN=${{ contains(matrix.opts, 'sanitize') }} \
-DENABLE_UBSAN=${{ contains(matrix.opts, 'sanitize') }} \
-DCHECK_FUZZERS=${{ contains(matrix.opts, 'fuzzers') }} \
-DDISABLE_FREE_LIST=${{ contains(matrix.opts, 'sanitize') }}
"
- run: nix-shell --argstr toolchain ${{ matrix.toolchain }} --run "cd build && make check -j`nproc`"
- run: nix-shell --argstr toolchain ${{ matrix.toolchain }} --run "bash <(curl -s https://codecov.io/bash)"
if: ${{ contains(matrix.opts, 'coverage') }}
- uses: shimataro/ssh-key-action@v2
if: ${{ contains(matrix.opts, 'benchmark') }}
with:
key: ${{ secrets.SINUSOIDES_SSH_KEY }}
known_hosts: ${{ secrets.SINUSOIDES_KNOWN_HOSTS }}
- run: nix-shell --run "cd build && make upload-benchmark-reports"
if: ${{ contains(matrix.opts, 'benchmark') }}
24 changes: 24 additions & 0 deletions src/immer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
bazel-*
build/
build-*/
reports/
doc/_build
doc/_doxygen
bazel-*

tools/travis/ssh-key
tools/clojure/target/
tools/scala/target/
tools/scala/project/target/

extra/js/out
extra/js/boost

__pycache__

.gdb_history

.cache
tools/clojure/.lein*

*.pyc
6 changes: 6 additions & 0 deletions src/immer/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "extra/python/lib/pybind11"]
path = extra/python/lib/pybind11
url = https://github.com/pybind/pybind11.git
[submodule "tools/sinusoidal-sphinx-theme"]
path = tools/sinusoidal-sphinx-theme
url = https://github.com/arximboldi/sinusoidal-sphinx-theme.git
11 changes: 11 additions & 0 deletions src/immer/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package(default_visibility = ["//visibility:public"])

cc_library(
name = "immer",
include_prefix = "immer",
strip_include_prefix =
"immer",
hdrs = glob([
"immer/**/*.hpp",
]),
)
Loading