Skip to content

Commit

Permalink
Merge pull request #1731 from oxen-io/dev
Browse files Browse the repository at this point in the history
v0.9.6
  • Loading branch information
jagerman authored Sep 8, 2021
2 parents 44ad8ad + dbea1f9 commit 71663fa
Show file tree
Hide file tree
Showing 81 changed files with 2,864 additions and 1,205 deletions.
29 changes: 14 additions & 15 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ local debian_pipeline(name, image,
cmake_extra='',
extra_cmds=[],
jobs=6,
tests=true,
loki_repo=false,
allow_fail=false) = {
kind: 'pipeline',
Expand Down Expand Up @@ -55,10 +56,12 @@ local debian_pipeline(name, image,
'cmake .. -DWITH_SETCAP=OFF -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE='+build_type+' ' +
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
'-DWITH_LTO=' + (if lto then 'ON ' else 'OFF ') +
(if tests then '' else '-DWITH_TESTS=OFF ') +
cmake_extra,
'VERBOSE=1 make -j' + jobs,
'../contrib/ci/drone-gdb.sh ./test/testAll --use-colour yes',
] + extra_cmds,
]
+ (if tests then ['../contrib/ci/drone-gdb.sh ./test/testAll --use-colour yes'] else [])
+ extra_cmds,
}
],
};
Expand All @@ -76,7 +79,13 @@ local apk_builder(name, image, extra_cmds=[], allow_fail=false, jobs=6) = {
[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'
'VERBOSE=1 JOBS='+jobs+' NDK=/usr/lib/android-ndk ./contrib/android.sh',
'git clone https://github.com/majestrate/lokinet-mobile',
'cp -av lokinet-jni-*/* lokinet-mobile/lokinet_lib/android/src/main/jniLibs/',
'cd lokinet-mobile',
'flutter build apk --debug',
'cd ..',
'cp lokinet-mobile/build/app/outputs/apk/debug/app-debug.apk lokinet.apk'
] + extra_cmds
}
]
Expand Down Expand Up @@ -191,12 +200,7 @@ local mac_builder(name,
// 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
'mkdir build',
'cd build',
'cmake .. -DCMAKE_CXX_FLAGS=-fcolor-diagnostics -DCMAKE_BUILD_TYPE='+build_type+' ' +
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') + cmake_extra,
'VERBOSE=1 make -j' + jobs,
'./test/testAll --use-colour yes',
'./contrib/mac.sh'
] + extra_cmds,
}
]
Expand Down Expand Up @@ -252,7 +256,7 @@ local mac_builder(name,
]),

// 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,
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',
Expand All @@ -274,9 +278,4 @@ local mac_builder(name,
// Macos builds:
mac_builder('macOS (Release)'),
mac_builder('macOS (Debug)', build_type='Debug'),
mac_builder('macOS (Static)', cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DDOWNLOAD_SODIUM=FORCE -DDOWNLOAD_CURL=FORCE -DDOWNLOAD_UV=FORCE',
extra_cmds=[
'../contrib/ci/drone-check-static-libs.sh',
'../contrib/ci/drone-static-upload.sh'
]),
]
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.4.2
80 changes: 38 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,32 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Has to be set before `project()`, and ignored on non-macos:
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")

set(LANGS C CXX)
if(APPLE)
set(LANGS ${LANGS} OBJC Swift)
endif()

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
foreach(lang C CXX)
foreach(lang ${LANGS})
if(NOT DEFINED CMAKE_${lang}_COMPILER_LAUNCHER AND NOT CMAKE_${lang}_COMPILER MATCHES ".*/ccache")
message(STATUS "Enabling ccache for ${lang}")
set(CMAKE_${lang}_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE STRING "")
endif()
endforeach()
endif()


project(lokinet
VERSION 0.9.5
VERSION 0.9.6
DESCRIPTION "lokinet - IP packet onion router"
LANGUAGES C CXX)
LANGUAGES ${LANGS})

if(APPLE)
# Apple build number: must be incremented to submit a new build for the same lokinet version,
# should be reset to 0 when the lokinet version increments.
set(LOKINET_APPLE_BUILD 0)
endif()

set(RELEASE_MOTTO "A Series of Tubes" CACHE STRING "Release motto")

Expand All @@ -29,10 +41,8 @@ if(RELEASE_MOTTO AND CMAKE_BUILD_TYPE MATCHES "[Rr][Ee][Ll][Ee][Aa][Ss][Ee]")
add_definitions(-DLLARP_RELEASE_MOTTO="${RELEASE_MOTTO}")
endif()


list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")


# Core options
option(USE_AVX2 "enable avx2 code" OFF)
option(USE_NETNS "enable networking namespace support. Linux only" OFF)
Expand Down Expand Up @@ -94,14 +104,6 @@ endif()

add_definitions(-D${CMAKE_SYSTEM_NAME})

if(MSVC_VERSION)
enable_language(ASM_MASM)
list(APPEND CMAKE_ASM_MASM_SOURCE_FILE_EXTENSIONS s)
add_definitions(-D_WIN32_WINNT=0x0600 -DNOMINMAX -DSODIUM_STATIC)
else()
enable_language(ASM)
endif()

include(cmake/solaris.cmake)
include(cmake/win32.cmake)

Expand Down Expand Up @@ -184,8 +186,12 @@ else()
endif()


# this is messing with release builds
add_compile_options(-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0)
if(NOT APPLE)
add_compile_options(-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -Wall -Wextra -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -Werror=vla)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unknown-warning-option)
endif()
endif()

if (NOT CMAKE_SYSTEM_NAME MATCHES "Linux" AND SHADOW)
message( FATAL_ERROR "shadow-framework is Linux only" )
Expand Down Expand Up @@ -213,36 +219,27 @@ if(TRACY_ROOT)
endif()


if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unknown-warning-option)
endif()

if (NOT MSVC_VERSION)
add_compile_options(-Wall -Wextra -Wno-unknown-pragmas)
# vla are evil
add_compile_options(-Werror=vla)
add_compile_options(-Wno-unused-function -Wno-deprecated-declarations)
endif()

include(cmake/coverage.cmake)

# these vars are set by the cmake toolchain spec
if (WOW64_CROSS_COMPILE OR WIN64_CROSS_COMPILE)
include(cmake/cross_compile.cmake)
endif()

if(NATIVE_BUILD)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL ppc64le)
add_compile_options(-mcpu=native -mtune=native)
else()
add_compile_options(-march=native -mtune=native)
endif()
elseif(NOT NON_PC_TARGET)
if (USE_AVX2)
add_compile_options(-march=haswell -mtune=haswell -mfpmath=sse)
else()
# Public binary releases
add_compile_options(-march=nocona -mtune=haswell -mfpmath=sse)
if(NOT APPLE)
if(NATIVE_BUILD)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL ppc64le)
add_compile_options(-mcpu=native -mtune=native)
else()
add_compile_options(-march=native -mtune=native)
endif()
elseif(NOT NON_PC_TARGET)
if (USE_AVX2)
add_compile_options(-march=haswell -mtune=haswell -mfpmath=sse)
else()
# Public binary releases
add_compile_options(-march=nocona -mtune=haswell -mfpmath=sse)
endif()
endif()
endif()

Expand Down Expand Up @@ -332,12 +329,11 @@ endif()
add_subdirectory(crypto)
add_subdirectory(llarp)
add_subdirectory(daemon)


if(WITH_HIVE)
add_subdirectory(pybind)
endif()



if (NOT SHADOW)
if(WITH_TESTS OR WITH_HIVE)
add_subdirectory(test)
Expand All @@ -361,6 +357,6 @@ if(NOT TARGET uninstall)
endif()


if(BUILD_PACKAGE)
if(BUILD_PACKAGE AND NOT APPLE)
include(cmake/installer.cmake)
endif()
4 changes: 2 additions & 2 deletions cmake/StaticBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

set(LOCAL_MIRROR "" CACHE STRING "local mirror path/URL for lib downloads")

set(OPENSSL_VERSION 1.1.1k CACHE STRING "openssl version")
set(OPENSSL_VERSION 1.1.1l CACHE STRING "openssl version")
set(OPENSSL_MIRROR ${LOCAL_MIRROR} https://www.openssl.org/source CACHE STRING "openssl download mirror(s)")
set(OPENSSL_SOURCE openssl-${OPENSSL_VERSION}.tar.gz)
set(OPENSSL_HASH SHA256=892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
set(OPENSSL_HASH SHA256=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
CACHE STRING "openssl source hash")

set(EXPAT_VERSION 2.3.0 CACHE STRING "expat version")
Expand Down
5 changes: 1 addition & 4 deletions cmake/installer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ if(WIN32)
include(cmake/win32_installer_deps.cmake)
endif()

if(APPLE)
include(cmake/macos_installer_deps.cmake)
endif()


# This must always be last!
include(CPack)

113 changes: 0 additions & 113 deletions cmake/macos_installer_deps.cmake

This file was deleted.

8 changes: 5 additions & 3 deletions contrib/bencode-dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import sys
import pprint

if len(sys.argv) != 2 or sys.argv[1].startswith('-'):
if len(sys.argv) == 1 or (len(sys.argv) == 2 and sys.argv[1] == '-'):
f = sys.stdin.buffer
elif len(sys.argv) != 2 or sys.argv[1].startswith('-'):
print("Usage: {} FILE -- dumps a bencoded file".format(sys.argv[0]), file=sys.stderr)
sys.exit(1)

f = open(sys.argv[1], 'rb')
else:
f = open(sys.argv[1], 'rb')

class HexPrinter():
def __init__(self, data):
Expand Down
7 changes: 3 additions & 4 deletions contrib/ci/drone-static-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ if [ -e build-windows ]; then
# zipit up yo
archive="$base.zip"
zip -r "$archive" "$base"
elif [ -e build-android ] ; then
elif [ -e lokinet.apk ] ; then
# android af ngl
cp -av lokinet-jni-* "$base"
archive="$base.tar.xz"
tar cJvf "$archive" "$base"
archive="$base.apk"
cp -av lokinet.apk "$archive"
else
cp -av daemon/lokinet daemon/lokinet-vpn daemon/lokinet-bootstrap "$base"
# tar dat shiz up yo
Expand Down
Loading

0 comments on commit 71663fa

Please sign in to comment.