Skip to content

Commit

Permalink
Update GitHub workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
Pichi committed Apr 14, 2023
1 parent 2dd445f commit 0a5e369
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .conan/profiles/windows
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
include(default)
include(boost)

[options]
mbedtls/*:shared=False
4 changes: 2 additions & 2 deletions .conan/recipes/boringssl/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class BoringSSLConan(ConanFile):

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")

def configure(self):
if self.options.shared:
del self.options.fPIC
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down
4 changes: 2 additions & 2 deletions .conan/recipes/libmaxminddb/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class LibmaxminddbConan(ConanFile):

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")

def configure(self):
if self.options.shared:
del self.options.fPIC
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down
74 changes: 0 additions & 74 deletions .conan/recipes/pichi/conanfile.py

This file was deleted.

14 changes: 8 additions & 6 deletions .conan/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ copy_if_not_exists()
local src="${recipes}/../profiles"
local dst="$(conan config home)/profiles"
local profile="$1"
mkdir -p "${dst}"
if [ ! -f "${dst}/${profile}" ]; then
cp -f "${src}/${profile}" "${dst}/${profile}"
fi
Expand Down Expand Up @@ -113,20 +114,21 @@ check_mandatory_arg()
get_ndk_pid()
{
conan list -p os=Linux --format=json "${ndk}#latest:*" | \
jq -r "first(.\"Local Cache\".\"${ndk}\".revisions[]) | .packages | keys[0]"
jq -r "first(.\"Local Cache\".\"${ndk}\".revisions[]) | .packages | keys[0]" 2>/dev/null | \
grep -v '^null$'
}

get_ndk_root()
{
if [ "$(get_ndk_pid)" = "null" ]; then
if [ -z "$(get_ndk_pid)" ]; then
conan download -p os=Linux -r conancenter "${ndk}" >/dev/null
fi
echo "$(conan cache path ${ndk}#latest:$(get_ndk_pid))/bin"
}
detect_ndk_compiler_version()
{
${1}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --version | \
"${1}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" --version | \
sed -n 's/^.* clang version \([0-9][0-9]*\)\..*$/\1/p'
}
Expand Down Expand Up @@ -158,8 +160,8 @@ generate_android_profile()
build()
{
conan create --version "${version}" -b missing \
-s build_type="${build_type}" \
-o "*:shared=${shared}" \
-s "build_type=${build_type}" \
-o "shared=${shared}" \
-o "pichi/*:tls_fingerprint=${fingerprint}" \
"$@" \
"${code_root}"
Expand All @@ -181,7 +183,7 @@ build_for_windows()
else
args="${args} -s compiler.runtime=static"
fi
args="${args} -s compiler.runtime_type=${build_type} $(generate_vs_runtime)"
args="${args} -s compiler.runtime_type=${build_type}"
fi
build ${args}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
with:
image: ubuntu-22.04
os: android
args: -r android-ndk/r25@ -l 33 -a armv8
args: -r android-ndk/r25c -l 33 -a armv8
2 changes: 0 additions & 2 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
- name: Install NASM for windows
if: ${{ inputs.os == 'windows' }}
run: choco install -y nasm
- name: Export Conan Recipe
run: sh .conan/scripts/export.sh -d new latest
- name: Build Pichi Recipe
run: >-
sh .conan/scripts/build.sh
Expand Down
8 changes: 6 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ class PichiConan(ConanFile):

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
if self.settings.os in ["Android", "iOS", "tvOS", "watchOS"]:
self.options.build_test = False
self.options.build_server = False
self.options.shared = False
self.settings.compiler.cppstd = "17"

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def requirements(self):
if self.options.tls_fingerprint:
Expand All @@ -57,7 +61,7 @@ def generate(self):
tc.cache_variables["TLS_FINGERPRINT"] = self.options.tls_fingerprint
tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared
tc.cache_variables["_BOOST_SHARED"] = self.dependencies["boost"].options.shared
tc.cache_variables["_BOOST_SHARED"] = self.dependencies["libsodium"].options.shared
tc.cache_variables["_SODIUM_SHARED"] = self.dependencies["libsodium"].options.shared
tc.generate()

def build(self):
Expand Down
6 changes: 5 additions & 1 deletion include/pichi/common/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif // __GNUC__ >= 8

#if __GNUC__ >= 10
#pragma GCC diagnostic ignored "-Wignored-attributes"
#endif // __GNUC__ >= 10

#cmakedefine DISABLE_GCC_IGNORED_ATTRIBUTES
#ifdef DISABLE_GCC_IGNORED_ATTRIBUTES
#pragma GCC diagnostic ignored "-Wignored-attributes"
Expand Down Expand Up @@ -54,7 +58,7 @@

#ifdef CMAKE_INSTALL_PREFIX
#define PICHI_PREFIX CMAKE_INSTALL_PREFIX
#else // CMAKE_INSTALL_PREFIX
#else // CMAKE_INSTALL_PREFIX
#error "CMAKE_INSTALL_PREFIX not defined"
#endif // CMAKE_INSTALL_PREFIX

Expand Down
1 change: 1 addition & 0 deletions src/api/egress_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <iterator>
#include <pichi/api/egress_manager.hpp>
#include <pichi/common/asserts.hpp>
#include <utility>

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion src/net/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ template <typename Stream> Endpoint HttpIngress<Stream>::readRemote(Yield yield)
* relative_path specified;
* - relative_path will be forwarded without any change.
*/
auto target = req.target().to_string();
auto target = string{cbegin(req.target()), cend(req.target())};
assertFalse(target.empty(), PichiError::BAD_PROTO, "Empty path");
if (target[0] != '/') {
// absolute_path specified, so convert it to relative one.
Expand Down

0 comments on commit 0a5e369

Please sign in to comment.