Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-18.04
timeout-minutes: 45
container:
image: envoyproxy/envoy-build-ubuntu:5a096881181dbe478f642b7ac02a68e9591e933d
image: envoyproxy/envoy-build-ubuntu:04f06115b6ee7cfea74930353fb47a41149cbec3
steps:
- uses: actions/checkout@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@io_bazel_rules_kotlin//kotlin/internal:toolchains.bzl", "define_kt_toolchain")

licenses(["notice"]) # Apache 2

alias(
name = "ios_framework",
actual = "//library/swift/src:ios_framework",
Expand Down
4 changes: 2 additions & 2 deletions bazel/BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_package")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")

licenses(["notice"]) # Apache 2

envoy_package()

kt_jvm_library(
Expand Down
8 changes: 5 additions & 3 deletions bazel/aar_with_jni.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@google_bazel_common//tools/maven:pom_file.bzl", "pom_file")

# This file is based on https://github.com/aj-michael/aar_with_jni which is
Expand Down Expand Up @@ -63,13 +65,13 @@ EOF
# We wrap our native so dependencies in a cc_library because android_binaries
# require a library target as dependencies in order to generate the appropriate
# architectures in the directory `lib/`
native.cc_library(
cc_library(
name = cc_lib_name,
srcs = native_deps,
)

# This outputs {jni_archive_name}_unsigned.apk which will contain the base files for our aar
native.android_binary(
android_binary(
name = jni_archive_name,
manifest = archive_name + "_generated_AndroidManifest.xml",
custom_package = "does.not.matter",
Expand All @@ -79,7 +81,7 @@ EOF

# This creates bazel-bin/library/kotlin/src/io/envoyproxy/envoymobile/name_bin_deploy.jar
# This jar has all the classes needed for our aar and will be our `classes.jar`
native.android_binary(
android_binary(
name = android_binary_name,
manifest = manifest,
srcs = [],
Expand Down
9 changes: 9 additions & 0 deletions bazel/envoy_mobile_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def envoy_mobile_repositories():
upstream_envoy_overrides()
swift_repos()
kotlin_repos()
android_repos()

def upstream_envoy_overrides():
# Patch protobuf to prevent duplicate symbols: https://github.com/lyft/envoy-mobile/issues/617
Expand Down Expand Up @@ -122,3 +123,11 @@ def kotlin_repos():
sha256 = "4c73eee92dd652ea8e2afd7b20732cf863d4938a30f634d12c88fe64def89fd8",
url = "https://github.com/Kotlin/dokka/releases/download/0.9.18/dokka-fatjar-0.9.18.jar",
)

def android_repos():
http_archive(
name = "build_bazel_rules_android",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
)
2 changes: 1 addition & 1 deletion bazel/kotlin_lib.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library", "kt_jvm_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")

def envoy_mobile_kt_library(name, visibility = None, srcs = [], deps = []):
# These source files must be re-exported to the kotlin custom library rule to ensure their
Expand Down
5 changes: 3 additions & 2 deletions dist/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
licenses(["notice"]) # Apache 2

load("@build_bazel_rules_android//android:rules.bzl", "aar_import")
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_framework_import")

licenses(["notice"]) # Apache 2

# NOTE: You must first build the top-level targets //:ios_dist and //:android_dist to use the
# artifacts referenced here.
# You can also download the distributables referenced here from envoy-mobile's releases page:
Expand Down
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 884 files
5 changes: 3 additions & 2 deletions examples/java/hello_world/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
licenses(["notice"]) # Apache 2

load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

licenses(["notice"]) # Apache 2

android_binary(
name = "hello_envoy",
custom_package = "io.envoyproxy.envoymobile.helloenvoy",
Expand Down
5 changes: 3 additions & 2 deletions examples/kotlin/hello_world/BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
licenses(["notice"]) # Apache 2

load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@rules_detekt//detekt:defs.bzl", "detekt")

licenses(["notice"]) # Apache 2

android_binary(
name = "hello_envoy_kt",
custom_package = "io.envoyproxy.envoymobile.helloenvoykotlin",
Expand Down
4 changes: 2 additions & 2 deletions examples/kotlin/shared/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

licenses(["notice"]) # Apache 2

kt_android_library(
name = "hello_envoy_shared_lib",
srcs = [
Expand Down
5 changes: 3 additions & 2 deletions examples/objective-c/hello_world/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
licenses(["notice"]) # Apache 2

load("@rules_cc//cc:defs.bzl", "objc_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")

licenses(["notice"]) # Apache 2

objc_library(
name = "appmain",
srcs = glob([
Expand Down
4 changes: 2 additions & 2 deletions examples/swift/hello_world/BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
licenses(["notice"]) # Apache 2

load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")

licenses(["notice"]) # Apache 2

swift_library(
name = "appmain",
srcs = glob(["*.swift"]),
Expand Down
5 changes: 3 additions & 2 deletions library/common/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
licenses(["notice"]) # Apache 2

load("@rules_cc//cc:defs.bzl", "cc_binary")
load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand Down
4 changes: 2 additions & 2 deletions library/common/buffer/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand Down
5 changes: 3 additions & 2 deletions library/common/extensions/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand All @@ -12,6 +12,7 @@ envoy_cc_library(
hdrs = ["registry.h"],
repository = "@envoy",
deps = [
"@envoy//source/common/network:socket_lib",
"@envoy//source/common/upstream:logical_dns_cluster_lib",
"@envoy//source/extensions/clusters/dynamic_forward_proxy:cluster",
"@envoy//source/extensions/compression/gzip/decompressor:config",
Expand Down
12 changes: 12 additions & 0 deletions library/common/extensions/registry.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "library/common/extensions/registry.h"

#include "common/network/socket_interface_impl.h"

namespace Envoy {

void ExtensionRegistry::registerFactories() {
Expand All @@ -14,6 +16,16 @@ void ExtensionRegistry::registerFactories() {
Envoy::Extensions::StatSinks::MetricsService::forceRegisterMetricsServiceSinkFactory();
Envoy::Extensions::TransportSockets::Tls::forceRegisterUpstreamSslSocketFactory();
Envoy::Upstream::forceRegisterLogicalDnsClusterFactory();

// TODO: add a "force initialize" function to the upstream code, or clean up the upstream code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @goaway

// in such a way that does not depend on the statically initialized variable.
// The current setup exposes in iOS the same problem as the one described in:
// https://github.com/envoyproxy/envoy/pull/7185 with the static variable declared in:
// https://github.com/envoyproxy/envoy/pull/11380/files#diff-8a5c90e5a39b2ea975170edc4434345bR138.
// For now force the compilation unit to run by creating an instance of the class declared in
// socket_interface_impl.h and immediately destroy.
auto ptr = std::make_unique<Network::SocketInterfaceImpl>();
ptr.reset(nullptr);
}

} // namespace Envoy
4 changes: 2 additions & 2 deletions library/common/http/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand Down
4 changes: 2 additions & 2 deletions library/common/network/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand Down
14 changes: 4 additions & 10 deletions library/common/network/synthetic_address_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,13 @@ class SyntheticAddressImpl : public Instance {

const std::string& logicalName() const { return address_; }

Api::SysCallIntResult bind(int) const {
// a socket should never be bound to a synthetic address.
return {-1, EADDRNOTAVAIL};
}
const Ip* ip() const { return nullptr; }

Api::SysCallIntResult connect(int) const {
// a socket should never connect to a synthetic address.
return {-1, EPROTOTYPE};
}
const Pipe* pipe() const { return nullptr; }

const Ip* ip() const { return nullptr; }
const sockaddr* sockAddr() const { return nullptr; }

IoHandlePtr socket(SocketType) const { return nullptr; }
socklen_t sockAddrLen() const { return 0; }

Type type() const {
// TODO(junr03): consider adding another type of address.
Expand Down
4 changes: 2 additions & 2 deletions library/common/thread/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand Down
4 changes: 2 additions & 2 deletions library/common/types/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
Expand Down
3 changes: 3 additions & 0 deletions library/java/src/io/envoyproxy/envoymobile/engine/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
load("@rules_java//java:defs.bzl", "java_library")
load("@build_bazel_rules_android//android:rules.bzl", "android_library")

licenses(["notice"]) # Apache 2

android_library(
Expand Down
2 changes: 2 additions & 0 deletions library/java/src/io/envoyproxy/envoymobile/engine/types/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"]) # Apache 2

java_library(
Expand Down
4 changes: 2 additions & 2 deletions library/java/test/io/envoyproxy/envoymobile/engine/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("//bazel:kotlin_test.bzl", "envoy_mobile_kt_test")

licenses(["notice"]) # Apache 2

envoy_mobile_kt_test(
name = "envoy_configuration_test",
srcs = [
Expand Down
4 changes: 2 additions & 2 deletions library/kotlin/src/io/envoyproxy/envoymobile/BUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
licenses(["notice"]) # Apache 2

load("//bazel:aar_with_jni.bzl", "aar_with_jni")
load("//bazel:kotlin_lib.bzl", "envoy_mobile_kt_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@rules_detekt//detekt:defs.bzl", "detekt")

licenses(["notice"]) # Apache 2

aar_with_jni(
name = "android_aar",
android_library = ":envoy_lib",
Expand Down
4 changes: 2 additions & 2 deletions library/kotlin/test/io/envoyproxy/envoymobile/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("//bazel:kotlin_test.bzl", "envoy_mobile_kt_test")

licenses(["notice"]) # Apache 2

envoy_mobile_kt_test(
name = "request_builder_test",
srcs = [
Expand Down
2 changes: 2 additions & 0 deletions library/objective-c/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "objc_library")

licenses(["notice"]) # Apache 2

exports_files([
Expand Down
4 changes: 2 additions & 2 deletions library/swift/test/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("//bazel:swift_test.bzl", "envoy_mobile_swift_test")

licenses(["notice"]) # Apache 2

envoy_mobile_swift_test(
name = "envoy_client_tests",
srcs = [
Expand Down
4 changes: 2 additions & 2 deletions test/common/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
Expand Down
4 changes: 2 additions & 2 deletions test/common/buffer/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
Expand Down
4 changes: 2 additions & 2 deletions test/common/http/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
Expand Down
4 changes: 2 additions & 2 deletions test/common/network/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", "envoy_package")

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
Expand Down
Loading