forked from alibaba/higress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
35,435 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
external | ||
out | ||
*.tgz | ||
|
||
*.wasm | ||
.idea/ | ||
bazel-bin | ||
bazel-out | ||
bazel-testlogs | ||
bazel-wasm-cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ header: | |
- 'Makefile*' | ||
- 'script/**' | ||
- '.gitmodules' | ||
- 'plugins/**' | ||
|
||
comment: on-failure | ||
dependency: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
workspace(name = "istio_ecosystem_wasm_extensions") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("//bazel:third_party.bzl", "wasm_extension_dependency") | ||
|
||
wasm_extension_dependency() | ||
|
||
load( | ||
"@io_bazel_rules_docker//repositories:repositories.bzl", | ||
container_repositories = "repositories", | ||
) | ||
|
||
container_repositories() | ||
|
||
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") | ||
|
||
container_deps() | ||
|
||
PROXY_WASM_CPP_SDK_SHA = "fd0be8405db25de0264bdb78fae3a82668c03782" | ||
|
||
PROXY_WASM_CPP_SDK_SHA256 = "c57de2425b5c61d7f630c5061e319b4557ae1f1c7526e5a51c33dc1299471b08" | ||
|
||
http_archive( | ||
name = "proxy_wasm_cpp_sdk", | ||
sha256 = PROXY_WASM_CPP_SDK_SHA256, | ||
strip_prefix = "proxy-wasm-cpp-sdk-" + PROXY_WASM_CPP_SDK_SHA, | ||
url = "https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/" + PROXY_WASM_CPP_SDK_SHA + ".tar.gz", | ||
) | ||
|
||
load("@proxy_wasm_cpp_sdk//bazel/dep:deps.bzl", "wasm_dependencies") | ||
|
||
wasm_dependencies() | ||
|
||
load("@proxy_wasm_cpp_sdk//bazel/dep:deps_extra.bzl", "wasm_dependencies_extra") | ||
|
||
wasm_dependencies_extra() | ||
|
||
load("@istio_ecosystem_wasm_extensions//bazel:wasm.bzl", "wasm_libraries") | ||
|
||
wasm_libraries() | ||
|
||
# To import proxy wasm cpp host, which will be used in unit testing. | ||
load("@proxy_wasm_cpp_host//bazel:repositories.bzl", "proxy_wasm_cpp_host_repositories") | ||
|
||
proxy_wasm_cpp_host_repositories() | ||
|
||
load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", "proxy_wasm_cpp_host_dependencies") | ||
|
||
proxy_wasm_cpp_host_dependencies() | ||
|
||
http_archive( | ||
name = "bazel_compdb", | ||
strip_prefix = "bazel-compilation-database-0.5.2", | ||
urls = ["https://github.com/grailbio/bazel-compilation-database/archive/0.5.2.tar.gz"], | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/absl/time/internal/cctz/src/time_zone_format.cc b/absl/time/internal/cctz/src/time_zone_format.cc | ||
index d8cb047..0c5f182 100644 | ||
--- a/absl/time/internal/cctz/src/time_zone_format.cc | ||
+++ b/absl/time/internal/cctz/src/time_zone_format.cc | ||
@@ -18,6 +18,8 @@ | ||
#endif | ||
#endif | ||
|
||
+#define HAS_STRPTIME 0 | ||
+ | ||
#if defined(HAS_STRPTIME) && HAS_STRPTIME | ||
#if !defined(_XOPEN_SOURCE) | ||
#define _XOPEN_SOURCE // Definedness suffices for strptime. | ||
@@ -58,7 +60,7 @@ namespace { | ||
|
||
#if !HAS_STRPTIME | ||
// Build a strptime() using C++11's std::get_time(). | ||
-char* strptime(const char* s, const char* fmt, std::tm* tm) { | ||
+char* strptime_local(const char* s, const char* fmt, std::tm* tm) { | ||
std::istringstream input(s); | ||
input >> std::get_time(tm, fmt); | ||
if (input.fail()) return nullptr; | ||
@@ -648,7 +650,7 @@ const char* ParseSubSeconds(const char* dp, detail::femtoseconds* subseconds) { | ||
// Parses a string into a std::tm using strptime(3). | ||
const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) { | ||
if (dp != nullptr) { | ||
- dp = strptime(dp, fmt, tm); | ||
+ dp = strptime_local(dp, fmt, tm); | ||
} | ||
return dp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
diff --git a/src/crypto/fipsmodule/rand/internal.h b/src/crypto/fipsmodule/rand/internal.h | ||
index 127e5d1..87fc6f0 100644 | ||
--- a/src/crypto/fipsmodule/rand/internal.h | ||
+++ b/src/crypto/fipsmodule/rand/internal.h | ||
@@ -27,7 +27,7 @@ extern "C" { | ||
|
||
|
||
#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_FUCHSIA) && \ | ||
- !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) | ||
+ !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) && !defined(__EMSCRIPTEN__) | ||
#define OPENSSL_URANDOM | ||
#endif | ||
|
||
diff --git a/src/crypto/internal.h b/src/crypto/internal.h | ||
index b288583..b2e9321 100644 | ||
--- a/src/crypto/internal.h | ||
+++ b/src/crypto/internal.h | ||
@@ -130,6 +130,10 @@ | ||
#endif | ||
#endif | ||
|
||
+#if defined(__EMSCRIPTEN__) | ||
+#undef OPENSSL_THREADS | ||
+#endif | ||
+ | ||
#if defined(OPENSSL_THREADS) && \ | ||
(!defined(OPENSSL_WINDOWS) || defined(__MINGW32__)) | ||
#include <pthread.h> | ||
@@ -493,7 +497,7 @@ OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); | ||
|
||
// Automatically enable C11 atomics if implemented. | ||
#if !defined(OPENSSL_C11_ATOMIC) && !defined(__STDC_NO_ATOMICS__) && \ | ||
- defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L | ||
+ defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__EMSCRIPTEN__) | ||
#define OPENSSL_C11_ATOMIC | ||
#endif | ||
|
||
diff --git a/src/crypto/rand_extra/deterministic.c b/src/crypto/rand_extra/deterministic.c | ||
index 435f063..13a77db 100644 | ||
--- a/src/crypto/rand_extra/deterministic.c | ||
+++ b/src/crypto/rand_extra/deterministic.c | ||
@@ -14,7 +14,7 @@ | ||
|
||
#include <openssl/rand.h> | ||
|
||
-#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) | ||
+#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) || defined(__EMSCRIPTEN__) | ||
|
||
#include <string.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
diff --git a/util/mutex.h b/util/mutex.h | ||
index e2a8715..4031804 100644 | ||
--- a/util/mutex.h | ||
+++ b/util/mutex.h | ||
@@ -28,10 +28,10 @@ | ||
#if defined(MUTEX_IS_WIN32_SRWLOCK) | ||
#include <windows.h> | ||
typedef SRWLOCK MutexType; | ||
-#elif defined(MUTEX_IS_PTHREAD_RWLOCK) | ||
-#include <pthread.h> | ||
-#include <stdlib.h> | ||
-typedef pthread_rwlock_t MutexType; | ||
+// #elif defined(MUTEX_IS_PTHREAD_RWLOCK) | ||
+// #include <pthread.h> | ||
+// #include <stdlib.h> | ||
+// typedef pthread_rwlock_t MutexType; | ||
#else | ||
#include <mutex> | ||
typedef std::mutex MutexType; | ||
@@ -73,21 +73,21 @@ void Mutex::Unlock() { ReleaseSRWLockExclusive(&mutex_); } | ||
void Mutex::ReaderLock() { AcquireSRWLockShared(&mutex_); } | ||
void Mutex::ReaderUnlock() { ReleaseSRWLockShared(&mutex_); } | ||
|
||
-#elif defined(MUTEX_IS_PTHREAD_RWLOCK) | ||
+// #elif defined(MUTEX_IS_PTHREAD_RWLOCK) | ||
|
||
-#define SAFE_PTHREAD(fncall) \ | ||
- do { \ | ||
- if ((fncall) != 0) abort(); \ | ||
- } while (0) | ||
+// #define SAFE_PTHREAD(fncall) \ | ||
+// do { \ | ||
+// if ((fncall) != 0) abort(); \ | ||
+// } while (0) | ||
|
||
-Mutex::Mutex() { SAFE_PTHREAD(pthread_rwlock_init(&mutex_, NULL)); } | ||
-Mutex::~Mutex() { SAFE_PTHREAD(pthread_rwlock_destroy(&mutex_)); } | ||
-void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock(&mutex_)); } | ||
-void Mutex::Unlock() { SAFE_PTHREAD(pthread_rwlock_unlock(&mutex_)); } | ||
-void Mutex::ReaderLock() { SAFE_PTHREAD(pthread_rwlock_rdlock(&mutex_)); } | ||
-void Mutex::ReaderUnlock() { SAFE_PTHREAD(pthread_rwlock_unlock(&mutex_)); } | ||
+// Mutex::Mutex() { SAFE_PTHREAD(pthread_rwlock_init(&mutex_, NULL)); } | ||
+// Mutex::~Mutex() { SAFE_PTHREAD(pthread_rwlock_destroy(&mutex_)); } | ||
+// void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock(&mutex_)); } | ||
+// void Mutex::Unlock() { SAFE_PTHREAD(pthread_rwlock_unlock(&mutex_)); } | ||
+// void Mutex::ReaderLock() { SAFE_PTHREAD(pthread_rwlock_rdlock(&mutex_)); } | ||
+// void Mutex::ReaderUnlock() { SAFE_PTHREAD(pthread_rwlock_unlock(&mutex_)); } | ||
|
||
-#undef SAFE_PTHREAD | ||
+// #undef SAFE_PTHREAD | ||
|
||
#else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def wasm_extension_dependency(): | ||
# Need to push Wasm OCI images | ||
http_archive( | ||
name = "io_bazel_rules_docker", | ||
sha256 = "92779d3445e7bdc79b961030b996cb0c91820ade7ffa7edca69273f404b085d5", | ||
strip_prefix = "rules_docker-0.20.0", | ||
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.20.0/rules_docker-v0.20.0.tar.gz"], | ||
) |
Oops, something went wrong.