make format

pull/1774/head
Jason Rhinelander 3 years ago
parent 9b0b9fe67b
commit 52492c6253

@ -7,13 +7,14 @@ local docker_base = 'registry.oxen.rocks/lokinet-ci-';
local submodules = {
name: 'submodules',
image: 'drone/git',
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=1']
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=1'],
};
local apt_get_quiet = 'apt-get -o=Dpkg::Use-Pty=0 -q';
// Regular build on a debian-like system:
local debian_pipeline(name, image,
local debian_pipeline(name,
image,
arch='amd64',
deps=default_deps,
build_type='Release',
@ -35,18 +36,19 @@ local debian_pipeline(name, image,
{
name: 'build',
image: image,
[if allow_fail then "failure"]: "ignore",
environment: { SSH_KEY: { from_secret: "SSH_KEY" } },
[if allow_fail then 'failure']: 'ignore',
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
] + (if loki_repo then [
] + (
if loki_repo then [
'eatmydata ' + apt_get_quiet + ' install -y lsb-release',
'cp contrib/deb.loki.network.gpg /etc/apt/trusted.gpg.d',
'echo deb http://deb.loki.network $$(lsb_release -sc) main >/etc/apt/sources.list.d/loki.network.list',
'eatmydata ' + apt_get_quiet + ' update'
'eatmydata ' + apt_get_quiet + ' update',
] else []
) + [
'eatmydata ' + apt_get_quiet + ' dist-upgrade -y',
@ -62,22 +64,22 @@ local debian_pipeline(name, image,
]
+ (if tests then ['../contrib/ci/drone-gdb.sh ./test/testAll --use-colour yes'] else [])
+ extra_cmds,
}
},
],
};
local apk_builder(name, image, extra_cmds=[], allow_fail=false, jobs=6) = {
kind: 'pipeline',
type: 'docker',
name: name,
platform: {arch: "amd64"},
platform: { arch: 'amd64' },
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
steps: [
submodules,
{
name: 'build',
image: image,
[if allow_fail then "failure"]: "ignore",
environment: { SSH_KEY: { from_secret: "SSH_KEY" }, ANDROID: "android" },
[if allow_fail then 'failure']: 'ignore',
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, ANDROID: 'android' },
commands: [
'VERBOSE=1 JOBS=' + jobs + ' NDK=/usr/lib/android-ndk ./contrib/android.sh',
'git clone https://github.com/oxen-io/lokinet-flutter-app lokinet-mobile',
@ -85,13 +87,14 @@ local apk_builder(name, image, extra_cmds=[], allow_fail=false, jobs=6) = {
'cd lokinet-mobile',
'flutter build apk --debug',
'cd ..',
'cp lokinet-mobile/build/app/outputs/apk/debug/app-debug.apk lokinet.apk'
] + extra_cmds
}
]
'cp lokinet-mobile/build/app/outputs/apk/debug/app-debug.apk lokinet.apk',
] + extra_cmds,
},
],
};
// windows cross compile on debian
local windows_cross_pipeline(name, image,
local windows_cross_pipeline(name,
image,
arch='amd64',
build_type='Release',
lto=false,
@ -111,8 +114,8 @@ local windows_cross_pipeline(name, image,
{
name: 'build',
image: image,
[if allow_fail then "failure"]: "ignore",
environment: { SSH_KEY: { from_secret: "SSH_KEY" }, WINDOWS_BUILD_NAME: toolchain+"bit" },
[if allow_fail then 'failure']: 'ignore',
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, WINDOWS_BUILD_NAME: toolchain + 'bit' },
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
@ -121,9 +124,9 @@ local windows_cross_pipeline(name, image,
'eatmydata ' + apt_get_quiet + ' install -y build-essential cmake git pkg-config ccache g++-mingw-w64-x86-64-posix nsis zip automake libtool',
'update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix',
'update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix',
'VERBOSE=1 JOBS=' + jobs + ' ./contrib/windows.sh'
'VERBOSE=1 JOBS=' + jobs + ' ./contrib/windows.sh',
] + extra_cmds,
}
},
],
};
@ -140,13 +143,13 @@ local deb_builder(image, distro, distro_branch, arch='amd64', loki_repo=true) =
name: 'build',
image: image,
failure: 'ignore',
environment: { SSH_KEY: { from_secret: "SSH_KEY" } },
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections'
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
] + (if loki_repo then [
'cp contrib/deb.loki.network.gpg /etc/apt/trusted.gpg.d',
'echo deb http://deb.loki.network $${distro} main >/etc/apt/sources.list.d/loki.network.list'
'echo deb http://deb.loki.network $${distro} main >/etc/apt/sources.list.d/loki.network.list',
] else []) + [
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
@ -158,8 +161,8 @@ local deb_builder(image, distro, distro_branch, arch='amd64', loki_repo=true) =
git checkout $${distro_branch}
fi
|||,
# Tell the merge how to resolve conflicts in the source .drone.jsonnet (we don't
# care about it at all since *this* .drone.jsonnet is already loaded).
// Tell the merge how to resolve conflicts in the source .drone.jsonnet (we don't
// care about it at all since *this* .drone.jsonnet is already loaded).
'git config merge.ours.driver true',
'echo .drone.jsonnet merge=ours >>.gitattributes',
@ -168,12 +171,12 @@ local deb_builder(image, distro, distro_branch, arch='amd64', loki_repo=true) =
'gbp dch -S -s "HEAD^" --spawn-editor=never -U low',
'eatmydata mk-build-deps --install --remove --tool "' + apt_get_quiet + ' -o Debug::pkgProblemResolver=yes --no-install-recommends -y"',
'export DEB_BUILD_OPTIONS="parallel=$$(nproc)"',
#'grep -q lib debian/lokinet-bin.install || echo "/usr/lib/lib*.so*" >>debian/lokinet-bin.install',
//'grep -q lib debian/lokinet-bin.install || echo "/usr/lib/lib*.so*" >>debian/lokinet-bin.install',
'debuild -e CCACHE_DIR -b',
'./contrib/ci/drone-debs-upload.sh ' + distro,
]
}
]
],
},
],
};
local clang(version) = debian_pipeline(
@ -213,17 +216,17 @@ local mac_builder(name,
{ name: 'submodules', commands: ['git fetch --tags', 'git submodule update --init --recursive'] },
{
name: 'build',
environment: { SSH_KEY: { from_secret: "SSH_KEY" } },
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
// If you don't do this then the C compiler doesn't have an include path containing
// basic system headers. WTF apple:
'export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"',
'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk
'./contrib/mac.sh'
'./contrib/mac.sh',
] + extra_cmds,
}
]
},
],
};
@ -233,67 +236,83 @@ local mac_builder(name,
kind: 'pipeline',
type: 'docker',
steps: [{
name: 'build', image: 'registry.oxen.rocks/lokinet-ci-lint',
name: 'build',
image: 'registry.oxen.rocks/lokinet-ci-lint',
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
'eatmydata ' + apt_get_quiet + ' install -y git clang-format-11',
'./contrib/ci/drone-format-verify.sh']
}]
'eatmydata ' + apt_get_quiet + ' install -y git clang-format-11 jsonnet',
'./contrib/ci/drone-format-verify.sh',
],
}],
},
// Various debian builds
debian_pipeline("Debian sid (amd64)", "debian:sid"),
debian_pipeline("Debian sid/Debug (amd64)", "debian:sid", build_type='Debug'),
debian_pipeline('Debian sid (amd64)', 'debian:sid'),
debian_pipeline('Debian sid/Debug (amd64)', 'debian:sid', build_type='Debug'),
clang(13),
full_llvm(13),
debian_pipeline("Debian buster (i386)", "i386/debian:buster", cmake_extra='-DDOWNLOAD_SODIUM=ON'),
debian_pipeline("Ubuntu focal (amd64)", docker_base+'ubuntu-focal'),
debian_pipeline("Ubuntu bionic (amd64)", "ubuntu:bionic", deps='g++-8 ' + default_deps_nocxx,
cmake_extra='-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8', loki_repo=true),
debian_pipeline('Debian buster (i386)', 'i386/debian:buster', cmake_extra='-DDOWNLOAD_SODIUM=ON'),
debian_pipeline('Ubuntu focal (amd64)', docker_base + 'ubuntu-focal'),
debian_pipeline('Ubuntu bionic (amd64)',
'ubuntu:bionic',
deps='g++-8 ' + default_deps_nocxx,
cmake_extra='-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8',
loki_repo=true),
// ARM builds (ARM64 and armhf)
debian_pipeline("Debian sid (ARM64)", "debian:sid", arch="arm64", jobs=4),
debian_pipeline("Debian buster (armhf)", "arm32v7/debian:buster", arch="arm64", cmake_extra='-DDOWNLOAD_SODIUM=ON', jobs=4),
debian_pipeline('Debian sid (ARM64)', 'debian:sid', arch='arm64', jobs=4),
debian_pipeline('Debian buster (armhf)', 'arm32v7/debian:buster', arch='arm64', cmake_extra='-DDOWNLOAD_SODIUM=ON', jobs=4),
// Static armhf build (gets uploaded)
debian_pipeline("Static (buster armhf)", "arm32v7/debian:buster", arch="arm64", deps='g++ python3-dev automake libtool',
debian_pipeline('Static (buster armhf)',
'arm32v7/debian:buster',
arch='arm64',
deps='g++ python3-dev automake libtool',
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
'-DCMAKE_CXX_FLAGS="-march=armv7-a+fp" -DCMAKE_C_FLAGS="-march=armv7-a+fp" -DNATIVE_BUILD=OFF ' +
'-DWITH_SYSTEMD=OFF',
extra_cmds=[
'../contrib/ci/drone-check-static-libs.sh',
'UPLOAD_OS=linux-armhf ../contrib/ci/drone-static-upload.sh'
'UPLOAD_OS=linux-armhf ../contrib/ci/drone-static-upload.sh',
],
jobs=4),
// android apk builder
apk_builder("android apk", "registry.oxen.rocks/lokinet-ci-android", extra_cmds=['UPLOAD_OS=android ./contrib/ci/drone-static-upload.sh']),
apk_builder('android apk', 'registry.oxen.rocks/lokinet-ci-android', extra_cmds=['UPLOAD_OS=android ./contrib/ci/drone-static-upload.sh']),
// Windows builds (x64)
windows_cross_pipeline("Windows (amd64)", docker_base+'debian-win32-cross',
toolchain='64', extra_cmds=[
'./contrib/ci/drone-static-upload.sh'
windows_cross_pipeline('Windows (amd64)',
docker_base + 'debian-win32-cross',
toolchain='64',
extra_cmds=[
'./contrib/ci/drone-static-upload.sh',
]),
// Static build (on bionic) which gets uploaded to builds.lokinet.dev:
debian_pipeline("Static (bionic amd64)", docker_base+'ubuntu-bionic', deps='g++-8 python3-dev automake libtool', lto=true, tests=false,
debian_pipeline('Static (bionic amd64)',
docker_base + 'ubuntu-bionic',
deps='g++-8 python3-dev automake libtool',
lto=true,
tests=false,
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 ' +
'-DCMAKE_CXX_FLAGS="-march=x86-64 -mtune=haswell" -DCMAKE_C_FLAGS="-march=x86-64 -mtune=haswell" -DNATIVE_BUILD=OFF ' +
'-DWITH_SYSTEMD=OFF',
extra_cmds=[
'../contrib/ci/drone-check-static-libs.sh',
'../contrib/ci/drone-static-upload.sh'
'../contrib/ci/drone-static-upload.sh',
]),
// integration tests
debian_pipeline("Router Hive", "ubuntu:focal", deps='python3-dev python3-pytest python3-pybind11 ' + default_deps,
debian_pipeline('Router Hive',
'ubuntu:focal',
deps='python3-dev python3-pytest python3-pybind11 ' + default_deps,
cmake_extra='-DWITH_HIVE=ON'),
// Deb builds:
deb_builder("debian:sid", "sid", "debian/sid"),
deb_builder("debian:buster", "buster", "debian/buster"),
deb_builder("ubuntu:focal", "focal", "ubuntu/focal"),
deb_builder("debian:sid", "sid", "debian/sid", arch='arm64'),
deb_builder('debian:sid', 'sid', 'debian/sid'),
deb_builder('debian:buster', 'buster', 'debian/buster'),
deb_builder('ubuntu:focal', 'focal', 'ubuntu/focal'),
deb_builder('debian:sid', 'sid', 'debian/sid', arch='arm64'),
// Macos builds:
mac_builder('macOS (Release)'),

@ -36,7 +36,8 @@ namespace llarp
explicit NetID(const byte_t* val);
NetID(const NetID& other) = default;
NetID& operator=(const NetID& other) = default;
NetID&
operator=(const NetID& other) = default;
bool
operator==(const NetID& other) const;

Loading…
Cancel
Save