-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add aarch64 CI pipeline
- Loading branch information
Showing
32 changed files
with
370 additions
and
100 deletions.
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
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
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 @@ | ||
workspace(name = 'com_baidu_babylon') | ||
|
||
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') | ||
|
||
http_archive( | ||
name = 'com_google_absl', | ||
urls = ['https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz'], | ||
strip_prefix = 'abseil-cpp-20230802.1', | ||
sha256 = '987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed', | ||
) | ||
|
||
http_archive( | ||
name = 'com_google_protobuf', | ||
urls = ['https://github.com/protocolbuffers/protobuf/archive/refs/tags/v25.3.tar.gz'], | ||
strip_prefix = 'protobuf-25.3', | ||
sha256 = 'd19643d265b978383352b3143f04c0641eea75a75235c111cc01a1350173180e', | ||
patches = ['@com_baidu_babylon//:registry/modules/protobuf/25.3.arenastring/patches/arenastring.patch'], | ||
patch_args = ['-p1'], | ||
) | ||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | ||
protobuf_deps() | ||
|
||
http_archive( | ||
name = 'com_github_nelhage_rules_boost', | ||
urls = ['https://github.com/nelhage/rules_boost/archive/4ab574f9a84b42b1809978114a4664184716f4bf.tar.gz'], | ||
strip_prefix = 'rules_boost-4ab574f9a84b42b1809978114a4664184716f4bf', | ||
sha256 = '2215e6910eb763a971b1f63f53c45c0f2b7607df38c96287666d94d954da8cdc', | ||
) | ||
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") | ||
boost_deps() | ||
|
||
################################################################################ | ||
# test only dependency | ||
http_archive( | ||
name = 'com_google_googletest', | ||
urls = ['https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz'], | ||
strip_prefix = 'googletest-1.14.0', | ||
sha256 = '8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7', | ||
) | ||
|
||
http_archive( | ||
name = "rules_cuda", | ||
urls = ["https://github.com/bazel-contrib/rules_cuda/archive/3482c70dc60d9ab1ad26b768c117fcd61ee12494.tar.gz"], | ||
strip_prefix = "rules_cuda-3482c70dc60d9ab1ad26b768c117fcd61ee12494", | ||
sha256 = 'c7bf1da41b5a31480a0477f4ced49eed08ab1cb3aff77c704e373cf9c52694f5', | ||
) | ||
load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies") | ||
rules_cuda_dependencies() | ||
register_detected_cuda_toolchains() | ||
################################################################################ |
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,45 @@ | ||
load('@bazel_tools//tools/cpp:cc_configure.bzl', 'cc_autoconf_impl') | ||
|
||
def cross_config_cc_impl(repository_ctx): | ||
cc_autoconf_impl(repository_ctx, | ||
overriden_tools = { | ||
'gcc': repository_ctx.getenv('CROSS_CC')}) | ||
|
||
cross_config_cc = repository_rule( | ||
implementation = cross_config_cc_impl, | ||
configure = True, | ||
) | ||
|
||
def cross_config_toolchain_impl(repository_ctx): | ||
repository_ctx.file('BUILD', | ||
''' | ||
load('@platforms//host:constraints.bzl', 'HOST_CONSTRAINTS') | ||
constraint_setting(name = 'compile_mode') | ||
constraint_value( | ||
name = 'cross_compile', | ||
constraint_setting = 'compile_mode', | ||
) | ||
platform( | ||
name = 'cross', | ||
constraint_values = [':cross_compile'], | ||
) | ||
toolchain( | ||
name = 'cross-toolchain', | ||
exec_compatible_with = HOST_CONSTRAINTS, | ||
target_compatible_with = [':cross_compile'], | ||
toolchain = '@cross_config_cc//:cc-compiler-k8', | ||
toolchain_type = '@bazel_tools//tools/cpp:toolchain_type', | ||
) | ||
''') | ||
|
||
cross_config_toolchain = repository_rule( | ||
implementation = cross_config_toolchain_impl, | ||
) | ||
|
||
def cross_config_impl(module_ctx): | ||
cross_config_cc(name = 'cross_config_cc') | ||
cross_config_toolchain(name = 'cross_config_toolchain') | ||
|
||
cross_config = module_extension( | ||
implementation = cross_config_impl, | ||
) |
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,2 @@ | ||
def module_name(): | ||
return native.module_name() if ('module_name' in dir(native)) else None |
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,55 @@ | ||
#!/bin/sh | ||
set -ex | ||
|
||
URL=https://github.com/baidu/babylon/archive/refs/tags/v1.1.4.tar.gz | ||
NAME=babylon-1.1.4 | ||
SHA256=2e7efea3f0a8aeffc03f908ff2875a82eb5a94cd1de3e591b6dc388f7a992411 | ||
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then | ||
wget $URL --continue -O $NAME.tar.gz | ||
fi | ||
rm -rf $NAME babylon | ||
tar xzf $NAME.tar.gz | ||
mv $NAME babylon | ||
|
||
URL=https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz | ||
NAME=abseil-cpp-20230802.1 | ||
SHA256=987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed | ||
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then | ||
wget $URL --continue -O $NAME.tar.gz | ||
fi | ||
rm -rf $NAME abseil-cpp | ||
tar xzf $NAME.tar.gz | ||
mv $NAME abseil-cpp | ||
|
||
URL=https://github.com/protocolbuffers/protobuf/archive/refs/tags/v25.3.tar.gz | ||
NAME=protobuf-25.3 | ||
SHA256=d19643d265b978383352b3143f04c0641eea75a75235c111cc01a1350173180e | ||
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then | ||
wget $URL --continue -O $NAME.tar.gz | ||
fi | ||
rm -rf $NAME protobuf | ||
tar xzf $NAME.tar.gz | ||
mv $NAME protobuf | ||
|
||
URL=https://github.com/boostorg/boost/releases/download/boost-1.83.0/boost-1.83.0.tar.gz | ||
NAME=boost-1.83.0 | ||
SHA256=0c6049764e80aa32754acd7d4f179fd5551d8172a83b71532ae093e7384e98da | ||
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then | ||
wget $URL --continue -O $NAME.tar.gz | ||
fi | ||
rm -rf $NAME boost | ||
tar xzf $NAME.tar.gz | ||
mv $NAME boost | ||
|
||
URL=https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz | ||
NAME=googletest-1.14.0 | ||
SHA256=8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7 | ||
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then | ||
wget $URL --continue -O $NAME.tar.gz | ||
fi | ||
rm -rf $NAME googletest | ||
tar xzf $NAME.tar.gz | ||
mv $NAME googletest | ||
|
||
cmake -Bbuild | ||
cmake --build build |
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,2 @@ | ||
BAZELISK_BASE_URL=https://github.com/bazelbuild/bazel/releases/download | ||
USE_BAZEL_VERSION=7.1.1 |
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 @@ | ||
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 |
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,8 @@ | ||
cc_binary( | ||
name = 'example', | ||
srcs = ['example.cpp'], | ||
deps = [ | ||
'@com_baidu_babylon//:future', | ||
'@com_baidu_babylon//:logging', | ||
], | ||
) |
Oops, something went wrong.