├── .bazelrc ├── .bazelversion ├── .gitignore ├── .gitmodules ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README.md ├── WORKSPACE ├── base ├── BUILD ├── build_info.c ├── build_info.h ├── init.cc └── init.h ├── examples ├── BUILD ├── asan │ ├── BUILD │ ├── leak.cc │ └── use-after-free.cc ├── hello.cc ├── hello_test.cc ├── rpc │ ├── BUILD │ ├── bank-client.cc │ ├── bank-server.cc │ ├── bank.proto │ └── helloworld │ │ ├── BUILD │ │ ├── README.md │ │ ├── greeter_async_client.cc │ │ ├── greeter_async_server.cc │ │ ├── greeter_client.cc │ │ ├── greeter_server.cc │ │ ├── helloworld.proto │ │ └── java │ │ └── io │ │ └── grpc │ │ └── examples │ │ └── helloworld │ │ ├── HelloWorldClient.java │ │ └── HelloWorldServer.java └── run_under │ ├── BUILD │ └── env.py ├── install-bazel.sh ├── third_party ├── boost │ └── BUILD ├── boringssl │ ├── BUILD │ ├── BUILD.generated.bzl │ ├── BUILD.generated_tests.bzl │ ├── err_data.c │ ├── linux-aarch64 │ │ └── crypto │ │ │ ├── aes │ │ │ ├── aesv8-armx.S │ │ │ └── aesv8-armx64.S │ │ │ ├── bn │ │ │ └── armv8-mont.S │ │ │ ├── modes │ │ │ ├── ghashv8-armx.S │ │ │ └── ghashv8-armx64.S │ │ │ └── sha │ │ │ ├── sha1-armv8.S │ │ │ ├── sha256-armv8.S │ │ │ └── sha512-armv8.S │ ├── linux-arm │ │ └── crypto │ │ │ ├── aes │ │ │ ├── aes-armv4.S │ │ │ ├── aesv8-armx.S │ │ │ ├── aesv8-armx32.S │ │ │ └── bsaes-armv7.S │ │ │ ├── bn │ │ │ └── armv4-mont.S │ │ │ ├── modes │ │ │ ├── ghash-armv4.S │ │ │ ├── ghashv8-armx.S │ │ │ └── ghashv8-armx32.S │ │ │ └── sha │ │ │ ├── sha1-armv4-large.S │ │ │ ├── sha256-armv4.S │ │ │ └── sha512-armv4.S │ ├── linux-x86 │ │ └── crypto │ │ │ ├── aes │ │ │ ├── aes-586.S │ │ │ ├── aesni-x86.S │ │ │ └── vpaes-x86.S │ │ │ ├── bn │ │ │ ├── bn-586.S │ │ │ ├── co-586.S │ │ │ └── x86-mont.S │ │ │ ├── cpu-x86-asm.S │ │ │ ├── md5 │ │ │ └── md5-586.S │ │ │ ├── modes │ │ │ └── ghash-x86.S │ │ │ ├── rc4 │ │ │ └── rc4-586.S │ │ │ └── sha │ │ │ ├── sha1-586.S │ │ │ ├── sha256-586.S │ │ │ └── sha512-586.S │ └── linux-x86_64 │ │ └── crypto │ │ ├── aes │ │ ├── aes-x86_64.S │ │ ├── aesni-x86_64.S │ │ ├── bsaes-x86_64.S │ │ └── vpaes-x86_64.S │ │ ├── bn │ │ ├── rsaz-avx2.S │ │ ├── rsaz-x86_64.S │ │ ├── x86_64-mont.S │ │ └── x86_64-mont5.S │ │ ├── cpu-x86_64-asm.S │ │ ├── ec │ │ └── p256-x86_64-asm.S │ │ ├── md5 │ │ └── md5-x86_64.S │ │ ├── modes │ │ ├── aesni-gcm-x86_64.S │ │ └── ghash-x86_64.S │ │ ├── rand │ │ └── rdrand-x86_64.S │ │ ├── rc4 │ │ ├── rc4-md5-x86_64.S │ │ └── rc4-x86_64.S │ │ └── sha │ │ ├── sha1-x86_64.S │ │ ├── sha256-x86_64.S │ │ └── sha512-x86_64.S ├── cares │ ├── ares_build.h │ ├── cares.BUILD │ ├── config_darwin │ │ └── ares_config.h │ └── config_linux │ │ └── ares_config.h ├── chromium_browser_clang │ ├── BUILD │ ├── CROSSTOOL │ └── get_latest.py ├── clang_toolchain │ ├── BUILD │ ├── cc_configure_clang.bzl │ └── download_clang.bzl ├── folly │ ├── BUILD │ └── linux-k8 │ │ └── folly │ │ └── folly-config.h ├── gflags │ ├── BUILD │ └── gflags_build │ │ └── k8 │ │ └── include │ │ └── gflags │ │ ├── config.h │ │ ├── gflags.h │ │ ├── gflags_completions.h │ │ ├── gflags_declare.h │ │ └── gflags_gflags.h ├── glog │ └── glog_build │ │ └── k8 │ │ ├── include │ │ └── glog │ │ │ ├── logging.h │ │ │ ├── raw_logging.h │ │ │ ├── stl_logging.h │ │ │ └── vlog_is_on.h │ │ └── src │ │ └── config.h ├── gmock │ └── BUILD ├── gperftools │ ├── BUILD │ ├── linux-x86_64 │ │ └── src │ │ │ ├── config.h │ │ │ └── gperftools │ │ │ └── tcmalloc.h │ └── runtest.sh ├── http-parser │ └── BUILD ├── icu │ ├── BUILD │ ├── icupkg.inc.x86_64 │ ├── my-config.sh │ └── test │ │ ├── BUILD │ │ ├── README │ │ ├── gtest_UnicodeString.cpp │ │ └── test_icu.cpp ├── ijar │ ├── BUILD │ ├── LICENSE │ ├── README.txt │ ├── classfile.cc │ ├── common.h │ ├── ijar.cc │ ├── test │ │ ├── A.java │ │ ├── AnnotatedClass.java │ │ ├── Annotations.java │ │ ├── B.java │ │ ├── BUILD │ │ ├── DeprecatedParts.java │ │ ├── DumbClass.java │ │ ├── EnclosingMethod.java │ │ ├── IjarTests.java │ │ ├── Object.java │ │ ├── PrivateMembersClass.java │ │ ├── PrivateNestedClass.java │ │ ├── StripVerifyingVisitor.java │ │ ├── TypeAnnotationTest2.java │ │ ├── UseDeprecatedParts.java │ │ ├── UseRestrictedAnnotation.java │ │ ├── WellCompressed1.java │ │ ├── WellCompressed2.java │ │ ├── ijar_test.sh │ │ ├── invokedynamic │ │ │ └── ClassWithLambda.java │ │ ├── libwrongcentraldir.jar │ │ ├── package-info.java │ │ ├── testenv.sh │ │ ├── typeannotations2 │ │ │ ├── NonNull.java │ │ │ ├── Nullable.java │ │ │ ├── Util.java │ │ │ └── java │ │ │ │ └── lang │ │ │ │ └── annotation │ │ │ │ └── ElementType.java │ │ └── zip_test.sh │ ├── zip.cc │ ├── zip.h │ └── zip_main.cc ├── java │ ├── animal-sniffer │ │ └── BUILD │ ├── commons-logging │ │ └── BUILD │ ├── grpc-java │ │ └── BUILD │ ├── guava │ │ └── BUILD │ ├── j2objc │ │ └── BUILD │ ├── javassist │ │ └── BUILD │ ├── jdk │ │ └── langtools │ │ │ ├── BUILD │ │ │ └── javac.jar │ ├── jsr305 │ │ ├── BUILD │ │ ├── LICENSE │ │ └── jsr-305.jar │ ├── log4j │ │ └── BUILD │ ├── slf4j │ │ └── BUILD │ └── twitter-commons │ │ └── BUILD ├── jemalloc │ ├── BUILD │ ├── gen_public_symbols.sh │ └── k8 │ │ └── include │ │ └── jemalloc │ │ ├── internal │ │ ├── jemalloc_internal_defs.h │ │ ├── jemalloc_preamble.h │ │ ├── private_namespace.gen.h │ │ ├── private_namespace.h │ │ ├── public_namespace.h │ │ ├── public_symbols.txt │ │ └── public_unnamespace.h │ │ ├── jemalloc.h │ │ ├── jemalloc_defs.h │ │ ├── jemalloc_macros.h │ │ ├── jemalloc_mangle.h │ │ ├── jemalloc_mangle_jet.h │ │ ├── jemalloc_protos.h │ │ ├── jemalloc_protos_jet.h │ │ ├── jemalloc_rename.h │ │ └── jemalloc_typedefs.h ├── libco │ └── BUILD ├── libevent │ ├── BUILD │ └── linux-k8 │ │ ├── event-config.h │ │ └── internal │ │ └── config.h ├── libunwind │ ├── BUILD │ └── libunwind_build │ │ └── k8 │ │ └── include │ │ ├── libunwind-common.h │ │ ├── libunwind.h │ │ ├── private │ │ └── config.h │ │ └── tdep │ │ └── libunwind_i.h ├── openssl │ ├── BUILD │ ├── BUILD.generated.bzl │ ├── generate_build_files.py │ └── linux-x86_64 │ │ ├── crypto │ │ ├── aes │ │ │ └── asm │ │ │ │ ├── aes-x86_64.S │ │ │ │ ├── aesni-mb-x86_64.S │ │ │ │ ├── aesni-sha1-x86_64.S │ │ │ │ ├── aesni-sha256-x86_64.S │ │ │ │ ├── aesni-x86_64.S │ │ │ │ ├── bsaes-x86_64.S │ │ │ │ └── vpaes-x86_64.S │ │ ├── bn │ │ │ └── asm │ │ │ │ ├── rsaz-avx2.S │ │ │ │ ├── rsaz-x86_64.S │ │ │ │ ├── x86_64-gf2m.S │ │ │ │ ├── x86_64-mont.S │ │ │ │ └── x86_64-mont5.S │ │ ├── camellia │ │ │ └── asm │ │ │ │ └── cmll-x86_64.S │ │ ├── ec │ │ │ └── asm │ │ │ │ └── ecp_nistz256-x86_64.S │ │ ├── md5 │ │ │ └── asm │ │ │ │ └── md5-x86_64.S │ │ ├── modes │ │ │ └── asm │ │ │ │ ├── aesni-gcm-x86_64.S │ │ │ │ └── ghash-x86_64.S │ │ ├── rc4 │ │ │ └── asm │ │ │ │ ├── rc4-md5-x86_64.S │ │ │ │ └── rc4-x86_64.S │ │ ├── sha │ │ │ └── asm │ │ │ │ ├── sha1-mb-x86_64.S │ │ │ │ ├── sha1-x86_64.S │ │ │ │ ├── sha256-mb-x86_64.S │ │ │ │ ├── sha256-x86_64.S │ │ │ │ └── sha512-x86_64.S │ │ ├── whrlpool │ │ │ └── asm │ │ │ │ └── wp-x86_64.S │ │ └── x86_64cpuid.S │ │ └── include │ │ └── openssl │ │ ├── aes.h │ │ ├── asn1.h │ │ ├── asn1_mac.h │ │ ├── asn1t.h │ │ ├── bio.h │ │ ├── blowfish.h │ │ ├── bn.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast.h │ │ ├── cmac.h │ │ ├── cms.h │ │ ├── comp.h │ │ ├── conf.h │ │ ├── conf_api.h │ │ ├── crypto.h │ │ ├── des.h │ │ ├── des_old.h │ │ ├── dh.h │ │ ├── dsa.h │ │ ├── dso.h │ │ ├── dtls1.h │ │ ├── e_os2.h │ │ ├── ebcdic.h │ │ ├── ec.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── engine.h │ │ ├── err.h │ │ ├── evp.h │ │ ├── hmac.h │ │ ├── idea.h │ │ ├── krb5_asn.h │ │ ├── kssl.h │ │ ├── lhash.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── mdc2.h │ │ ├── modes.h │ │ ├── obj_mac.h │ │ ├── objects.h │ │ ├── ocsp.h │ │ ├── opensslconf.h │ │ ├── opensslv.h │ │ ├── ossl_typ.h │ │ ├── pem.h │ │ ├── pem2.h │ │ ├── pkcs12.h │ │ ├── pkcs7.h │ │ ├── pqueue.h │ │ ├── rand.h │ │ ├── rc2.h │ │ ├── rc4.h │ │ ├── ripemd.h │ │ ├── rsa.h │ │ ├── safestack.h │ │ ├── seed.h │ │ ├── sha.h │ │ ├── srp.h │ │ ├── srtp.h │ │ ├── ssl.h │ │ ├── ssl2.h │ │ ├── ssl23.h │ │ ├── ssl3.h │ │ ├── stack.h │ │ ├── symhacks.h │ │ ├── tls1.h │ │ ├── ts.h │ │ ├── txt_db.h │ │ ├── ui.h │ │ ├── ui_compat.h │ │ ├── whrlpool.h │ │ ├── x509.h │ │ ├── x509_vfy.h │ │ └── x509v3.h ├── pbjson │ ├── BUILD │ └── pbjson.h ├── plink │ ├── BUILD │ ├── LICENSE │ ├── plink.py │ └── setup.py ├── proxygen │ └── BUILD ├── rapidjson │ └── BUILD ├── snappy │ ├── BUILD │ └── linux-k8 │ │ ├── config.h │ │ └── snappy-stubs-public.h ├── v8 │ ├── BUILD │ └── base │ │ └── trace_event │ │ └── .keep ├── wangle │ └── BUILD └── zlib │ └── BUILD └── tools ├── BUILD ├── android ├── BUILD ├── aar_generator.sh ├── android_permissions.py ├── build_incremental_dexmanifest.py ├── build_split_manifest.py ├── build_split_manifest_test.py ├── incremental_install.py ├── incremental_install_test.py ├── jack │ ├── BUILD │ ├── empty │ └── fail.sh ├── merge_manifests.py ├── merge_manifests_test.py ├── proguard_whitelister.py ├── proguard_whitelister_input.cfg ├── proguard_whitelister_test.py ├── resources_processor.sh ├── strip_resources.py ├── stubify_manifest.py └── stubify_manifest_test.py ├── bazel.rc ├── build_rules ├── BUILD ├── appengine │ ├── BUILD │ ├── README.md │ ├── appengine.BUILD │ ├── appengine.WORKSPACE │ └── appengine.bzl ├── boost.bzl ├── closure │ ├── BUILD │ ├── README.md │ ├── closure.WORKSPACE │ ├── closure_compiler.BUILD │ ├── closure_js_binary.bzl │ ├── closure_js_library.bzl │ ├── closure_library.BUILD │ ├── closure_stylesheet_library.bzl │ ├── closure_template_library.bzl │ └── closure_templates.BUILD ├── genproto.bzl ├── java_rules_skylark.bzl ├── pkg_deb.bzl ├── py_rules.bzl ├── run_under.bzl ├── rust │ ├── README.md │ └── rust.bzl └── test_rules.bzl ├── buildstamp ├── BUILD └── get_workspace_status ├── cpp └── BUILD ├── defaults └── BUILD ├── genrule ├── BUILD └── genrule-setup.sh ├── jdk └── BUILD ├── lrte ├── BUILD └── CROSSTOOL ├── objc ├── BUILD ├── dummy.c ├── ios_runner.sh.mac_template ├── ios_test.sh.bazel_template ├── j2objc_dead_code_pruner.py ├── memleaks │ ├── BUILD │ └── memleaks_stub ├── memleaks_plugin_stub ├── sim_devices │ └── BUILD └── testrunner_stub ├── python ├── 2to3.sh ├── BUILD └── plink_wrapper.sh ├── test ├── BUILD ├── dummy_coverage_report_generator └── test-setup.sh └── test_sharding_compliant /.bazelrc: -------------------------------------------------------------------------------- 1 | # Use jemalloc as the C++ allocator 2 | # To use it: bazel build --config jemalloc 3 | build:jemalloc --custom_malloc=//third_party/jemalloc 4 | 5 | build:tcmalloc --custom_malloc=//third_party/gperftools:tcmalloc 6 | 7 | # This build mode switch the compiler to the prebuilt clang downloaded from chromium source tree 8 | build:clang --repo_env TF_DOWNLOAD_CLANG=1 --crosstool_top=@local_config_download_clang//:toolchain 9 | 10 | # Protobuf settings 11 | # Use fast cpp protos in python protobuf. 12 | build --define=use_fast_cpp_protos=true 13 | -------------------------------------------------------------------------------- /.bazelversion: -------------------------------------------------------------------------------- 1 | 3.7.2 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Editor backup files 2 | *~ 3 | # output generated by bazel. 4 | bazel-* 5 | 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Use container based environment, slightly faster than standard 2 | sudo: required 3 | dist: trusty 4 | 5 | language: java 6 | 7 | jdk: 8 | - oraclejdk8 9 | 10 | addons: 11 | apt: 12 | sources: 13 | - ubuntu-toolchain-r-test 14 | packages: 15 | #- gcc-4.8 16 | #- g++-4.8 17 | - wget 18 | # Package list from http://bazel.io/docs/install.html 19 | - pkg-config 20 | - zip 21 | - zlib1g-dev 22 | - gperf # To build proxygen 23 | 24 | install: 25 | - ./install-bazel.sh 26 | - wget https://raw.githubusercontent.com/mzhaom/lrte/master/install-release.sh && sudo bash install-release.sh 27 | 28 | script: 29 | # The kernel used by travis is too old to allow namespace creation 30 | # for normal account, so we disable it. 31 | - bazel --batch build --crosstool_top=//tools/lrte:toolchain --spawn_strategy=standalone --genrule_strategy=standalone //examples/...:all //third_party/java/netty:all //third_party/java/guava:all 32 | - bazel --batch test --test_tag_filters=-no_travis --test_output=errors --crosstool_top=//tools/lrte:toolchain --spawn_strategy=standalone //examples/...:all //third_party/gperftools:all //third_party/folly:all //third_party/proxygen:all 33 | 34 | notifications: 35 | email: false 36 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bazelment/lrte:latest 2 | 3 | RUN apt-get update && apt-get -y install git 4 | 5 | ADD . /trunk 6 | WORKDIR /trunk 7 | 8 | RUN git submodule update --init 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # trunk 2 | 3 | [![Build Status](https://travis-ci.org/bazelment/trunk.svg?branch=master)](https://travis-ci.org/bazelment/trunk) 4 | 5 | 6 | A collection of C++/Java opensource projects with BUILD files so they 7 | can be easily built with [bazel](http://bazel.io). 8 | 9 | To try: 10 | 11 | ```sh 12 | $ git clone https://github.com/mzhaom/trunk && cd trunk 13 | $ git submodule update --init 14 | $ bazel build examples/... 15 | ``` 16 | 17 | If you have used [docker](https://www.docker.com/) before, there is a 18 | [docker image](https://hub.docker.com/r/bazelment/trunk/) that has 19 | bazel installed with all the trunk source checked out, which can be 20 | tried with: 21 | 22 | ```sh 23 | $ docker run --rm -ti bazelment/trunk:lrte 24 | $ bazel build examples/... 25 | ``` 26 | 27 | Currently C++ projects can be only built on Linux x64 system. 28 | 29 | ## C++ 30 | * [gflags](http://gflags.github.io/gflags/) 31 | * [glog](https://github.com/google/glog) 32 | * [googlemock](https://code.google.com/p/googlemock/) 33 | * [googletest](https://code.google.com/p/googletest/) 34 | * [gperftools](https://code.google.com/p/gperftools/) tcmalloc, heap-checker, heap-profiler and cpu-profiler. 35 | * [grpc](http://www.grpc.io/) 36 | * [libevent](http://libevent.org/): version 1 37 | * [libunwind](http://www.nongnu.org/libunwind) 38 | * [protobuf](https://github.com/google/protobuf) 39 | * [re2](https://github.com/google/re2) 40 | * [snappy](https://github.com/google/snappy) 41 | 42 | * [folly](https://www.facebook.com/notes/facebook-engineering/folly-the-facebook-open-source-library/10150864656793920) and supporting libraries. 43 | * [double-conversion](https://github.com/floitsch/double-conversion/) 44 | * A selection of [boost](http://www.boost.org/) modules, mostly for building folly. 45 | 46 | ## Java 47 | * [grpc-java](http://www.grpc.io) gRPC in Java 48 | * [guava](https://github.com/google/guava) Guava: Google Core Libraries for Java 49 | * [netty](https://netty.io/) Netty is a NIO client server framework 50 | which enables quick and easy development of network applications 51 | such as protocol servers and clients. 52 | -------------------------------------------------------------------------------- /base/BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | visibility = ["//visibility:public"], 3 | name = 'build_info', 4 | hdrs = [ 5 | 'build_info.h' 6 | ], 7 | linkstamp = 'build_info.c' 8 | ) 9 | 10 | cc_library( 11 | visibility = ["//visibility:public"], 12 | name = 'init', 13 | hdrs = [ 14 | 'init.h' 15 | ], 16 | srcs = [ 17 | 'init.cc', 18 | ], 19 | deps = [ 20 | "@com_google_absl//absl/debugging:failure_signal_handler", 21 | "@com_google_absl//absl/flags:parse", 22 | "//external:glog", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /base/build_info.c: -------------------------------------------------------------------------------- 1 | #include "base/build_info.h" 2 | 3 | const char* kBuildEmbedLabel = BUILD_EMBED_LABEL; 4 | const char* kBuildHost = BUILD_HOST; 5 | const char* kBuildUser = BUILD_USER; 6 | const char* kBuildScmRevision = BUILD_SCM_REVISION; 7 | const char* kBuildScmStatus = BUILD_SCM_STATUS; 8 | const time_t kBuildTimestamp = (time_t)(BUILD_TIMESTAMP / 1000.0); 9 | const char* kBazelTargetName = G3_TARGET_NAME; 10 | const char* kBazelPlatform = GPLATFORM; 11 | -------------------------------------------------------------------------------- /base/build_info.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE_BUILD_INFO_H_ 2 | #define BASE_BUILD_INFO_H_ 3 | 4 | #include 5 | 6 | // Value of --embed_label when running bazel build. 7 | extern const char* kBuildEmbedLabel; 8 | 9 | // Host where the build was performed. 10 | extern const char* kBuildHost; 11 | 12 | // User who performed the build. 13 | extern const char* kBuildUser; 14 | 15 | // SCM revision used to build the binary. 16 | extern const char* kBuildScmRevision; 17 | 18 | // SCM status(clean or modified) when the build is performed. 19 | extern const char* kBuildScmStatus; 20 | 21 | // Epoch time when the build was performed. 22 | extern const time_t kBuildTimestamp; 23 | 24 | // Build target for this binary, like "//base:some_binary" 25 | extern const char* kBazelTargetName; 26 | 27 | // Cpp platform used for this build process, like "local_linux" 28 | extern const char* kBazelPlatform; 29 | 30 | #endif // BASE_BUILD_INFO_H_ 31 | -------------------------------------------------------------------------------- /base/init.cc: -------------------------------------------------------------------------------- 1 | #include "base/init.h" 2 | 3 | #include "absl/debugging/failure_signal_handler.h" 4 | #include "absl/debugging/symbolize.h" 5 | #include "absl/flags/parse.h" 6 | #include "glog/logging.h" 7 | 8 | namespace base { 9 | void InitProgram(int argc, char *argv[]) { 10 | // Initialize the symbolizer to get a human-readable stack trace 11 | absl::InitializeSymbolizer(argv[0]); 12 | 13 | absl::FailureSignalHandlerOptions options; 14 | absl::InstallFailureSignalHandler(options); 15 | 16 | absl::ParseCommandLine(argc, argv); 17 | google::InitGoogleLogging(argv[0]); 18 | } 19 | 20 | } // namespace base 21 | -------------------------------------------------------------------------------- /base/init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace base { 4 | // Setup logging/crash handler and parse command line flags. 5 | void InitProgram(int argc, char *argv[]); 6 | } // namespace base 7 | -------------------------------------------------------------------------------- /examples/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "hello", 5 | srcs = [ 6 | "hello.cc" 7 | ], 8 | deps = [ 9 | "//base:build_info", 10 | "//base:init", 11 | "//external:glog", 12 | ], 13 | stamp = 1, 14 | ) 15 | 16 | cc_test( 17 | name = "hello_test", 18 | srcs = [ 19 | "hello_test.cc", 20 | ], 21 | deps = [ 22 | "//external:gtest_main", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /examples/asan/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "use-after-free", 3 | srcs = [ 4 | "use-after-free.cc" 5 | ], 6 | ) 7 | 8 | cc_binary( 9 | name = "leak", 10 | srcs = [ 11 | "leak.cc" 12 | ], 13 | testonly = 1, 14 | deps = [ 15 | "//third_party/gperftools:tcmalloc_heapcheck", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /examples/asan/leak.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // This file demonstrates the usage of tcmalloc heapchecker to detect 4 | // memory leak. 5 | // 6 | // bazel build examples/asan:leak 7 | // 8 | // export PPROF_PATH=...path_to...third_party/gperftools/upstream/src/pprof 9 | // HEAPCHECK=strict bazel-bin/examples/asan/leak 10 | // 11 | // You should see leak report like this: 12 | // 13 | // Leak of 40 bytes in 1 objects allocated from: 14 | // @ 403cc8 main 15 | // @ 7fb9999937b0 __libc_start_main 16 | int main() { 17 | int* a = new int[10]; 18 | a[0] = 1; 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /examples/asan/use-after-free.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | int* a = new int[10]; 5 | a[0] = 1; 6 | delete[] a; 7 | printf("a: %d\n", a[0]); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /examples/hello.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "base/build_info.h" 3 | #include "base/init.h" 4 | #include "glog/logging.h" 5 | 6 | // DECLARE_bool(logtostderr); 7 | int main(int argc, char *argv[]) { 8 | // FLAGS_logtostderr = true; 9 | base::InitProgram(argc, argv); 10 | LOG(INFO) << "Hello World!"; 11 | char timestamp[32]; 12 | std::strftime(timestamp, sizeof(timestamp), "%c", 13 | std::localtime(&kBuildTimestamp)); 14 | LOG(INFO) << "Built by " << kBuildUser << "@" << kBuildHost 15 | << " as " << kBazelTargetName 16 | << " on " << timestamp 17 | << " as " << kBazelTargetName 18 | << " with git revision @" << kBuildScmRevision; 19 | abort(); 20 | char* buffer = new char[1024*1024*1024]; 21 | buffer[0] = 'a'; 22 | delete[] buffer; 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /examples/hello_test.cc: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | // A simple example to demonstrate the usage of gtest: 4 | // https://github.com/google/googletest 5 | 6 | namespace examples { 7 | namespace { 8 | 9 | class HelloTest : public testing::Test { 10 | protected: 11 | virtual void SetUp() override { 12 | } 13 | 14 | virtual void TearDown() override { 15 | } 16 | }; 17 | 18 | TEST_F(HelloTest, Foo) { 19 | int a = 1; 20 | EXPECT_EQ(1, a); 21 | } 22 | 23 | } // anonymous namespace 24 | } // namespace examples 25 | -------------------------------------------------------------------------------- /examples/rpc/BUILD: -------------------------------------------------------------------------------- 1 | load("@com_github_grpc_grpc//bazel:grpc_build_system.bzl", "grpc_proto_library") 2 | 3 | load("@rules_proto//proto:defs.bzl", "proto_library") 4 | 5 | # See cc_grpc_library.bzl, this will create the following build targets: 6 | # proto_library: "_bank_only" 7 | # cc_proto_library: "_bank_cc_proto" 8 | # generate_cc(generate grpc header/cpp files): "_bank_grpc_codegen" 9 | # cc_library(for generate grpc stub files): "bank" 10 | 11 | grpc_proto_library( 12 | name = "bank", 13 | srcs = [ 14 | "bank.proto", 15 | ], 16 | ) 17 | 18 | cc_binary( 19 | name = "bank-server", 20 | srcs = [ 21 | "bank-server.cc" 22 | ], 23 | deps = [ 24 | ":bank", 25 | "//base:init", 26 | "//external:glog", 27 | "//external:grpc++", 28 | "@com_google_absl//absl/flags:flag", 29 | ] 30 | ) 31 | 32 | cc_binary( 33 | name = "bank-client", 34 | srcs = [ 35 | "bank-client.cc" 36 | ], 37 | deps = [ 38 | ":bank", 39 | "//base:init", 40 | "//external:glog", 41 | "//external:grpc++", 42 | "@com_google_absl//absl/flags:flag", 43 | ] 44 | ) 45 | 46 | # Demonstrate how to use python client to access grpc. 47 | load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") 48 | 49 | py_proto_library( 50 | name = "bank_py_proto", 51 | deps = [ 52 | ":_bank_only" 53 | ] 54 | ) 55 | 56 | py_grpc_library( 57 | name = "bank_py_grpc", 58 | srcs = [":_bank_only"], 59 | deps = [":bank_py_proto"], 60 | ) 61 | 62 | # py_binary( 63 | # name = "bank_client_py", 64 | # srcs = ["bank_client.py"], 65 | # python_version = "PY3", 66 | # srcs_version = "PY2AND3", 67 | # deps = [ 68 | # # ":bank_py_pb2", 69 | # # ":bank_py_pb2_grpc", 70 | # ] 71 | # ) 72 | -------------------------------------------------------------------------------- /examples/rpc/bank-client.cc: -------------------------------------------------------------------------------- 1 | #include "examples/rpc/bank.grpc.pb.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "absl/flags/flag.h" 11 | #include "absl/strings/str_format.h" 12 | #include "glog/logging.h" 13 | 14 | #include "base/init.h" 15 | 16 | using grpc::Channel; 17 | using grpc::ClientContext; 18 | using grpc::Status; 19 | 20 | ABSL_FLAG(int32_t, port, 10000, "Listening port of RPC service"); 21 | ABSL_DECLARE_FLAG(bool, logtostderr); 22 | 23 | namespace examples { 24 | 25 | static void RunClient() { 26 | LOG(INFO) << "Start the client."; 27 | std::shared_ptr 28 | channel(grpc::CreateChannel(absl::StrFormat("localhost:%d", absl::GetFlag(FLAGS_port)), 29 | grpc::InsecureChannelCredentials())); 30 | std::unique_ptr stub(Bank::NewStub(channel)); 31 | DepositRequest request; 32 | request.set_account("xucheng"); 33 | request.set_amount(25); 34 | ClientContext context; 35 | DepositReply response; 36 | Status status = stub->Deposit(&context, request, &response); 37 | if (status.ok()) { 38 | LOG(INFO) << response.account() << " balance:" << response.balance(); 39 | } else { 40 | LOG(INFO) << "RPC failed: " << status.error_code(); 41 | } 42 | } 43 | 44 | } // namespace examples 45 | 46 | int main(int argc, char** argv) { 47 | // Set this to true so that useful logout can be seen. 48 | absl::SetFlag(&FLAGS_logtostderr, true); 49 | base::InitProgram(argc, argv); 50 | examples::RunClient(); 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /examples/rpc/bank-server.cc: -------------------------------------------------------------------------------- 1 | #include "examples/rpc/bank.grpc.pb.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "absl/flags/flag.h" 13 | #include "glog/logging.h" 14 | 15 | #include "base/init.h" 16 | 17 | ABSL_FLAG(int32_t, port, 10000, "Listening port of RPC service"); 18 | 19 | namespace examples { 20 | 21 | class BankImpl : public Bank::Service { 22 | public: 23 | virtual grpc::Status Deposit(grpc::ServerContext* context, 24 | const DepositRequest* request, 25 | DepositReply* response) { 26 | double balance = balances_[request->account()]; 27 | balance += request->amount(); 28 | balances_[request->account()] = balance; 29 | response->set_account(request->account()); 30 | response->set_balance(balance); 31 | return grpc::Status::OK; 32 | } 33 | 34 | private: 35 | std::unordered_map balances_; 36 | }; 37 | 38 | static void RunServer() { 39 | std::stringstream server_address; 40 | server_address << "0.0.0.0:" << absl::GetFlag(FLAGS_port); 41 | BankImpl service; 42 | 43 | LOG(INFO) << "Server listening on " << server_address.str(); 44 | grpc::ServerBuilder builder; 45 | builder.AddListeningPort(server_address.str(), 46 | grpc::InsecureServerCredentials()); 47 | builder.RegisterService(&service); 48 | std::unique_ptr server(builder.BuildAndStart()); 49 | server->Wait(); 50 | } 51 | 52 | } // namespace examples 53 | 54 | int main(int argc, char** argv) { 55 | base::InitProgram(argc, argv); 56 | examples::RunServer(); 57 | 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /examples/rpc/bank.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package examples; 4 | 5 | message DepositRequest { 6 | required string account = 1; 7 | required double amount = 2; 8 | }; 9 | 10 | message DepositReply { 11 | required string account = 1; 12 | required double balance = 2; 13 | }; 14 | 15 | service Bank { 16 | rpc Deposit(DepositRequest) returns (DepositReply) { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/rpc/helloworld/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools/build_rules/grpc:grpc_proto.bzl", "proto_library") 2 | 3 | proto_library( 4 | name = "helloworld", 5 | src = "helloworld.proto", 6 | has_service = True, 7 | generate_cc = True, 8 | # generate_java = True, 9 | ) 10 | 11 | cc_binary( 12 | name = "greeter_client", 13 | srcs = [ 14 | "greeter_client.cc", 15 | ], 16 | deps = [ 17 | ":helloworld", 18 | ], 19 | ) 20 | 21 | cc_binary( 22 | name = "greeter_server", 23 | srcs = [ 24 | "greeter_server.cc", 25 | ], 26 | deps = [ 27 | ":helloworld", 28 | ], 29 | ) 30 | 31 | cc_binary( 32 | name = "greeter_async_client", 33 | srcs = [ 34 | "greeter_async_client.cc", 35 | ], 36 | deps = [ 37 | ":helloworld", 38 | ], 39 | ) 40 | 41 | cc_binary( 42 | name = "greeter_async_server", 43 | srcs = [ 44 | "greeter_async_server.cc", 45 | ], 46 | deps = [ 47 | ":helloworld", 48 | ], 49 | ) 50 | 51 | # TODO: fix grpc-java 52 | # java_binary( 53 | # name = "greeter_client_java", 54 | # srcs = [ 55 | # "java/io/grpc/examples/helloworld/HelloWorldClient.java" 56 | # ], 57 | # main_class = "io.grpc.examples.helloworld.HelloWorldClient", 58 | # deps = [ 59 | # ":helloworld_java", 60 | # "//third_party/java/grpc-java", 61 | # ] 62 | # ) 63 | 64 | # java_binary( 65 | # name = "greeter_server_java", 66 | # srcs = [ 67 | # "java/io/grpc/examples/helloworld/HelloWorldServer.java" 68 | # ], 69 | # main_class = "io.grpc.examples.helloworld.HelloWorldServer", 70 | # deps = [ 71 | # ":helloworld_java", 72 | # "//third_party/java/grpc-java", 73 | # ] 74 | # ) 75 | -------------------------------------------------------------------------------- /examples/rpc/helloworld/greeter_server.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015, Google Inc. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above 13 | * copyright notice, this list of conditions and the following disclaimer 14 | * in the documentation and/or other materials provided with the 15 | * distribution. 16 | * * Neither the name of Google Inc. nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | #include "examples/rpc/helloworld/helloworld.grpc.pb.h" 41 | 42 | using grpc::Server; 43 | using grpc::ServerBuilder; 44 | using grpc::ServerContext; 45 | using grpc::Status; 46 | using helloworld::HelloRequest; 47 | using helloworld::HelloReply; 48 | using helloworld::Greeter; 49 | 50 | // Logic and data behind the server's behavior. 51 | class GreeterServiceImpl final : public Greeter::Service { 52 | Status SayHello(ServerContext* context, const HelloRequest* request, 53 | HelloReply* reply) override { 54 | std::string prefix("Hello "); 55 | reply->set_message(prefix + request->name()); 56 | return Status::OK; 57 | } 58 | }; 59 | 60 | void RunServer() { 61 | std::string server_address("0.0.0.0:50051"); 62 | GreeterServiceImpl service; 63 | 64 | ServerBuilder builder; 65 | // Listen on the given address without any authentication mechanism. 66 | builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); 67 | // Register "service" as the instance through which we'll communicate with 68 | // clients. In this case it corresponds to an *synchronous* service. 69 | builder.RegisterService(&service); 70 | // Finally assemble the server. 71 | std::unique_ptr server(builder.BuildAndStart()); 72 | std::cout << "Server listening on " << server_address << std::endl; 73 | 74 | // Wait for the server to shutdown. Note that some other thread must be 75 | // responsible for shutting down the server for this call to ever return. 76 | server->Wait(); 77 | } 78 | 79 | int main(int argc, char** argv) { 80 | RunServer(); 81 | 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /examples/rpc/helloworld/helloworld.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | syntax = "proto3"; 31 | 32 | option java_package = "io.grpc.examples.helloworld"; 33 | option java_multiple_files = true; 34 | option objc_class_prefix = "HLW"; 35 | 36 | package helloworld; 37 | 38 | // The greeting service definition. 39 | service Greeter { 40 | // Sends a greeting 41 | rpc SayHello (HelloRequest) returns (HelloReply) {} 42 | } 43 | 44 | // The request message containing the user's name. 45 | message HelloRequest { 46 | string name = 1; 47 | } 48 | 49 | // The response message containing the greetings 50 | message HelloReply { 51 | string message = 1; 52 | } 53 | -------------------------------------------------------------------------------- /examples/run_under/BUILD: -------------------------------------------------------------------------------- 1 | py_binary( 2 | name = 'env', 3 | srcs = [ 4 | 'env.py' 5 | ] 6 | ) 7 | 8 | load('//tools/build_rules:run_under.bzl', 'run_under_test') 9 | 10 | run_under_test( 11 | name = 'hello_test', 12 | under = ':env', 13 | command = '//examples:hello', 14 | data = [ 15 | ':env' 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /examples/run_under/env.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import subprocess 3 | import sys 4 | 5 | def main(): 6 | if len(sys.argv) == 1: 7 | return 8 | command = sys.argv[1:] 9 | print("Running " + " " .join(command)) 10 | subprocess.check_call(command) 11 | 12 | if __name__ == '__main__': 13 | main() 14 | -------------------------------------------------------------------------------- /install-bazel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | SCRIPT_DIR_NAME=$(cd "$(dirname "$0")" || exit 1; pwd -P) 4 | RELEASE="$(cat ${SCRIPT_DIR_NAME}/.bazelversion)" 5 | echo "Installing bazel ${RELEASE}" 6 | wget https://github.com/bazelbuild/bazel/releases/download/${RELEASE}/bazel-${RELEASE}-installer-linux-x86_64.sh 7 | wget https://github.com/bazelbuild/bazel/releases/download/${RELEASE}/bazel-${RELEASE}-installer-linux-x86_64.sh.sha256 8 | sha256sum -c bazel-${RELEASE}-installer-linux-x86_64.sh.sha256 9 | chmod +x bazel-${RELEASE}-installer-linux-x86_64.sh 10 | ./bazel-${RELEASE}-installer-linux-x86_64.sh --user 11 | -------------------------------------------------------------------------------- /third_party/boringssl/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | config_setting( 4 | name = "linux_x32", 5 | values = {"cpu": "piii"}, 6 | ) 7 | 8 | config_setting( 9 | name = "linux_x64", 10 | values = {"cpu": "k8"}, 11 | ) 12 | 13 | config_setting( 14 | name = "linux_arm", 15 | values = {"cpu": "arm"}, 16 | ) 17 | 18 | config_setting( 19 | name = "linux_aarch64", 20 | values = {"cpu": "aarch64"}, 21 | ) 22 | 23 | boringssl_copts = [ 24 | ] 25 | 26 | load('BUILD.generated', 'ssl_headers', 'ssl_internal_headers', 'ssl_sources', 27 | 'crypto_headers', 'crypto_internal_headers', 'crypto_sources', 28 | 'tool_sources', 'crypto_sources_linux_aarch64', 'crypto_sources_linux_arm', 29 | 'crypto_sources_linux_x86', 'crypto_sources_linux_x86_64') 30 | 31 | cc_library( 32 | name = 'crypto', 33 | visibility = ["//visibility:public"], 34 | hdrs = crypto_headers, 35 | srcs = crypto_internal_headers + crypto_sources + select({ 36 | ":linux_x32": crypto_sources_linux_x86, 37 | ":linux_x64": crypto_sources_linux_x86_64, 38 | ":linux_arm": crypto_sources_linux_arm, 39 | ":linux_aarch64": crypto_sources_linux_aarch64, 40 | "//conditions:default": crypto_sources_linux_x86_64, 41 | }), 42 | defines = [ 43 | 'BORINGSSL_IMPLEMENTATION', 44 | 'BORINGSSL_NO_STATIC_INITIALIZER', 45 | ], 46 | includes = [ 47 | 'src/include' 48 | ], 49 | copts = boringssl_copts, 50 | linkopts = [ 51 | '-pthread' 52 | ] 53 | ) 54 | 55 | cc_library( 56 | name = 'ssl', 57 | visibility = ["//visibility:public"], 58 | hdrs = ssl_headers, 59 | srcs = ssl_internal_headers + ssl_sources, 60 | defines = [ 61 | 'BORINGSSL_IMPLEMENTATION', 62 | 'BORINGSSL_NO_STATIC_INITIALIZER', 63 | ], 64 | includes = [ 65 | 'src/include' 66 | ], 67 | copts = boringssl_copts, 68 | linkopts = [ 69 | '-pthread' 70 | ], 71 | deps = [ 72 | ':crypto', 73 | ] 74 | ) 75 | 76 | cc_binary( 77 | name = 'tool', 78 | srcs = tool_sources + [ 79 | 'src/tool/internal.h', 80 | 'src/tool/transport_common.h', 81 | ], 82 | deps = [ 83 | ':crypto', 84 | ':ssl', 85 | ] 86 | ) 87 | 88 | load('BUILD.generated_tests', 'create_tests') 89 | 90 | create_tests( 91 | copts = [], 92 | ) 93 | -------------------------------------------------------------------------------- /third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx.S -------------------------------------------------------------------------------- /third_party/boringssl/linux-arm/crypto/modes/ghashv8-armx.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/boringssl/linux-arm/crypto/modes/ghashv8-armx.S -------------------------------------------------------------------------------- /third_party/boringssl/linux-x86_64/crypto/bn/rsaz-avx2.S: -------------------------------------------------------------------------------- 1 | #if defined(__x86_64__) 2 | .text 3 | 4 | .globl rsaz_avx2_eligible 5 | .hidden rsaz_avx2_eligible 6 | .type rsaz_avx2_eligible,@function 7 | rsaz_avx2_eligible: 8 | xorl %eax,%eax 9 | .byte 0xf3,0xc3 10 | .size rsaz_avx2_eligible,.-rsaz_avx2_eligible 11 | 12 | .globl rsaz_1024_sqr_avx2 13 | .hidden rsaz_1024_sqr_avx2 14 | .globl rsaz_1024_mul_avx2 15 | .hidden rsaz_1024_mul_avx2 16 | .globl rsaz_1024_norm2red_avx2 17 | .hidden rsaz_1024_norm2red_avx2 18 | .globl rsaz_1024_red2norm_avx2 19 | .hidden rsaz_1024_red2norm_avx2 20 | .globl rsaz_1024_scatter5_avx2 21 | .hidden rsaz_1024_scatter5_avx2 22 | .globl rsaz_1024_gather5_avx2 23 | .hidden rsaz_1024_gather5_avx2 24 | .type rsaz_1024_sqr_avx2,@function 25 | rsaz_1024_sqr_avx2: 26 | rsaz_1024_mul_avx2: 27 | rsaz_1024_norm2red_avx2: 28 | rsaz_1024_red2norm_avx2: 29 | rsaz_1024_scatter5_avx2: 30 | rsaz_1024_gather5_avx2: 31 | .byte 0x0f,0x0b 32 | .byte 0xf3,0xc3 33 | .size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2 34 | #endif 35 | -------------------------------------------------------------------------------- /third_party/boringssl/linux-x86_64/crypto/cpu-x86_64-asm.S: -------------------------------------------------------------------------------- 1 | #if defined(__x86_64__) 2 | .text 3 | 4 | .globl OPENSSL_ia32_cpuid 5 | .hidden OPENSSL_ia32_cpuid 6 | .type OPENSSL_ia32_cpuid,@function 7 | .align 16 8 | OPENSSL_ia32_cpuid: 9 | 10 | 11 | movq %rdi,%rdi 12 | movq %rbx,%r8 13 | 14 | xorl %eax,%eax 15 | movl %eax,8(%rdi) 16 | cpuid 17 | movl %eax,%r11d 18 | 19 | xorl %eax,%eax 20 | cmpl $1970169159,%ebx 21 | setne %al 22 | movl %eax,%r9d 23 | cmpl $1231384169,%edx 24 | setne %al 25 | orl %eax,%r9d 26 | cmpl $1818588270,%ecx 27 | setne %al 28 | orl %eax,%r9d 29 | jz .Lintel 30 | 31 | cmpl $1752462657,%ebx 32 | setne %al 33 | movl %eax,%r10d 34 | cmpl $1769238117,%edx 35 | setne %al 36 | orl %eax,%r10d 37 | cmpl $1145913699,%ecx 38 | setne %al 39 | orl %eax,%r10d 40 | jnz .Lintel 41 | 42 | 43 | 44 | 45 | movl $2147483648,%eax 46 | cpuid 47 | 48 | 49 | cmpl $2147483649,%eax 50 | jb .Lintel 51 | movl %eax,%r10d 52 | movl $2147483649,%eax 53 | cpuid 54 | 55 | 56 | orl %ecx,%r9d 57 | andl $2049,%r9d 58 | 59 | cmpl $2147483656,%r10d 60 | jb .Lintel 61 | 62 | movl $2147483656,%eax 63 | cpuid 64 | 65 | movzbq %cl,%r10 66 | incq %r10 67 | 68 | movl $1,%eax 69 | cpuid 70 | 71 | btl $28,%edx 72 | jnc .Lgeneric 73 | shrl $16,%ebx 74 | cmpb %r10b,%bl 75 | ja .Lgeneric 76 | andl $4026531839,%edx 77 | jmp .Lgeneric 78 | 79 | .Lintel: 80 | cmpl $4,%r11d 81 | movl $-1,%r10d 82 | jb .Lnocacheinfo 83 | 84 | movl $4,%eax 85 | movl $0,%ecx 86 | cpuid 87 | movl %eax,%r10d 88 | shrl $14,%r10d 89 | andl $4095,%r10d 90 | 91 | cmpl $7,%r11d 92 | jb .Lnocacheinfo 93 | 94 | movl $7,%eax 95 | xorl %ecx,%ecx 96 | cpuid 97 | movl %ebx,8(%rdi) 98 | 99 | .Lnocacheinfo: 100 | movl $1,%eax 101 | cpuid 102 | 103 | andl $3220176895,%edx 104 | cmpl $0,%r9d 105 | jne .Lnotintel 106 | orl $1073741824,%edx 107 | .Lnotintel: 108 | btl $28,%edx 109 | jnc .Lgeneric 110 | andl $4026531839,%edx 111 | cmpl $0,%r10d 112 | je .Lgeneric 113 | 114 | orl $268435456,%edx 115 | shrl $16,%ebx 116 | cmpb $1,%bl 117 | ja .Lgeneric 118 | andl $4026531839,%edx 119 | .Lgeneric: 120 | andl $2048,%r9d 121 | andl $4294965247,%ecx 122 | orl %ecx,%r9d 123 | 124 | movl %edx,%r10d 125 | btl $27,%r9d 126 | jnc .Lclear_avx 127 | xorl %ecx,%ecx 128 | .byte 0x0f,0x01,0xd0 129 | andl $6,%eax 130 | cmpl $6,%eax 131 | je .Ldone 132 | .Lclear_avx: 133 | movl $4026525695,%eax 134 | andl %eax,%r9d 135 | andl $4294967263,8(%rdi) 136 | .Ldone: 137 | movl %r9d,4(%rdi) 138 | movl %r10d,0(%rdi) 139 | movq %r8,%rbx 140 | .byte 0xf3,0xc3 141 | .size OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid 142 | 143 | #endif 144 | -------------------------------------------------------------------------------- /third_party/boringssl/linux-x86_64/crypto/modes/aesni-gcm-x86_64.S: -------------------------------------------------------------------------------- 1 | #if defined(__x86_64__) 2 | .text 3 | 4 | .globl aesni_gcm_encrypt 5 | .hidden aesni_gcm_encrypt 6 | .type aesni_gcm_encrypt,@function 7 | aesni_gcm_encrypt: 8 | xorl %eax,%eax 9 | .byte 0xf3,0xc3 10 | .size aesni_gcm_encrypt,.-aesni_gcm_encrypt 11 | 12 | .globl aesni_gcm_decrypt 13 | .hidden aesni_gcm_decrypt 14 | .type aesni_gcm_decrypt,@function 15 | aesni_gcm_decrypt: 16 | xorl %eax,%eax 17 | .byte 0xf3,0xc3 18 | .size aesni_gcm_decrypt,.-aesni_gcm_decrypt 19 | #endif 20 | -------------------------------------------------------------------------------- /third_party/boringssl/linux-x86_64/crypto/rand/rdrand-x86_64.S: -------------------------------------------------------------------------------- 1 | #if defined(__x86_64__) 2 | .text 3 | 4 | 5 | 6 | 7 | .globl CRYPTO_rdrand 8 | .hidden CRYPTO_rdrand 9 | .type CRYPTO_rdrand,@function 10 | .align 16 11 | CRYPTO_rdrand: 12 | xorq %rax,%rax 13 | 14 | 15 | .byte 0x48, 0x0f, 0xc7, 0xf1 16 | 17 | adcq %rax,%rax 18 | movq %rcx,0(%rdi) 19 | .byte 0xf3,0xc3 20 | 21 | 22 | 23 | 24 | 25 | .globl CRYPTO_rdrand_multiple8_buf 26 | .hidden CRYPTO_rdrand_multiple8_buf 27 | .type CRYPTO_rdrand_multiple8_buf,@function 28 | .align 16 29 | CRYPTO_rdrand_multiple8_buf: 30 | testq %rsi,%rsi 31 | jz .Lout 32 | movq $8,%rdx 33 | .Lloop: 34 | 35 | 36 | .byte 0x48, 0x0f, 0xc7, 0xf1 37 | jnc .Lerr 38 | movq %rcx,0(%rdi) 39 | addq %rdx,%rdi 40 | subq %rdx,%rsi 41 | jnz .Lloop 42 | .Lout: 43 | movq $1,%rax 44 | .byte 0xf3,0xc3 45 | .Lerr: 46 | xorq %rax,%rax 47 | .byte 0xf3,0xc3 48 | #endif 49 | -------------------------------------------------------------------------------- /third_party/cares/cares.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "ares", 3 | srcs = [ 4 | "cares/ares__close_sockets.c", 5 | "cares/ares__get_hostent.c", 6 | "cares/ares__read_line.c", 7 | "cares/ares__timeval.c", 8 | "cares/ares_cancel.c", 9 | "cares/ares_create_query.c", 10 | "cares/ares_data.c", 11 | "cares/ares_destroy.c", 12 | "cares/ares_expand_name.c", 13 | "cares/ares_expand_string.c", 14 | "cares/ares_fds.c", 15 | "cares/ares_free_hostent.c", 16 | "cares/ares_free_string.c", 17 | "cares/ares_getenv.c", 18 | "cares/ares_gethostbyaddr.c", 19 | "cares/ares_gethostbyname.c", 20 | "cares/ares_getnameinfo.c", 21 | "cares/ares_getopt.c", 22 | "cares/ares_getsock.c", 23 | "cares/ares_init.c", 24 | "cares/ares_library_init.c", 25 | "cares/ares_llist.c", 26 | "cares/ares_mkquery.c", 27 | "cares/ares_nowarn.c", 28 | "cares/ares_options.c", 29 | "cares/ares_parse_a_reply.c", 30 | "cares/ares_parse_aaaa_reply.c", 31 | "cares/ares_parse_mx_reply.c", 32 | "cares/ares_parse_naptr_reply.c", 33 | "cares/ares_parse_ns_reply.c", 34 | "cares/ares_parse_ptr_reply.c", 35 | "cares/ares_parse_soa_reply.c", 36 | "cares/ares_parse_srv_reply.c", 37 | "cares/ares_parse_txt_reply.c", 38 | "cares/ares_platform.c", 39 | "cares/ares_process.c", 40 | "cares/ares_query.c", 41 | "cares/ares_search.c", 42 | "cares/ares_send.c", 43 | "cares/ares_strcasecmp.c", 44 | "cares/ares_strdup.c", 45 | "cares/ares_strerror.c", 46 | "cares/ares_timeout.c", 47 | "cares/ares_version.c", 48 | "cares/ares_writev.c", 49 | "cares/bitncmp.c", 50 | "cares/inet_net_pton.c", 51 | "cares/inet_ntop.c", 52 | "cares/windows_port.c", 53 | ], 54 | hdrs = [ 55 | "ares_build.h", 56 | "config_linux/ares_config.h", 57 | "cares/ares.h", 58 | "cares/ares_data.h", 59 | "cares/ares_dns.h", 60 | "cares/ares_getenv.h", 61 | "cares/ares_getopt.h", 62 | "cares/ares_inet_net_pton.h", 63 | "cares/ares_iphlpapi.h", 64 | "cares/ares_ipv6.h", 65 | "cares/ares_library_init.h", 66 | "cares/ares_llist.h", 67 | "cares/ares_nowarn.h", 68 | "cares/ares_platform.h", 69 | "cares/ares_private.h", 70 | "cares/ares_rules.h", 71 | "cares/ares_setup.h", 72 | "cares/ares_strcasecmp.h", 73 | "cares/ares_strdup.h", 74 | "cares/ares_version.h", 75 | "cares/bitncmp.h", 76 | "cares/config-win32.h", 77 | "cares/setup_once.h", 78 | ], 79 | includes = [ 80 | ".", 81 | "config_linux", 82 | "cares", 83 | ], 84 | linkstatic = 1, 85 | visibility = [ 86 | "//visibility:public", 87 | ], 88 | copts = [ 89 | "-D_GNU_SOURCE", 90 | "-D_HAS_EXCEPTIONS=0", 91 | "-DNOMINMAX", 92 | "-DHAVE_CONFIG_H", 93 | ], 94 | ) 95 | -------------------------------------------------------------------------------- /third_party/chromium_browser_clang/BUILD: -------------------------------------------------------------------------------- 1 | # define a clang based toolchain, to use: 2 | # bazel build --crosstool_top=//third_party/chromium_browser_clang:toolchain build foo:bar 3 | 4 | licenses(["notice"]) 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | filegroup( 8 | name = "toolchain", 9 | srcs = [ 10 | ":cc-compiler-k8", 11 | ":empty", 12 | ":clang-linux-x64-3.7-toolchain", 13 | ], 14 | ) 15 | 16 | filegroup( 17 | name = "clang-linux-x64-3.7-toolchain", 18 | srcs = glob([ 19 | "Linux_x64/bin/*", 20 | "Linux_x64/lib/**/*.h", 21 | "Linux_x64/lib/**/*.so.*", 22 | ]), 23 | output_licenses = ["unencumbered"], 24 | ) 25 | 26 | filegroup( 27 | name = "empty", 28 | srcs = [], 29 | ) 30 | 31 | # "xyz" in "cc-compiler-xyz" needs to match the target_cpu in CROSSTOOL 32 | cc_toolchain( 33 | name = "cc-compiler-k8", 34 | all_files = ":clang-linux-x64-3.7-toolchain", 35 | compiler_files = ":clang-linux-x64-3.7-toolchain", 36 | cpu = "k8", 37 | dwp_files = ":clang-linux-x64-3.7-toolchain", 38 | dynamic_runtime_libs = [":clang-linux-x64-3.7-toolchain"], 39 | linker_files = ":clang-linux-x64-3.7-toolchain", 40 | objcopy_files = ":clang-linux-x64-3.7-toolchain", 41 | static_runtime_libs = [":clang-linux-x64-3.7-toolchain"], 42 | strip_files = ":clang-linux-x64-3.7-toolchain", 43 | supports_param_files = 0, 44 | ) 45 | -------------------------------------------------------------------------------- /third_party/chromium_browser_clang/CROSSTOOL: -------------------------------------------------------------------------------- 1 | major_version: "local" 2 | minor_version: "" 3 | default_target_cpu: "same_as_host" 4 | default_toolchain { 5 | cpu: "k8" 6 | toolchain_identifier: "clang_k8" 7 | } 8 | 9 | toolchain { 10 | abi_version: "local" 11 | abi_libc_version: "local" 12 | builtin_sysroot: "" 13 | compiler: "clang" 14 | host_system_name: "local" 15 | needsPic: true 16 | supports_gold_linker: false 17 | supports_incremental_linker: false 18 | supports_fission: false 19 | supports_interface_shared_objects: false 20 | supports_normalizing_ar: false 21 | supports_start_end_lib: false 22 | supports_thin_archives: false 23 | target_libc: "local" 24 | target_cpu: "k8" 25 | target_system_name: "local" 26 | toolchain_identifier: "clang_k8" 27 | 28 | tool_path { name: "ar" path: "/usr/bin/ar" } 29 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } 30 | tool_path { name: "cpp" path: "/usr/bin/cpp" } 31 | tool_path { name: "dwp" path: "/usr/bin/dwp" } 32 | tool_path { name: "gcc" path: "Linux_x64/bin/clang" } 33 | cxx_flag: "-std=c++0x" 34 | compilation_mode_flags { 35 | mode: FASTBUILD 36 | } 37 | compilation_mode_flags { 38 | mode: DBG 39 | cxx_flag: "-g3" 40 | } 41 | compilation_mode_flags { 42 | mode: COVERAGE 43 | } 44 | compilation_mode_flags { 45 | mode: OPT 46 | compiler_flag: "-DNDEBUG" 47 | compiler_flag: "-fno-omit-frame-pointer" 48 | compiler_flag: "-O2" 49 | } 50 | linker_flag: "-lstdc++" 51 | linker_flag: "-B/usr/bin/" 52 | 53 | # TODO(bazel-team): In theory, the path here ought to exactly match the path 54 | # used by gcc. That works because bazel currently doesn't track files at 55 | # absolute locations and has no remote execution, yet. However, this will need 56 | # to be fixed, maybe with auto-detection? 57 | cxx_builtin_include_directory: "/usr/lib/gcc/" 58 | cxx_builtin_include_directory: "/usr/local/include" 59 | cxx_builtin_include_directory: "/usr/include" 60 | cxx_builtin_include_directory: "Linux_x64/lib/clang/3.7.0/include" 61 | 62 | tool_path { name: "gcov" path: "/usr/bin/gcov" } 63 | tool_path { name: "ld" path: "/usr/bin/ld" } 64 | tool_path { name: "nm" path: "/usr/bin/nm" } 65 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } 66 | objcopy_embed_flag: "-I" 67 | objcopy_embed_flag: "binary" 68 | tool_path { name: "objdump" path: "/usr/bin/objdump" } 69 | tool_path { name: "strip" path: "/usr/bin/strip" } 70 | } 71 | -------------------------------------------------------------------------------- /third_party/chromium_browser_clang/get_latest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 -u 2 | 3 | '''Download the prebuilt clang binary built by chromium and is used by chromium.''' 4 | 5 | import os 6 | import os.path 7 | import subprocess 8 | 9 | UPDATE_SH_URL = 'https://chromium.googlesource.com/chromium/src/+/master/tools/clang/scripts/update.sh' 10 | CLANG_REVISION = 238013 11 | CLANG_SUB_REVISION = 1 12 | CDS_URL = 'https://commondatastorage.googleapis.com/chromium-browser-clang' 13 | 14 | def get_revision(): 15 | '''Get the revision based encoded in chrome.sh''' 16 | # TODO: we need to get the raw output or try to parse the HTML output 17 | update_sh = subprocess.check_output(['curl', UPDATE_SH_URL], 18 | stderr=subprocess.DEVNULL, 19 | universal_newlines=True) 20 | revision = None 21 | sub_revision = None 22 | for line in update_sh.split('\n'): 23 | print('==' + line) 24 | if line.find('CLANG_REVISION') == 0: 25 | revision = line.split('=') 26 | elif line.find('CLANG_SUB_REVISION') == 0: 27 | sub_revision = line.split('=') 28 | break 29 | return revision, sub_revision 30 | 31 | 32 | def main(): 33 | url = CDS_URL + '/Linux_x64/clang-%d-%d.tgz' % (CLANG_REVISION, CLANG_SUB_REVISION) 34 | output_dir = os.path.join(os.path.dirname(__file__), 'Linux_x64') 35 | if not os.path.exists(output_dir): 36 | os.makedirs(output_dir) 37 | print('Downloading %s to %s' % (url, output_dir)) 38 | subprocess.check_call(['curl %s |tar zx -C %s' % (url, output_dir)], 39 | shell=True) 40 | 41 | 42 | if __name__ == '__main__': 43 | main() 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /third_party/clang_toolchain/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/clang_toolchain/BUILD -------------------------------------------------------------------------------- /third_party/clang_toolchain/cc_configure_clang.bzl: -------------------------------------------------------------------------------- 1 | """ Downloads clang and configures the crosstool using bazel's autoconf.""" 2 | 3 | load("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_autoconf_impl") 4 | load(":download_clang.bzl", "download_clang") 5 | 6 | _TF_DOWNLOAD_CLANG = "TF_DOWNLOAD_CLANG" 7 | _TF_NEED_CUDA = "TF_NEED_CUDA" 8 | 9 | def _cc_clang_autoconf(repo_ctx): 10 | if repo_ctx.os.environ.get(_TF_DOWNLOAD_CLANG) != "1": 11 | return 12 | if repo_ctx.os.environ.get(_TF_NEED_CUDA) == "1": 13 | # Clang is handled separately for CUDA configs. 14 | # See cuda_configure.bzl for more details. 15 | return 16 | 17 | download_clang(repo_ctx, out_folder = "extra_tools") 18 | overridden_tools = {"gcc": "extra_tools/bin/clang"} 19 | cc_autoconf_impl(repo_ctx, overridden_tools) 20 | 21 | cc_download_clang_toolchain = repository_rule( 22 | environ = [ 23 | _TF_DOWNLOAD_CLANG, 24 | _TF_NEED_CUDA, 25 | ], 26 | implementation = _cc_clang_autoconf, 27 | ) 28 | -------------------------------------------------------------------------------- /third_party/clang_toolchain/download_clang.bzl: -------------------------------------------------------------------------------- 1 | """ Helpers to download a recent clang release.""" 2 | 3 | def _get_platform_folder(os_name): 4 | os_name = os_name.lower() 5 | if os_name.startswith("windows"): 6 | return "Win" 7 | if os_name.startswith("mac os"): 8 | return "Mac" 9 | if not os_name.startswith("linux"): 10 | fail("Unknown platform") 11 | return "Linux_x64" 12 | 13 | def _download_chromium_clang( 14 | repo_ctx, 15 | platform_folder, 16 | package_version, 17 | sha256, 18 | out_folder): 19 | cds_url = "https://commondatastorage.googleapis.com/chromium-browser-clang" 20 | cds_file = "clang-%s.tgz" % package_version 21 | cds_full_url = "{0}/{1}/{2}".format(cds_url, platform_folder, cds_file) 22 | repo_ctx.download_and_extract(cds_full_url, output = out_folder, sha256 = sha256) 23 | 24 | def download_clang(repo_ctx, out_folder): 25 | """ Download a fresh clang release and put it into out_folder. 26 | 27 | Clang itself will be located in 'out_folder/bin/clang'. 28 | We currently download one of the latest releases of clang by the 29 | Chromium project (see 30 | https://chromium.googlesource.com/chromium/src/+/master/docs/clang.md). 31 | 32 | Args: 33 | repo_ctx: An instance of repository_context object. 34 | out_folder: A folder to extract the compiler into. 35 | """ 36 | # TODO(ibiryukov): we currently download and extract some extra tools in the 37 | # clang release (e.g., sanitizers). We should probably remove the ones 38 | # we don't need and document the ones we want provide in addition to clang. 39 | 40 | # Latest CLANG_REVISION and CLANG_SUB_REVISION of the Chromiums's release 41 | # can be found in https://chromium.googlesource.com/chromium/src/tools/clang/+/master/scripts/update.py 42 | CLANG_REVISION = "b4160cb94c54f0b31d0ce14694950dac7b6cd83f" 43 | CLANG_SVN_REVISION = "371856" 44 | CLANG_SUB_REVISION = 1 45 | package_version = "%s-%s-%s" % ( 46 | CLANG_SVN_REVISION, 47 | CLANG_REVISION[:8], 48 | CLANG_SUB_REVISION, 49 | ) 50 | 51 | checksums = { 52 | "Linux_x64": "919c19df3ebd7db03b72575b2de5198404357659fc8c85c2d66e679ad4acbafe", 53 | "Mac": "5632c516f3ac5fab3654d0a874688cad6c7f99b96845da27ab12336a14187aa2", 54 | "Win": "235545b33f4d697190032cb538fdcaba227017c95b752ea8af8f29aab8da7479", 55 | } 56 | 57 | platform_folder = _get_platform_folder(repo_ctx.os.name) 58 | _download_chromium_clang( 59 | repo_ctx, 60 | platform_folder, 61 | package_version, 62 | checksums[platform_folder], 63 | out_folder, 64 | ) 65 | -------------------------------------------------------------------------------- /third_party/gflags/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | visibility = ["//visibility:public"], 5 | name = "gflags", 6 | deps = [ 7 | "//external:gflags", 8 | ], 9 | ) 10 | -------------------------------------------------------------------------------- /third_party/gmock/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | name = "gmock", 5 | testonly = 1, 6 | visibility = ["//visibility:public"], 7 | deps = [ 8 | "//third_party/gtest:gmock", 9 | ] 10 | ) 11 | 12 | cc_library( 13 | name = "gmock_main", 14 | visibility = ["//visibility:public"], 15 | deps = [ 16 | "//third_party/gtest:gmock_main", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /third_party/gperftools/runtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | MAIN_SCRIPT=$1 3 | export BINDIR=third_party/gperftools 4 | export PPROF_PATH=third_party/gperftools/upstream/src/pprof 5 | # For sampling test. 6 | export TCMALLOC_SAMPLE_PARAMETER=524288 7 | third_party/gperftools/upstream/src/tests/${MAIN_SCRIPT} 8 | -------------------------------------------------------------------------------- /third_party/http-parser/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | name = "http-parser", 5 | srcs = [ 6 | "upstream/http_parser.c", 7 | ], 8 | hdrs = [ 9 | "upstream/http_parser.h", 10 | ], 11 | visibility = ["//visibility:public"], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/icu/icupkg.inc.x86_64: -------------------------------------------------------------------------------- 1 | # TODO (zhongming): Use a bazel genrule to generate this file. 2 | # Here is how to generate this file: 3 | # (From the icu source tree): 4 | # $ cd build 5 | # $ sh my-config.sh 6 | # $ cd data 7 | # $ make -f pkgdataMakefile 8 | # The `make` command generates the icupkg.inc file. 9 | # The above procedure was tested on Ubuntu 16.04 with x86_64. 10 | 11 | GENCCODE_ASSEMBLY_TYPE=-a gcc 12 | SO=so 13 | SOBJ=so 14 | A=a 15 | LIBPREFIX=lib 16 | LIB_EXT_ORDER=.58.2 17 | COMPILE=clang -ffunction-sections -fdata-sections -D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_ATOMIC=1 -DU_HAVE_STRTOD_L=1 -DU_ATTRIBUTE_DEPRECATED= -O3 -DU_USING_ICU_NAMESPACE=0 -DU_CHARSET_IS_UTF8=1 -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -std=c99 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -c 18 | LIBFLAGS=-I../../common -I../common -DPIC -fPIC 19 | GENLIB=clang -O3 -DU_USING_ICU_NAMESPACE=0 -DU_CHARSET_IS_UTF8=1 -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -std=c99 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -Wl,--gc-sections -shared -Wl,-Bsymbolic 20 | LDICUDTFLAGS=-nodefaultlibs -nostdlib 21 | LD_SONAME=-Wl,-soname -Wl, 22 | RPATH_FLAGS= 23 | BIR_LDFLAGS=-Wl,-Bsymbolic 24 | AR=ar 25 | ARFLAGS=r 26 | RANLIB=ranlib 27 | INSTALL_CMD=/usr/bin/install -c 28 | -------------------------------------------------------------------------------- /third_party/icu/my-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is useful as a concise reference that serves as a good basis for 4 | # writing the BUILD files. 5 | 6 | CFLAGS="-DU_USING_ICU_NAMESPACE=0 \ 7 | -DU_CHARSET_IS_UTF8=1 \ 8 | -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" 9 | 10 | # These two macros break the test shipped with icu source code. 11 | #-DUNISTR_FROM_CHAR_EXPLICIT=explicit \ 12 | #-DUNISTR_FROM_STRING_EXPLICIT=explicit \ 13 | 14 | export CFLAGS 15 | 16 | ../runConfigureICU Linux/clang \ 17 | --with-library-bits=64 18 | #--enable-static \ 19 | #--disable-shared 20 | #--with-data-packaging=static 21 | -------------------------------------------------------------------------------- /third_party/icu/test/BUILD: -------------------------------------------------------------------------------- 1 | licenses(['notice']) 2 | package(default_visibility = ['//visibility:public']) 3 | 4 | icu_copts = [ 5 | '-Ithird_party/icu/github/source/common', 6 | '-Ithird_party/icu/github/source/i18n', 7 | '-Ithird_party/icu/github/source/io', 8 | '-Ithird_party/icu/github/source/tools/ctestfw', 9 | '-Ithird_party/icu/github/source/tools/toolutil', 10 | ] 11 | 12 | icu_linkopts = [ 13 | '-ldl', 14 | ] 15 | 16 | cc_test( 17 | name = 'test_icu', 18 | srcs = [ 19 | 'test_icu.cpp', 20 | ], 21 | deps = [ 22 | '//third_party/icu:icu', 23 | ], 24 | linkstatic = 1, 25 | copts = icu_copts, 26 | linkopts = icu_linkopts, 27 | ) 28 | 29 | cc_test( 30 | name = 'test_UnicodeString', 31 | srcs = [ 32 | 'gtest_UnicodeString.cpp', 33 | ], 34 | deps = [ 35 | '//third_party/gflags:gflags', 36 | '//third_party/gtest:gtest_main', 37 | '//third_party/icu:icu', 38 | ], 39 | linkstatic = 1, 40 | copts = icu_copts, 41 | linkopts = icu_linkopts, 42 | ) 43 | -------------------------------------------------------------------------------- /third_party/icu/test/README: -------------------------------------------------------------------------------- 1 | Use ICU UnicodeString to convert between different encodings of Unicode strings. 2 | Mainly, converts UTF8 strings to UTF32 strings and iterate over the resulted 3 | UTF32 code points. 4 | -------------------------------------------------------------------------------- /third_party/icu/test/gtest_UnicodeString.cpp: -------------------------------------------------------------------------------- 1 | #include "unicode/ucnv.h" 2 | #include 3 | #include 4 | 5 | TEST(UnicodeString, Utf8ToUtf16) 6 | { 7 | // Uncomment fprintf to see the actual values 8 | const char *utf8cstring = u8"🛁\tμπάνιο\tμπανιέρα"; 9 | const char16_t *utf16cstring = u"🛁\tμπάνιο\tμπανιέρα"; 10 | const icu::UnicodeString str = icu::UnicodeString::fromUTF8(utf8cstring); 11 | const int32_t length = str.length(); 12 | for (int32_t i = 0; i < length; i++) { 13 | fprintf(stderr, "%04X ", str[i]); 14 | ASSERT_EQ(utf16cstring[i], static_cast(str[i])); 15 | } 16 | fprintf(stderr, "\n"); 17 | } 18 | 19 | TEST(UnicodeString, Utf8ToUtf32) 20 | { 21 | const char *utf8cstring = u8"🛁\tμπάνιο\tμπανιέρα"; 22 | const char32_t *utf32cstring = U"🛁\tμπάνιο\tμπανιέρα"; 23 | 24 | // Convert UTF8 to UTF16 25 | const icu::UnicodeString str = icu::UnicodeString::fromUTF8(utf8cstring); 26 | 27 | // Convert UTF16 to UTF32 28 | UErrorCode err = U_ZERO_ERROR; 29 | const int32_t char32length = str.countChar32(); 30 | UChar32 *buf = new UChar32[char32length]; 31 | str.toUTF32(buf, 200, err); 32 | ASSERT_TRUE(U_SUCCESS(err)); 33 | 34 | for (int32_t i = 0; i < char32length; i++) { 35 | fprintf(stderr, "U+%06X ", static_cast(buf[i])); 36 | ASSERT_EQ(utf32cstring[i], buf[i]); 37 | } 38 | fprintf(stderr, "\n"); 39 | 40 | delete []buf; 41 | } 42 | -------------------------------------------------------------------------------- /third_party/icu/test/test_icu.cpp: -------------------------------------------------------------------------------- 1 | #include "unicode/utypes.h" 2 | #include "unicode/uchar.h" 3 | #include "unicode/locid.h" 4 | #include "unicode/ustring.h" 5 | #include "unicode/ucnv.h" 6 | #include "unicode/unistr.h" 7 | 8 | #include 9 | 10 | using icu::UnicodeString; 11 | 12 | namespace { 13 | 14 | void print_cstring_utf8(const char *str, FILE *fp = stdout) 15 | { 16 | const char *curr = str; 17 | while(1) { 18 | const char ch = *curr; 19 | if (!ch) 20 | break; 21 | fprintf(fp,"U+%02X ", static_cast(ch)); 22 | curr++; 23 | } 24 | fprintf(fp,"\n"); 25 | } 26 | 27 | void print_cstring_utf16(const char16_t *str, FILE *fp = stdout) 28 | { 29 | const char16_t *curr = str; 30 | while(1) { 31 | const char16_t ch = *curr; 32 | if (!ch) 33 | break; 34 | fprintf(fp,"U+%04X ", static_cast(ch)); 35 | curr++; 36 | } 37 | fprintf(fp,"\n"); 38 | } 39 | 40 | } // namespace 41 | 42 | void print_cstring_utf32(const char32_t *str, FILE *fp = stdout) 43 | { 44 | const char32_t *curr = str; 45 | while(1) { 46 | const char32_t ch = *curr; 47 | if (!ch) 48 | break; 49 | fprintf(fp,"U+%06X ", static_cast(ch)); 50 | curr++; 51 | } 52 | fprintf(fp,"\n"); 53 | } 54 | int main(int argc, char const* argv[]) 55 | { 56 | const char *utf8cstring = u8"🛁\tμπάνιο\tμπανιέρα"; 57 | const char16_t *utf16cstring = u"🛁\tμπάνιο\tμπανιέρα"; 58 | const char32_t *utf32cstring = U"🛁\tμπάνιο\tμπανιέρα"; 59 | 60 | printf("\nUTF8:\n"); 61 | print_cstring_utf8( utf8cstring); 62 | printf("\nUTF16:\n"); 63 | print_cstring_utf16(utf16cstring); 64 | printf("\nUTF32:\n"); 65 | print_cstring_utf32(utf32cstring); 66 | 67 | { 68 | printf("\n"); 69 | printf("Testing icu::UnicodeString::fromUTF8:\n"); 70 | const UnicodeString str = UnicodeString::fromUTF8(utf8cstring); 71 | const int32_t length = str.length(); 72 | for (int32_t i = 0; i < length; i++) { 73 | printf("U+%04X ", str[i]); 74 | } 75 | printf("\n"); 76 | } 77 | 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /third_party/ijar/BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = [ 3 | "//src:__subpackages__", 4 | "//third_party/ijar:__subpackages__", 5 | ], 6 | ) 7 | 8 | licenses(["notice"]) # Apache 2.0 9 | 10 | cc_library( 11 | name = "zip", 12 | srcs = ["zip.cc"], 13 | hdrs = [ 14 | "common.h", 15 | "zip.h", 16 | ], 17 | # TODO(bazel-team): we should replace the -lz flag, it is non-hermetic. 18 | # We should instead use a new_local_repository once the autoconf 19 | # mechanism is ready. 20 | linkopts = ["-lz"], 21 | ) 22 | 23 | cc_binary( 24 | name = "zipper", 25 | srcs = ["zip_main.cc"], 26 | visibility = ["//visibility:public"], 27 | deps = [":zip"], 28 | ) 29 | 30 | cc_binary( 31 | name = "ijar", 32 | srcs = [ 33 | "classfile.cc", 34 | "ijar.cc", 35 | ], 36 | visibility = ["//visibility:public"], 37 | deps = [":zip"], 38 | ) 39 | -------------------------------------------------------------------------------- /third_party/ijar/common.h: -------------------------------------------------------------------------------- 1 | // Copyright 2001,2007 Alan Donovan. All rights reserved. 2 | // 3 | // Author: Alan Donovan 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | // common.h -- common definitions. 18 | // 19 | 20 | #ifndef INCLUDED_DEVTOOLS_IJAR_COMMON_H 21 | #define INCLUDED_DEVTOOLS_IJAR_COMMON_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace devtools_ijar { 28 | 29 | typedef unsigned long long u8; 30 | typedef uint32_t u4; 31 | typedef uint16_t u2; 32 | typedef uint8_t u1; 33 | 34 | // be = big endian, le = little endian 35 | 36 | inline u1 get_u1(const u1 *&p) { 37 | return *p++; 38 | } 39 | 40 | inline u2 get_u2be(const u1 *&p) { 41 | u4 x = (p[0] << 8) | p[1]; 42 | p += 2; 43 | return x; 44 | } 45 | 46 | inline u2 get_u2le(const u1 *&p) { 47 | u4 x = (p[1] << 8) | p[0]; 48 | p += 2; 49 | return x; 50 | } 51 | 52 | inline u4 get_u4be(const u1 *&p) { 53 | u4 x = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; 54 | p += 4; 55 | return x; 56 | } 57 | 58 | inline u4 get_u4le(const u1 *&p) { 59 | u4 x = (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]; 60 | p += 4; 61 | return x; 62 | } 63 | 64 | inline void put_u1(u1 *&p, u1 x) { 65 | *p++ = x; 66 | } 67 | 68 | inline void put_u2be(u1 *&p, u2 x) { 69 | *p++ = x >> 8; 70 | *p++ = x & 0xff; 71 | } 72 | 73 | inline void put_u2le(u1 *&p, u2 x) { 74 | *p++ = x & 0xff; 75 | *p++ = x >> 8;; 76 | } 77 | 78 | inline void put_u4be(u1 *&p, u4 x) { 79 | *p++ = x >> 24; 80 | *p++ = (x >> 16) & 0xff; 81 | *p++ = (x >> 8) & 0xff; 82 | *p++ = x & 0xff; 83 | } 84 | 85 | inline void put_u4le(u1 *&p, u4 x) { 86 | *p++ = x & 0xff; 87 | *p++ = (x >> 8) & 0xff; 88 | *p++ = (x >> 16) & 0xff; 89 | *p++ = x >> 24; 90 | } 91 | 92 | // Copy n bytes from src to p, and advance p. 93 | inline void put_n(u1 *&p, const u1 *src, size_t n) { 94 | memcpy(p, src, n); 95 | p += n; 96 | } 97 | 98 | extern bool verbose; 99 | 100 | } // namespace devtools_ijar 101 | 102 | #endif // INCLUDED_DEVTOOLS_IJAR_COMMON_H 103 | -------------------------------------------------------------------------------- /third_party/ijar/test/A.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | import java.io.IOException; 17 | import java.lang.annotation.*; 18 | 19 | class A { 20 | 21 | // Exercise removal of class initializers: 22 | static { } 23 | 24 | // Exercise removal of private members: 25 | private String privateField; 26 | 27 | protected int protectedField; 28 | 29 | // Exercise ConstantValue annotation 30 | public static final long L1 = 123L; 31 | 32 | // Exercise removal of private members: 33 | private void privateMethod() { 34 | System.err.println("foofoofoofoo"); 35 | } 36 | 37 | // Exercise Signature annotation: 38 | protected T protectedMethod(T t) { return t; } 39 | 40 | // Exercise Deprecated annotation: 41 | @Deprecated 42 | // Exercise Exceptions annotation: 43 | public void deprecatedMethod() throws IOException {} 44 | 45 | // Exercise retention of private inner classes: 46 | private class PrivateInner {} 47 | 48 | // Exercise InnerClasses attribute: 49 | public class PublicInner {} 50 | 51 | public @interface MyAnnotation { 52 | // Exercise BaseTypeElementValue: 53 | String a() default "foo"; 54 | 55 | // Exercise EnumTypeElementValue: 56 | ElementType b() default ElementType.METHOD; 57 | 58 | // Exercise ClassTypeElementValue: 59 | Class c() default String.class; 60 | 61 | // Exercise ArrayTypeElementValue: 62 | String[] d() default { "foo", "bar" }; 63 | 64 | // Exercise AnnotationTypeElementValue: 65 | Deprecated e() default @Deprecated; 66 | } 67 | 68 | @Retention(RetentionPolicy.RUNTIME) 69 | public @interface RuntimeAnnotation {} 70 | 71 | } 72 | -------------------------------------------------------------------------------- /third_party/ijar/test/AnnotatedClass.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * A heavily annotated class used for testing. 17 | */ 18 | @Annotations.RuntimeInvisible 19 | @Annotations.RuntimeVisible 20 | final class AnnotatedClass { 21 | @Annotations.RuntimeInvisible 22 | @Annotations.RuntimeVisible 23 | String field; 24 | 25 | @Annotations.RuntimeInvisible 26 | @Annotations.RuntimeVisible 27 | private AnnotatedClass() {} 28 | 29 | @Annotations.RuntimeInvisible 30 | @Annotations.RuntimeVisible 31 | public static void publicStaticMethod( 32 | @Annotations.RuntimeInvisible @Annotations.RuntimeVisible String param) { 33 | @Annotations.RuntimeInvisible 34 | @Annotations.RuntimeVisible 35 | String local = "Hello " + param + "!"; 36 | System.out.println(local); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /third_party/ijar/test/Annotations.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import java.lang.annotation.ElementType; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | 20 | /** 21 | * Annotations used for testing. 22 | */ 23 | final class Annotations { 24 | private Annotations() {} 25 | 26 | @Target({ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.FIELD, 27 | ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE}) 28 | @interface RuntimeInvisible {} 29 | 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.FIELD, 32 | ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE}) 33 | @interface RuntimeVisible {} 34 | 35 | @Target(ElementType.PARAMETER) 36 | public @interface ParametersOnlyAnnotation { 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /third_party/ijar/test/B.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | import java.io.IOException; 17 | 18 | public class B extends A { 19 | 20 | B() { 21 | // Will trigger compile error if Signature attr is missing. 22 | String str = protectedMethod("foo"); 23 | 24 | try { 25 | deprecatedMethod(); // <-- triggers deprecation warning; checked by 26 | // .sh script. 27 | } catch (IOException e) { // Will trigger compile error if Exceptions 28 | // annotation is discarded. 29 | } 30 | 31 | l(A.L1); // <-- should be a compile-time ConstantValue; checked by .sh. 32 | 33 | new PublicInner(); 34 | } 35 | 36 | @MyAnnotation 37 | void l(long l) {} 38 | 39 | @RuntimeAnnotation 40 | public int k; 41 | 42 | public static void main(String[] args) throws Exception { 43 | // Regression test for bug #1210750. 44 | if (!Class.forName("B").getField("k").isAnnotationPresent(RuntimeAnnotation.class)) { 45 | throw new AssertionError("RuntimeAnnotation got lost!"); 46 | } 47 | 48 | System.err.println("B.main() OK"); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /third_party/ijar/test/DeprecatedParts.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * A class with various deprecated parts used for testing. 17 | */ 18 | @SuppressWarnings("dep-ann") 19 | final class DeprecatedParts { 20 | @Deprecated 21 | public static String deprecatedViaAnnotationStaticField = "hi"; 22 | 23 | /** 24 | * @deprecated Marked deprecated for test. 25 | */ 26 | public static String deprecatedViaJavadocStaticField = "hi"; 27 | 28 | @Deprecated 29 | public String deprecatedViaAnnotationField = "hi"; 30 | 31 | /** 32 | * @deprecated Marked deprecated for test. 33 | */ 34 | public String deprecatedViaJavadocField = "hi"; 35 | 36 | @Deprecated 37 | public void deprecatedViaAnnotationMethod() { 38 | } 39 | 40 | /** 41 | * @deprecated Marked deprecated for test. 42 | */ 43 | public void deprecatedViaJavadocMethod() { 44 | } 45 | 46 | // Note: @Deprecated can be applied to parameters, but the compiler doesn't seem to use it 47 | 48 | @Deprecated 49 | public static void deprecatedViaAnnotationStaticMethod() { 50 | } 51 | 52 | /** 53 | * @deprecated Marked deprecated for test. 54 | */ 55 | public static void deprecatedViaJavadocStaticMethod() { 56 | } 57 | 58 | @Deprecated 59 | public @interface DeprecatedViaAnnotationAnnotation {} 60 | 61 | /** 62 | * @deprecated Marked deprecated for test. 63 | */ 64 | public @interface DeprecatedViaJavadocAnnotation {} 65 | 66 | @Deprecated 67 | public static class DeprecatedViaAnnotationClass {} 68 | 69 | /** 70 | * @deprecated Marked deprecated to exercise preservation of deprecation. 71 | */ 72 | public static class DeprecatedViaJavadocClass {} 73 | 74 | public static class DeprecatedViaAnnotationConstructor { 75 | @Deprecated 76 | public DeprecatedViaAnnotationConstructor() {} 77 | } 78 | 79 | public static class DeprecatedViaJavadocConstructor { 80 | /** 81 | * @deprecated Marked deprecated for test. 82 | */ 83 | public DeprecatedViaJavadocConstructor() {} 84 | } 85 | 86 | @Deprecated 87 | public interface DeprecatedViaAnnotationInterface {} 88 | 89 | /** 90 | * @deprecated Marked deprecated for test. 91 | */ 92 | public interface DeprecatedViaJavadocInterface {} 93 | } 94 | -------------------------------------------------------------------------------- /third_party/ijar/test/DumbClass.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * For testing purposes: a "dumb" class in that it exposes a private 17 | * inner class in public API. 18 | */ 19 | class DumbClass { 20 | public Inner inner; 21 | private class Inner { 22 | V v; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /third_party/ijar/test/EnclosingMethod.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import java.util.concurrent.Callable; 16 | 17 | /** 18 | * For testing purposes, an anonymous inner class that requires an 19 | * EnclosingMethod attribute in its class file. 20 | */ 21 | class EnclosingMethod { 22 | class Inner { 23 | public T run(Callable callable) { 24 | try { 25 | return callable.call(); 26 | } catch (Exception ex) { 27 | return null; 28 | } 29 | } 30 | 31 | private Callable asCallable(final Callable callableToWrap) { 32 | return new Callable() { 33 | @Override public T call() throws Exception { 34 | return Inner.this.run(callableToWrap); 35 | } 36 | }; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /third_party/ijar/test/Object.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package java.lang; 16 | 17 | class Object { 18 | } 19 | -------------------------------------------------------------------------------- /third_party/ijar/test/PrivateMembersClass.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * A class with many private parts. Used for testing. 17 | */ 18 | final class PrivateMembersClass { 19 | private String privateField; 20 | 21 | private PrivateMembersClass() {} 22 | 23 | public static void main() { 24 | privateStaticMethod(); 25 | } 26 | 27 | private static void privateStaticMethod() { 28 | new PrivateMembersClass().privateMethod(); 29 | } 30 | 31 | private void privateMethod() { 32 | new PrivateInnerClass().print(); 33 | new PrivateStaticInnerClass().print(); 34 | } 35 | 36 | private class PrivateInnerClass { 37 | void print() { 38 | System.out.println("private inner"); 39 | } 40 | } 41 | 42 | private static class PrivateStaticInnerClass { 43 | void print() { 44 | System.out.println("private static inner"); 45 | } 46 | } 47 | 48 | private interface PrivateInnerInterface {} 49 | 50 | private @interface PrivateInnerAnnotation {} 51 | } 52 | -------------------------------------------------------------------------------- /third_party/ijar/test/PrivateNestedClass.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * For testing purposes: a client of DumbClass. 17 | */ 18 | class PrivateNestedClass { 19 | static { Object o = new DumbClass().inner; } 20 | } 21 | -------------------------------------------------------------------------------- /third_party/ijar/test/TypeAnnotationTest2.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | public class TypeAnnotationTest2 { 16 | void m(Object o) { 17 | Util.castNullable(null); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /third_party/ijar/test/UseDeprecatedParts.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * A class that uses deprecated things for testing. 17 | */ 18 | final class UseDeprecatedParts { 19 | @DeprecatedParts.DeprecatedViaAnnotationAnnotation String annotatedField1; 20 | @DeprecatedParts.DeprecatedViaJavadocAnnotation String annotatedField2; 21 | 22 | static final DeprecatedParts.DeprecatedViaAnnotationConstructor dummyField1 = 23 | new DeprecatedParts.DeprecatedViaAnnotationConstructor(); 24 | static final DeprecatedParts.DeprecatedViaJavadocConstructor dummyField2 = 25 | new DeprecatedParts.DeprecatedViaJavadocConstructor (); 26 | 27 | public static void dummyMethod() { 28 | System.out.println(DeprecatedParts.deprecatedViaAnnotationStaticField); 29 | System.out.println(DeprecatedParts.deprecatedViaJavadocStaticField); 30 | 31 | System.out.println(new DeprecatedParts().deprecatedViaAnnotationField); 32 | System.out.println(new DeprecatedParts().deprecatedViaJavadocField); 33 | 34 | new DeprecatedParts().deprecatedViaAnnotationMethod(); 35 | new DeprecatedParts().deprecatedViaJavadocMethod(); 36 | 37 | DeprecatedParts.deprecatedViaAnnotationStaticMethod(); 38 | DeprecatedParts.deprecatedViaJavadocStaticMethod(); 39 | } 40 | 41 | class Class1 extends DeprecatedParts.DeprecatedViaAnnotationClass {} 42 | 43 | class Class2 extends DeprecatedParts.DeprecatedViaJavadocClass {} 44 | 45 | interface Interface1 extends DeprecatedParts.DeprecatedViaAnnotationInterface {} 46 | 47 | interface Interface2 extends DeprecatedParts.DeprecatedViaJavadocInterface {} 48 | } 49 | -------------------------------------------------------------------------------- /third_party/ijar/test/UseRestrictedAnnotation.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * Incorrect use of RestrictedAnnotation. Used for testing. 17 | */ 18 | public class UseRestrictedAnnotation { 19 | @Annotations.ParametersOnlyAnnotation 20 | public void m() { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /third_party/ijar/test/invokedynamic/ClassWithLambda.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import java.util.function.Function; 16 | 17 | class ClassWithLambda { 18 | interface Rec extends Function {} 19 | 20 | private static final String HELLO = "Hello World"; 21 | 22 | int hash(Function hashFunc) { 23 | return hashFunc.apply(HELLO); 24 | } 25 | 26 | void m() { 27 | Rec f = x -> x.apply(x); 28 | 29 | int x = hash(String::hashCode); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /third_party/ijar/test/libwrongcentraldir.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/ijar/test/libwrongcentraldir.jar -------------------------------------------------------------------------------- /third_party/ijar/test/package-info.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** Empty package-info */ -------------------------------------------------------------------------------- /third_party/ijar/test/testenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2015 Google Inc. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Setting up the environment for Bazel integration tests. 18 | # 19 | 20 | [ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } 21 | 22 | # Load the unit-testing framework 23 | source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ 24 | { echo "Failed to source unittest.bash" >&2; exit 1; } 25 | 26 | ## Mac OS X stat and MD5 27 | PLATFORM="$(uname -s | tr 'A-Z' 'a-z')" 28 | if [[ "$PLATFORM" = "darwin" ]]; then 29 | function statfmt() { 30 | stat -f "%z" $1 31 | } 32 | MD5SUM=/sbin/md5 33 | else 34 | function statfmt() { 35 | stat -c "%s" $1 36 | } 37 | MD5SUM=md5sum 38 | fi 39 | -------------------------------------------------------------------------------- /third_party/ijar/test/typeannotations2/NonNull.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import java.lang.annotation.ElementType; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) 22 | public @interface NonNull { 23 | } 24 | -------------------------------------------------------------------------------- /third_party/ijar/test/typeannotations2/Nullable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import java.lang.annotation.ElementType; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) 22 | public @interface Nullable { 23 | } 24 | -------------------------------------------------------------------------------- /third_party/ijar/test/typeannotations2/Util.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | public class Util { 16 | public static @NonNull T castNullable(T value) { 17 | return (@NonNull T) value; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /third_party/ijar/test/typeannotations2/java/lang/annotation/ElementType.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package java.lang.annotation; 16 | 17 | /** 18 | * This is stub for the jdk8 ElementType. It allows the test to compile with a 19 | * jdk7 javabase. 20 | */ 21 | public enum ElementType { TYPE_USE, TYPE_PARAMETER; } 22 | -------------------------------------------------------------------------------- /third_party/ijar/test/zip_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | # 3 | # Copyright 2015 Google Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | 15 | # Integration tests for ijar zipper/unzipper 16 | 17 | 18 | DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 19 | 20 | ## Inputs 21 | ZIPPER=${PWD}/$1 22 | shift 23 | UNZIP=$1 24 | shift 25 | ZIP=$1 26 | shift 27 | 28 | ## Test framework 29 | source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } 30 | 31 | # Assertion 32 | function assert_unzip_same_as_zipper() { 33 | local folder1=$(mktemp -d ${TEST_TMPDIR}/output.XXXXXXXX) 34 | local folder2=$(mktemp -d ${TEST_TMPDIR}/output.XXXXXXXX) 35 | (cd $folder1 && $UNZIP -q $1 || true) # ignore CRC32 errors 36 | (cd $folder2 && $ZIPPER x $1) 37 | diff -r $folder1 $folder2 &> $TEST_log \ 38 | || fail "Unzip and Zipper resulted in different output" 39 | } 40 | 41 | function assert_zipper_same_after_unzip() { 42 | local zipfile=${TEST_TMPDIR}/output.zip 43 | (cd $1 && $ZIPPER c ${zipfile} $(find . | sed 's|^./||' | grep -v '^.$')) 44 | local folder=$(mktemp -d ${TEST_TMPDIR}/output.XXXXXXXX) 45 | (cd $folder && $UNZIP -q ${zipfile} || true) # ignore CRC32 errors 46 | diff -r $1 $folder &> $TEST_log \ 47 | || fail "Unzip after zipper output differ" 48 | } 49 | 50 | #### Tests 51 | 52 | function test_zipper() { 53 | mkdir -p ${TEST_TMPDIR}/test/path/to/some 54 | mkdir -p ${TEST_TMPDIR}/test/some/other/path 55 | touch ${TEST_TMPDIR}/test/path/to/some/empty_file 56 | echo "toto" > ${TEST_TMPDIR}/test/path/to/some/file 57 | echo "titi" > ${TEST_TMPDIR}/test/path/to/some/other_file 58 | chmod +x ${TEST_TMPDIR}/test/path/to/some/other_file 59 | echo "tata" > ${TEST_TMPDIR}/test/file 60 | assert_zipper_same_after_unzip ${TEST_TMPDIR}/test 61 | assert_unzip_same_as_zipper ${TEST_TMPDIR}/output.zip 62 | 63 | # Test flatten option 64 | (cd ${TEST_TMPDIR}/test && $ZIPPER cf ${TEST_TMPDIR}/output.zip \ 65 | $(find . | sed 's|^./||' | grep -v '^.$')) 66 | $ZIPPER v ${TEST_TMPDIR}/output.zip >$TEST_log 67 | expect_log "file" 68 | expect_log "other_file" 69 | expect_not_log "path" 70 | expect_not_log "/" 71 | 72 | # Test adding leading garbage at the begining of the file (for 73 | # self-extractable binary). 74 | echo "abcdefghi" >${TEST_TMPDIR}/test.zip 75 | cat ${TEST_TMPDIR}/output.zip >>${TEST_TMPDIR}/test.zip 76 | $ZIPPER v ${TEST_TMPDIR}/test.zip >$TEST_log 77 | expect_log "file" 78 | expect_log "other_file" 79 | expect_not_log "path" 80 | } 81 | 82 | run_suite "zipper tests" 83 | -------------------------------------------------------------------------------- /third_party/java/animal-sniffer/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ['//visibility:public']) 2 | 3 | licenses(['notice']) 4 | 5 | java_library( 6 | name = 'annotations', 7 | srcs = glob([ 8 | 'upstream/animal-sniffer-annotations/src/main/**/*.java', 9 | ]), 10 | deps = [ 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/java/commons-logging/BUILD: -------------------------------------------------------------------------------- 1 | licenses(['notice']) 2 | package(default_visibility = ['//visibility:public']) 3 | 4 | java_library( 5 | name = 'commons-logging', 6 | javacopts = [ 7 | '-extra_checks:off', 8 | ], 9 | srcs = glob([ 10 | 'upstream/src/main/**/*.java' 11 | ], exclude=[ 12 | 'upstream/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java', 13 | 'upstream/src/main/java/org/apache/commons/logging/impl/ServletContextCleaner.java', 14 | # This depends apache logkit 15 | 'upstream/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java' 16 | ]), 17 | deps = [ 18 | '//third_party/java/log4j', 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /third_party/java/guava/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ['//visibility:public']) 2 | 3 | licenses(['notice']) 4 | 5 | java_library( 6 | name = 'guava', 7 | javacopts = [ 8 | '-extra_checks:off', 9 | ], 10 | srcs = glob([ 11 | 'upstream/guava/src/com/google/**/*.java' 12 | ]), 13 | deps = [ 14 | '//third_party/java/animal-sniffer:annotations', 15 | '//third_party/java/error-prone/annotations', 16 | '//third_party/java/j2objc:annotations', 17 | '//third_party/java/jsr305', 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /third_party/java/j2objc/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ['//visibility:public']) 2 | 3 | licenses(['notice']) 4 | 5 | java_library( 6 | name = 'annotations', 7 | srcs = glob([ 8 | 'upstream/annotations/src/main/java/com/google/**/*.java' 9 | ]), 10 | deps = [ 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/java/javassist/BUILD: -------------------------------------------------------------------------------- 1 | licenses(['notice']) 2 | package(default_visibility = ['//visibility:public']) 3 | 4 | java_library( 5 | name = 'javassist', 6 | javacopts = [ 7 | '-extra_checks:off', 8 | ], 9 | srcs = glob([ 10 | 'upstream/src/main/**/*.java' 11 | ], exclude=[ 12 | 'upstream/src/main/javassist/util/HotSwapper.java', 13 | ]), 14 | deps = [ 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /third_party/java/jdk/langtools/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["restricted"]) # GNU GPL v2 with Classpath exception 4 | 5 | filegroup( 6 | name = "srcs", 7 | srcs = glob(["**"]), 8 | ) 9 | 10 | filegroup( 11 | name = "javac_jar", 12 | srcs = ["javac.jar"], 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/java/jdk/langtools/javac.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/java/jdk/langtools/javac.jar -------------------------------------------------------------------------------- /third_party/java/jsr305/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ['//visibility:public']) 2 | licenses(['notice']) 3 | 4 | java_import( 5 | name = 'jsr305', 6 | jars = [ 7 | 'jsr-305.jar' 8 | ], 9 | ) 10 | -------------------------------------------------------------------------------- /third_party/java/jsr305/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2009, JSR305 expert group 2 | All rights reserved. 3 | 4 | http://www.opensource.org/licenses/bsd-license.php 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | * Neither the name of the JSR305 expert group nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /third_party/java/jsr305/jsr-305.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/java/jsr305/jsr-305.jar -------------------------------------------------------------------------------- /third_party/java/log4j/BUILD: -------------------------------------------------------------------------------- 1 | licenses(['notice']) 2 | package(default_visibility = ['//visibility:public']) 3 | 4 | java_library( 5 | name = 'log4j', 6 | javacopts = [ 7 | '-extra_checks:off', 8 | ], 9 | srcs = glob([ 10 | 'upstream/src/main/java/org/apache/log4j/*.java', 11 | 'upstream/src/main/java/org/apache/log4j/config/*.java', 12 | 'upstream/src/main/java/org/apache/log4j/helpers/*.java', 13 | 'upstream/src/main/java/org/apache/log4j/pattern/*.java', 14 | 'upstream/src/main/java/org/apache/log4j/or/*.java', 15 | 'upstream/src/main/java/org/apache/log4j/spi/*.java', 16 | ], exclude=[ 17 | ]), 18 | ) 19 | -------------------------------------------------------------------------------- /third_party/java/slf4j/BUILD: -------------------------------------------------------------------------------- 1 | licenses(['notice']) 2 | package(default_visibility = ['//visibility:public']) 3 | 4 | java_library( 5 | name = 'api', 6 | srcs = glob([ 7 | 'upstream/slf4j-api/src/main/java/**/*.java' 8 | ]), 9 | javacopts = [ 10 | '-extra_checks:off', 11 | ], 12 | deps = [ 13 | ], 14 | ) 15 | 16 | java_library( 17 | name = 'slf4j', 18 | exports = [ 19 | 'api', 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /third_party/java/twitter-commons/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ['//visibility:public']) 2 | 3 | licenses(['notice']) 4 | 5 | guava = '//third_party/java/guava' 6 | jsr305 = '//third_party/java/jsr305' 7 | 8 | java_library( 9 | name = 'args-core', 10 | srcs = [ 11 | 'upstream/src/java/com/twitter/common/args/' + x for x in [ 12 | 'Arg.java', 13 | 'ArgParser.java', 14 | 'CmdLine.java', 15 | 'NoParser.java', 16 | 'Parser.java', 17 | 'ParserOracle.java', 18 | 'Positional.java', 19 | 'Verifier.java', 20 | 'VerifierFor.java', 21 | ] 22 | ], 23 | deps = [ 24 | jsr305, 25 | ':base', 26 | ':collections', 27 | '//third_party/java/guava', 28 | ], 29 | ) 30 | 31 | java_library( 32 | name = 'base', 33 | srcs = glob([ 34 | 'upstream/src/java/com/twitter/common/base/**/*.java', 35 | ]), 36 | deps = [ 37 | ':collections', 38 | ':quantity', 39 | ':system-clocks', 40 | '//external:apache-commons-lang2', 41 | '//third_party/java/jsr305', 42 | '//third_party/java/guava', 43 | ], 44 | ) 45 | 46 | java_library( 47 | name = 'collections', 48 | srcs = glob([ 49 | 'upstream/src/java/com/twitter/common/collections/**/*.java', 50 | ]), 51 | deps = [ 52 | '//external:apache-commons-lang2', 53 | '//external:jsr305', 54 | '//third_party/java/guava', 55 | ], 56 | ) 57 | 58 | java_library( 59 | name = 'logging', 60 | srcs = [ 61 | 'upstream/src/java/com/twitter/common/logging/Glog.java', 62 | 'upstream/src/java/com/twitter/common/logging/Log.java', 63 | 'upstream/src/java/com/twitter/common/logging/LogUtil.java', 64 | 'upstream/src/java/com/twitter/common/logging/LogFormatter.java', 65 | 'upstream/src/java/com/twitter/common/logging/RootLogConfig.java', 66 | ], 67 | deps = [ 68 | ':args-core', 69 | '//external:apache-commons-lang2', 70 | '//external:joda-time', 71 | guava, 72 | jsr305, 73 | ] 74 | ) 75 | 76 | java_library( 77 | name = 'quantity', 78 | srcs = glob([ 79 | 'upstream/src/java/com/twitter/common/quantity/**/*.java', 80 | ]), 81 | deps = [ 82 | ':collections', 83 | '//third_party/java/guava', 84 | ], 85 | ) 86 | 87 | # Inside util 88 | java_library( 89 | name = 'util-logging', 90 | srcs = glob([ 91 | 'upstream/src/java/com/twitter/common/util/logging/*.java', 92 | ]), 93 | deps = [ 94 | #':collections', 95 | guava, 96 | ], 97 | ) 98 | 99 | java_library( 100 | name = 'system-clocks', 101 | srcs = [ 102 | 'upstream/src/java/com/twitter/common/util/Clock.java', 103 | 'upstream/src/java/com/twitter/common/util/Random.java', 104 | ], 105 | deps = [ 106 | guava, 107 | ], 108 | ) 109 | -------------------------------------------------------------------------------- /third_party/jemalloc/gen_public_symbols.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # produce public_symbols.txt, see configure.ac 4 | # this will be used public_namespace.sh and public_unnamespace.sh 5 | 6 | # TODO: this should be auto updated. 7 | jemalloc_version_gid="ac5185f73e4dc6b8d9a48b7080d07b11ef231765" 8 | 9 | public_syms="aligned_alloc calloc dallocx free mallctl mallctlbymib 10 | mallctlnametomib malloc malloc_conf malloc_message malloc_stats_print 11 | malloc_usable_size mallocx smallocx_${jemalloc_version_gid} nallocx 12 | posix_memalign rallocx realloc sallocx sdallocx xallocx" 13 | 14 | public_syms="${public_syms} memalign valloc" 15 | 16 | f=$1 17 | cp /dev/null "${f}" 18 | for nm in `echo ${mangling_map} |tr ',' ' '` ; do 19 | n=`echo ${nm} |tr ':' ' ' |awk '{print $[]1}'` 20 | m=`echo ${nm} |tr ':' ' ' |awk '{print $[]2}'` 21 | echo "${n}:${m}" >> "${f}" 22 | # Remove name from public_syms so that it isn't redefined later. 23 | public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${n}\$" |tr '\n' ' '` 24 | done 25 | for sym in ${public_syms} ; do 26 | n="${sym}" 27 | m="${JEMALLOC_PREFIX}${sym}" 28 | echo "${n}:${m}" >> "${f}" 29 | done 30 | 31 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/internal/public_namespace.h: -------------------------------------------------------------------------------- 1 | #define je_aligned_alloc JEMALLOC_N(aligned_alloc) 2 | #define je_calloc JEMALLOC_N(calloc) 3 | #define je_dallocx JEMALLOC_N(dallocx) 4 | #define je_free JEMALLOC_N(free) 5 | #define je_mallctl JEMALLOC_N(mallctl) 6 | #define je_mallctlbymib JEMALLOC_N(mallctlbymib) 7 | #define je_mallctlnametomib JEMALLOC_N(mallctlnametomib) 8 | #define je_malloc JEMALLOC_N(malloc) 9 | #define je_malloc_conf JEMALLOC_N(malloc_conf) 10 | #define je_malloc_message JEMALLOC_N(malloc_message) 11 | #define je_malloc_stats_print JEMALLOC_N(malloc_stats_print) 12 | #define je_malloc_usable_size JEMALLOC_N(malloc_usable_size) 13 | #define je_mallocx JEMALLOC_N(mallocx) 14 | #define je_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 JEMALLOC_N(smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765) 15 | #define je_nallocx JEMALLOC_N(nallocx) 16 | #define je_posix_memalign JEMALLOC_N(posix_memalign) 17 | #define je_rallocx JEMALLOC_N(rallocx) 18 | #define je_realloc JEMALLOC_N(realloc) 19 | #define je_sallocx JEMALLOC_N(sallocx) 20 | #define je_sdallocx JEMALLOC_N(sdallocx) 21 | #define je_xallocx JEMALLOC_N(xallocx) 22 | #define je_memalign JEMALLOC_N(memalign) 23 | #define je_valloc JEMALLOC_N(valloc) 24 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/internal/public_symbols.txt: -------------------------------------------------------------------------------- 1 | aligned_alloc:aligned_alloc 2 | calloc:calloc 3 | dallocx:dallocx 4 | free:free 5 | mallctl:mallctl 6 | mallctlbymib:mallctlbymib 7 | mallctlnametomib:mallctlnametomib 8 | malloc:malloc 9 | malloc_conf:malloc_conf 10 | malloc_message:malloc_message 11 | malloc_stats_print:malloc_stats_print 12 | malloc_usable_size:malloc_usable_size 13 | mallocx:mallocx 14 | smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765:smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 15 | nallocx:nallocx 16 | posix_memalign:posix_memalign 17 | rallocx:rallocx 18 | realloc:realloc 19 | sallocx:sallocx 20 | sdallocx:sdallocx 21 | xallocx:xallocx 22 | memalign:memalign 23 | valloc:valloc 24 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/internal/public_unnamespace.h: -------------------------------------------------------------------------------- 1 | #undef je_aligned_alloc 2 | #undef je_calloc 3 | #undef je_dallocx 4 | #undef je_free 5 | #undef je_mallctl 6 | #undef je_mallctlbymib 7 | #undef je_mallctlnametomib 8 | #undef je_malloc 9 | #undef je_malloc_conf 10 | #undef je_malloc_message 11 | #undef je_malloc_stats_print 12 | #undef je_malloc_usable_size 13 | #undef je_mallocx 14 | #undef je_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 15 | #undef je_nallocx 16 | #undef je_posix_memalign 17 | #undef je_rallocx 18 | #undef je_realloc 19 | #undef je_sallocx 20 | #undef je_sdallocx 21 | #undef je_xallocx 22 | #undef je_memalign 23 | #undef je_valloc 24 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/jemalloc_defs.h: -------------------------------------------------------------------------------- 1 | /* include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */ 2 | /* Defined if __attribute__((...)) syntax is supported. */ 3 | #define JEMALLOC_HAVE_ATTR 4 | 5 | /* Defined if alloc_size attribute is supported. */ 6 | #define JEMALLOC_HAVE_ATTR_ALLOC_SIZE 7 | 8 | /* Defined if format_arg(...) attribute is supported. */ 9 | #define JEMALLOC_HAVE_ATTR_FORMAT_ARG 10 | 11 | /* Defined if format(gnu_printf, ...) attribute is supported. */ 12 | #define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF 13 | 14 | /* Defined if format(printf, ...) attribute is supported. */ 15 | #define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF 16 | 17 | /* 18 | * Define overrides for non-standard allocator-related functions if they are 19 | * present on the system. 20 | */ 21 | #define JEMALLOC_OVERRIDE_MEMALIGN 22 | #define JEMALLOC_OVERRIDE_VALLOC 23 | 24 | /* 25 | * At least Linux omits the "const" in: 26 | * 27 | * size_t malloc_usable_size(const void *ptr); 28 | * 29 | * Match the operating system's prototype. 30 | */ 31 | #define JEMALLOC_USABLE_SIZE_CONST 32 | 33 | /* 34 | * If defined, specify throw() for the public function prototypes when compiling 35 | * with C++. The only justification for this is to match the prototypes that 36 | * glibc defines. 37 | */ 38 | #define JEMALLOC_USE_CXX_THROW 39 | 40 | #ifdef _MSC_VER 41 | # ifdef _WIN64 42 | # define LG_SIZEOF_PTR_WIN 3 43 | # else 44 | # define LG_SIZEOF_PTR_WIN 2 45 | # endif 46 | #endif 47 | 48 | /* sizeof(void *) == 2^LG_SIZEOF_PTR. */ 49 | #define LG_SIZEOF_PTR 3 50 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/jemalloc_mangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * By default application code must explicitly refer to mangled symbol names, 3 | * so that it is possible to use jemalloc in conjunction with another allocator 4 | * in the same application. Define JEMALLOC_MANGLE in order to cause automatic 5 | * name mangling that matches the API prefixing that happened as a result of 6 | * --with-mangling and/or --with-jemalloc-prefix configuration settings. 7 | */ 8 | #ifdef JEMALLOC_MANGLE 9 | # ifndef JEMALLOC_NO_DEMANGLE 10 | # define JEMALLOC_NO_DEMANGLE 11 | # endif 12 | # define aligned_alloc je_aligned_alloc 13 | # define calloc je_calloc 14 | # define dallocx je_dallocx 15 | # define free je_free 16 | # define mallctl je_mallctl 17 | # define mallctlbymib je_mallctlbymib 18 | # define mallctlnametomib je_mallctlnametomib 19 | # define malloc je_malloc 20 | # define malloc_conf je_malloc_conf 21 | # define malloc_message je_malloc_message 22 | # define malloc_stats_print je_malloc_stats_print 23 | # define malloc_usable_size je_malloc_usable_size 24 | # define mallocx je_mallocx 25 | # define smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 je_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 26 | # define nallocx je_nallocx 27 | # define posix_memalign je_posix_memalign 28 | # define rallocx je_rallocx 29 | # define realloc je_realloc 30 | # define sallocx je_sallocx 31 | # define sdallocx je_sdallocx 32 | # define xallocx je_xallocx 33 | # define memalign je_memalign 34 | # define valloc je_valloc 35 | #endif 36 | 37 | /* 38 | * The je_* macros can be used as stable alternative names for the 39 | * public jemalloc API if JEMALLOC_NO_DEMANGLE is defined. This is primarily 40 | * meant for use in jemalloc itself, but it can be used by application code to 41 | * provide isolation from the name mangling specified via --with-mangling 42 | * and/or --with-jemalloc-prefix. 43 | */ 44 | #ifndef JEMALLOC_NO_DEMANGLE 45 | # undef je_aligned_alloc 46 | # undef je_calloc 47 | # undef je_dallocx 48 | # undef je_free 49 | # undef je_mallctl 50 | # undef je_mallctlbymib 51 | # undef je_mallctlnametomib 52 | # undef je_malloc 53 | # undef je_malloc_conf 54 | # undef je_malloc_message 55 | # undef je_malloc_stats_print 56 | # undef je_malloc_usable_size 57 | # undef je_mallocx 58 | # undef je_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 59 | # undef je_nallocx 60 | # undef je_posix_memalign 61 | # undef je_rallocx 62 | # undef je_realloc 63 | # undef je_sallocx 64 | # undef je_sdallocx 65 | # undef je_xallocx 66 | # undef je_memalign 67 | # undef je_valloc 68 | #endif 69 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/jemalloc_mangle_jet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * By default application code must explicitly refer to mangled symbol names, 3 | * so that it is possible to use jemalloc in conjunction with another allocator 4 | * in the same application. Define JEMALLOC_MANGLE in order to cause automatic 5 | * name mangling that matches the API prefixing that happened as a result of 6 | * --with-mangling and/or --with-jemalloc-prefix configuration settings. 7 | */ 8 | #ifdef JEMALLOC_MANGLE 9 | # ifndef JEMALLOC_NO_DEMANGLE 10 | # define JEMALLOC_NO_DEMANGLE 11 | # endif 12 | # define aligned_alloc jet_aligned_alloc 13 | # define calloc jet_calloc 14 | # define dallocx jet_dallocx 15 | # define free jet_free 16 | # define mallctl jet_mallctl 17 | # define mallctlbymib jet_mallctlbymib 18 | # define mallctlnametomib jet_mallctlnametomib 19 | # define malloc jet_malloc 20 | # define malloc_conf jet_malloc_conf 21 | # define malloc_message jet_malloc_message 22 | # define malloc_stats_print jet_malloc_stats_print 23 | # define malloc_usable_size jet_malloc_usable_size 24 | # define mallocx jet_mallocx 25 | # define smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 jet_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 26 | # define nallocx jet_nallocx 27 | # define posix_memalign jet_posix_memalign 28 | # define rallocx jet_rallocx 29 | # define realloc jet_realloc 30 | # define sallocx jet_sallocx 31 | # define sdallocx jet_sdallocx 32 | # define xallocx jet_xallocx 33 | # define memalign jet_memalign 34 | # define valloc jet_valloc 35 | #endif 36 | 37 | /* 38 | * The jet_* macros can be used as stable alternative names for the 39 | * public jemalloc API if JEMALLOC_NO_DEMANGLE is defined. This is primarily 40 | * meant for use in jemalloc itself, but it can be used by application code to 41 | * provide isolation from the name mangling specified via --with-mangling 42 | * and/or --with-jemalloc-prefix. 43 | */ 44 | #ifndef JEMALLOC_NO_DEMANGLE 45 | # undef jet_aligned_alloc 46 | # undef jet_calloc 47 | # undef jet_dallocx 48 | # undef jet_free 49 | # undef jet_mallctl 50 | # undef jet_mallctlbymib 51 | # undef jet_mallctlnametomib 52 | # undef jet_malloc 53 | # undef jet_malloc_conf 54 | # undef jet_malloc_message 55 | # undef jet_malloc_stats_print 56 | # undef jet_malloc_usable_size 57 | # undef jet_mallocx 58 | # undef jet_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 59 | # undef jet_nallocx 60 | # undef jet_posix_memalign 61 | # undef jet_rallocx 62 | # undef jet_realloc 63 | # undef jet_sallocx 64 | # undef jet_sdallocx 65 | # undef jet_xallocx 66 | # undef jet_memalign 67 | # undef jet_valloc 68 | #endif 69 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/jemalloc_protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The je_ prefix on the following public symbol declarations is an artifact 3 | * of namespace management, and should be omitted in application code unless 4 | * JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle.h). 5 | */ 6 | extern JEMALLOC_EXPORT const char *je_malloc_conf; 7 | extern JEMALLOC_EXPORT void (*je_malloc_message)(void *cbopaque, 8 | const char *s); 9 | 10 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 11 | void JEMALLOC_NOTHROW *je_malloc(size_t size) 12 | JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1); 13 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 14 | void JEMALLOC_NOTHROW *je_calloc(size_t num, size_t size) 15 | JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE2(1, 2); 16 | JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_posix_memalign(void **memptr, 17 | size_t alignment, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(nonnull(1)); 18 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 19 | void JEMALLOC_NOTHROW *je_aligned_alloc(size_t alignment, 20 | size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) 21 | JEMALLOC_ALLOC_SIZE(2); 22 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 23 | void JEMALLOC_NOTHROW *je_realloc(void *ptr, size_t size) 24 | JEMALLOC_CXX_THROW JEMALLOC_ALLOC_SIZE(2); 25 | JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_free(void *ptr) 26 | JEMALLOC_CXX_THROW; 27 | 28 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 29 | void JEMALLOC_NOTHROW *je_mallocx(size_t size, int flags) 30 | JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1); 31 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 32 | void JEMALLOC_NOTHROW *je_rallocx(void *ptr, size_t size, 33 | int flags) JEMALLOC_ALLOC_SIZE(2); 34 | JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_xallocx(void *ptr, size_t size, 35 | size_t extra, int flags); 36 | JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_sallocx(const void *ptr, 37 | int flags) JEMALLOC_ATTR(pure); 38 | JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_dallocx(void *ptr, int flags); 39 | JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_sdallocx(void *ptr, size_t size, 40 | int flags); 41 | JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_nallocx(size_t size, int flags) 42 | JEMALLOC_ATTR(pure); 43 | 44 | JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctl(const char *name, 45 | void *oldp, size_t *oldlenp, void *newp, size_t newlen); 46 | JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctlnametomib(const char *name, 47 | size_t *mibp, size_t *miblenp); 48 | JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctlbymib(const size_t *mib, 49 | size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); 50 | JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_malloc_stats_print( 51 | void (*write_cb)(void *, const char *), void *je_cbopaque, 52 | const char *opts); 53 | JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size( 54 | JEMALLOC_USABLE_SIZE_CONST void *ptr) JEMALLOC_CXX_THROW; 55 | 56 | #ifdef JEMALLOC_OVERRIDE_MEMALIGN 57 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 58 | void JEMALLOC_NOTHROW *je_memalign(size_t alignment, size_t size) 59 | JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc); 60 | #endif 61 | 62 | #ifdef JEMALLOC_OVERRIDE_VALLOC 63 | JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN 64 | void JEMALLOC_NOTHROW *je_valloc(size_t size) JEMALLOC_CXX_THROW 65 | JEMALLOC_ATTR(malloc); 66 | #endif 67 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/jemalloc_rename.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Name mangling for public symbols is controlled by --with-mangling and 3 | * --with-jemalloc-prefix. With default settings the je_ prefix is stripped by 4 | * these macro definitions. 5 | */ 6 | #ifndef JEMALLOC_NO_RENAME 7 | # define je_aligned_alloc aligned_alloc 8 | # define je_calloc calloc 9 | # define je_dallocx dallocx 10 | # define je_free free 11 | # define je_mallctl mallctl 12 | # define je_mallctlbymib mallctlbymib 13 | # define je_mallctlnametomib mallctlnametomib 14 | # define je_malloc malloc 15 | # define je_malloc_conf malloc_conf 16 | # define je_malloc_message malloc_message 17 | # define je_malloc_stats_print malloc_stats_print 18 | # define je_malloc_usable_size malloc_usable_size 19 | # define je_mallocx mallocx 20 | # define je_smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 smallocx_ac5185f73e4dc6b8d9a48b7080d07b11ef231765 21 | # define je_nallocx nallocx 22 | # define je_posix_memalign posix_memalign 23 | # define je_rallocx rallocx 24 | # define je_realloc realloc 25 | # define je_sallocx sallocx 26 | # define je_sdallocx sdallocx 27 | # define je_xallocx xallocx 28 | # define je_memalign memalign 29 | # define je_valloc valloc 30 | #endif 31 | -------------------------------------------------------------------------------- /third_party/jemalloc/k8/include/jemalloc/jemalloc_typedefs.h: -------------------------------------------------------------------------------- 1 | typedef struct extent_hooks_s extent_hooks_t; 2 | 3 | /* 4 | * void * 5 | * extent_alloc(extent_hooks_t *extent_hooks, void *new_addr, size_t size, 6 | * size_t alignment, bool *zero, bool *commit, unsigned arena_ind); 7 | */ 8 | typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, 9 | bool *, unsigned); 10 | 11 | /* 12 | * bool 13 | * extent_dalloc(extent_hooks_t *extent_hooks, void *addr, size_t size, 14 | * bool committed, unsigned arena_ind); 15 | */ 16 | typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, 17 | unsigned); 18 | 19 | /* 20 | * void 21 | * extent_destroy(extent_hooks_t *extent_hooks, void *addr, size_t size, 22 | * bool committed, unsigned arena_ind); 23 | */ 24 | typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, 25 | unsigned); 26 | 27 | /* 28 | * bool 29 | * extent_commit(extent_hooks_t *extent_hooks, void *addr, size_t size, 30 | * size_t offset, size_t length, unsigned arena_ind); 31 | */ 32 | typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, 33 | unsigned); 34 | 35 | /* 36 | * bool 37 | * extent_decommit(extent_hooks_t *extent_hooks, void *addr, size_t size, 38 | * size_t offset, size_t length, unsigned arena_ind); 39 | */ 40 | typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, 41 | size_t, unsigned); 42 | 43 | /* 44 | * bool 45 | * extent_purge(extent_hooks_t *extent_hooks, void *addr, size_t size, 46 | * size_t offset, size_t length, unsigned arena_ind); 47 | */ 48 | typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, 49 | unsigned); 50 | 51 | /* 52 | * bool 53 | * extent_split(extent_hooks_t *extent_hooks, void *addr, size_t size, 54 | * size_t size_a, size_t size_b, bool committed, unsigned arena_ind); 55 | */ 56 | typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, 57 | bool, unsigned); 58 | 59 | /* 60 | * bool 61 | * extent_merge(extent_hooks_t *extent_hooks, void *addr_a, size_t size_a, 62 | * void *addr_b, size_t size_b, bool committed, unsigned arena_ind); 63 | */ 64 | typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, 65 | bool, unsigned); 66 | 67 | struct extent_hooks_s { 68 | extent_alloc_t *alloc; 69 | extent_dalloc_t *dalloc; 70 | extent_destroy_t *destroy; 71 | extent_commit_t *commit; 72 | extent_decommit_t *decommit; 73 | extent_purge_t *purge_lazy; 74 | extent_purge_t *purge_forced; 75 | extent_split_t *split; 76 | extent_merge_t *merge; 77 | }; 78 | -------------------------------------------------------------------------------- /third_party/libco/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | name = "libco", 5 | srcs = [ 6 | "upstream/co_closure.h", 7 | "upstream/co_epoll.cpp", 8 | "upstream/co_epoll.h", 9 | "upstream/co_hook_sys_call.cpp", 10 | "upstream/co_routine.cpp", 11 | "upstream/co_routine_inner.h", 12 | "upstream/co_routine_specific.h", 13 | "upstream/coctx.cpp", 14 | "upstream/coctx.h", 15 | "upstream/coctx_swap.S", 16 | ], 17 | hdrs = [ 18 | "upstream/co_routine.h", 19 | ], 20 | includes = ["upstream/"], 21 | linkopts = [ 22 | "-pthread", 23 | "-ldl", 24 | ], 25 | visibility = ["//visibility:public"], 26 | ) 27 | -------------------------------------------------------------------------------- /third_party/libevent/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | cc_library( 3 | visibility = ["//visibility:public"], 4 | includes = [ 5 | "upstream", 6 | "linux-k8", 7 | ], 8 | srcs = [ 9 | "linux-k8/event-config.h", 10 | "linux-k8/internal/config.h", 11 | "upstream/evdns.h", 12 | "upstream/evsignal.h", 13 | "upstream/log.h", 14 | "upstream/evrpc.h", 15 | "upstream/evutil.h", 16 | "upstream/min_heap.h", 17 | "upstream/event-internal.h", 18 | "upstream/evrpc-internal.h", 19 | "upstream/http-internal.h", 20 | "upstream/strlcpy-internal.h", 21 | "upstream/event.c", 22 | "upstream/buffer.c", 23 | "upstream/evbuffer.c", 24 | "upstream/log.c", 25 | "upstream/evutil.c", 26 | "upstream/event_tagging.c", 27 | "upstream/http.c", 28 | "upstream/evdns.c", 29 | "upstream/strlcpy.c", 30 | "upstream/signal.c", 31 | "upstream/epoll.c", 32 | "upstream/poll.c", 33 | "upstream/select.c", 34 | ], 35 | hdrs = [ 36 | "upstream/event.h", 37 | "upstream/evhttp.h", 38 | ], 39 | name = "libevent", 40 | copts = [ 41 | "-DHAVE_CONFIG_H", 42 | "-Ithird_party/libevent/upstream/compat", 43 | "-Ithird_party/libevent/linux-k8/internal", 44 | "-Wno-unused-but-set-variable", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /third_party/libunwind/libunwind_build/k8/include/libunwind.h: -------------------------------------------------------------------------------- 1 | /* Provide a real file - not a symlink - as it would cause multiarch conflicts 2 | when multiple different arch releases are installed simultaneously. */ 3 | 4 | #ifndef UNW_REMOTE_ONLY 5 | 6 | #if defined __aarch64__ 7 | #include "libunwind-aarch64.h" 8 | #elif defined __arm__ 9 | # include "libunwind-arm.h" 10 | #elif defined __hppa__ 11 | # include "libunwind-hppa.h" 12 | #elif defined __ia64__ 13 | # include "libunwind-ia64.h" 14 | #elif defined __mips__ 15 | # include "libunwind-mips.h" 16 | #elif defined __powerpc__ && !defined __powerpc64__ 17 | # include "libunwind-ppc32.h" 18 | #elif defined __powerpc64__ 19 | # include "libunwind-ppc64.h" 20 | #elif defined __sh__ 21 | # include "libunwind-sh.h" 22 | #elif defined __i386__ 23 | # include "libunwind-x86.h" 24 | #elif defined __x86_64__ 25 | # include "libunwind-x86_64.h" 26 | #elif defined __tilegx__ 27 | # include "libunwind-tilegx.h" 28 | #else 29 | # error "Unsupported arch" 30 | #endif 31 | 32 | #else /* UNW_REMOTE_ONLY */ 33 | 34 | # include "libunwind-x86_64.h" 35 | 36 | #endif /* UNW_REMOTE_ONLY */ 37 | -------------------------------------------------------------------------------- /third_party/libunwind/libunwind_build/k8/include/tdep/libunwind_i.h: -------------------------------------------------------------------------------- 1 | /* Provide a real file - not a symlink - as it would cause multiarch conflicts 2 | when multiple different arch releases are installed simultaneously. */ 3 | 4 | #ifndef UNW_REMOTE_ONLY 5 | 6 | #if defined __aarch64__ 7 | # include "tdep-aarch64/libunwind_i.h" 8 | #elif defined __arm__ 9 | # include "tdep-arm/libunwind_i.h" 10 | #elif defined __hppa__ 11 | # include "tdep-hppa/libunwind_i.h" 12 | #elif defined __ia64__ 13 | # include "tdep-ia64/libunwind_i.h" 14 | #elif defined __mips__ 15 | # include "tdep-mips/libunwind_i.h" 16 | #elif defined __powerpc__ && !defined __powerpc64__ 17 | # include "tdep-ppc32/libunwind_i.h" 18 | #elif defined __powerpc64__ 19 | # include "tdep-ppc64/libunwind_i.h" 20 | #elif defined __sh__ 21 | # include "tdep-sh/libunwind_i.h" 22 | #elif defined __i386__ 23 | # include "tdep-x86/libunwind_i.h" 24 | #elif defined __x86_64__ 25 | # include "tdep-x86_64/libunwind_i.h" 26 | #elif defined __tilegx__ 27 | # include "tdep-tilegx/libunwind_i.h" 28 | #else 29 | # error "Unsupported arch" 30 | #endif 31 | 32 | 33 | #else /* UNW_REMOTE_ONLY */ 34 | 35 | # include "tdep-x86_64/libunwind_i.h" 36 | 37 | #endif /* UNW_REMOTE_ONLY */ 38 | -------------------------------------------------------------------------------- /third_party/openssl/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | config_setting( 4 | name = "linux_x32", 5 | values = {"cpu": "piii"}, 6 | ) 7 | 8 | config_setting( 9 | name = "linux_x64", 10 | values = {"cpu": "k8"}, 11 | ) 12 | 13 | config_setting( 14 | name = "linux_arm", 15 | values = {"cpu": "arm"}, 16 | ) 17 | 18 | openssl_copts = [ 19 | '-DOPENSSL_THREADS', 20 | '-D_REENTRANT', 21 | '-Wa,--noexecstack', 22 | '-DL_ENDIAN', 23 | '-O3', 24 | '-Wall', 25 | '-DOPENSSL_IA32_SSE2', 26 | '-DOPENSSL_BN_ASM_MONT', 27 | '-DOPENSSL_BN_ASM_MONT5', 28 | '-DOPENSSL_BN_ASM_GF2m', 29 | '-DSHA1_ASM ', 30 | '-DSHA256_ASM', 31 | '-DSHA512_ASM', 32 | '-DMD5_ASM', 33 | '-DAES_ASM', 34 | '-DVPAES_ASM', 35 | '-DBSAES_ASM', 36 | '-DWHIRLPOOL_ASM', 37 | '-DGHASH_ASM', 38 | '-DECP_NISTZ256_ASM', 39 | '-I' + package_name() + '/src/crypto', 40 | '-I' + package_name() + '/src/crypto/asn1', 41 | '-I' + package_name() + '/src/crypto/cmac', 42 | '-I' + package_name() + '/src/crypto/evp', 43 | '-I' + package_name() + '/src/crypto/modes', 44 | '-I' + package_name() + '/src', 45 | ] 46 | 47 | load(':BUILD.generated.bzl', 'ssl_headers', 'ssl_internal_headers', 'ssl_sources', 48 | 'crypto_headers', 'crypto_internal_headers', 'crypto_sources', 49 | 'crypto_sources_linux_x86_64') 50 | 51 | genrule( 52 | name = 'buildinfo', 53 | srcs = [ 54 | 'src/util/mkbuildinf.pl', 55 | ], 56 | outs = [ 57 | # The output directory has to match our include path 58 | 'linux-x86_64/include/buildinf.h', 59 | ], 60 | cmd = '/usr/bin/perl $< "' + ' '.join(openssl_copts) + '" "linux-x86_64" > $@' 61 | ) 62 | 63 | cc_library( 64 | name = 'crypto', 65 | visibility = ["//visibility:public"], 66 | hdrs = crypto_headers + [ 67 | ':buildinfo' 68 | ], 69 | srcs = crypto_internal_headers + crypto_sources + select({ 70 | ":linux_x64": crypto_sources_linux_x86_64, 71 | "//conditions:default": crypto_sources_linux_x86_64, 72 | }), 73 | textual_hdrs = [ 74 | "src/crypto/LPdir_unix.c", 75 | "src/crypto/ec/ecp_nistz256_table.c", 76 | "src/crypto/des/ncbc_enc.c", 77 | ], 78 | defines = [ 79 | 'OPENSSL_NO_STATIC_ENGINE', 80 | ], 81 | includes = [ 82 | 'linux-x86_64/include', 83 | ], 84 | copts = openssl_copts, 85 | linkopts = [ 86 | '-pthread' 87 | ] 88 | ) 89 | 90 | cc_library( 91 | name = 'ssl', 92 | visibility = ["//visibility:public"], 93 | hdrs = ssl_headers, 94 | srcs = ssl_internal_headers + ssl_sources, 95 | copts = openssl_copts, 96 | linkopts = [ 97 | '-pthread' 98 | ], 99 | deps = [ 100 | ':crypto', 101 | ] 102 | ) 103 | -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/crypto/aes/asm/aesni-sha256-x86_64.S: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | 4 | .globl aesni_cbc_sha256_enc 5 | .type aesni_cbc_sha256_enc,@function 6 | .align 16 7 | aesni_cbc_sha256_enc: 8 | xorl %eax,%eax 9 | cmpq $0,%rdi 10 | je .Lprobe 11 | ud2 12 | .Lprobe: 13 | .byte 0xf3,0xc3 14 | .size aesni_cbc_sha256_enc,.-aesni_cbc_sha256_enc 15 | 16 | .align 64 17 | .type K256,@object 18 | K256: 19 | .long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5 20 | .long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5 21 | .long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5 22 | .long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5 23 | .long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3 24 | .long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3 25 | .long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174 26 | .long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174 27 | .long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc 28 | .long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc 29 | .long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da 30 | .long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da 31 | .long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7 32 | .long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7 33 | .long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967 34 | .long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967 35 | .long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13 36 | .long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13 37 | .long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85 38 | .long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85 39 | .long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3 40 | .long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3 41 | .long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070 42 | .long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070 43 | .long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5 44 | .long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5 45 | .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 46 | .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 47 | .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 48 | .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 49 | .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 50 | .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 51 | 52 | .long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f 53 | .long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f 54 | .long 0,0,0,0, 0,0,0,0, -1,-1,-1,-1 55 | .long 0,0,0,0, 0,0,0,0 56 | .byte 65,69,83,78,73,45,67,66,67,43,83,72,65,50,53,54,32,115,116,105,116,99,104,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 57 | .align 64 58 | -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/crypto/bn/asm/rsaz-avx2.S: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | .globl rsaz_avx2_eligible 4 | .type rsaz_avx2_eligible,@function 5 | rsaz_avx2_eligible: 6 | xorl %eax,%eax 7 | .byte 0xf3,0xc3 8 | .size rsaz_avx2_eligible,.-rsaz_avx2_eligible 9 | 10 | .globl rsaz_1024_sqr_avx2 11 | .globl rsaz_1024_mul_avx2 12 | .globl rsaz_1024_norm2red_avx2 13 | .globl rsaz_1024_red2norm_avx2 14 | .globl rsaz_1024_scatter5_avx2 15 | .globl rsaz_1024_gather5_avx2 16 | .type rsaz_1024_sqr_avx2,@function 17 | rsaz_1024_sqr_avx2: 18 | rsaz_1024_mul_avx2: 19 | rsaz_1024_norm2red_avx2: 20 | rsaz_1024_red2norm_avx2: 21 | rsaz_1024_scatter5_avx2: 22 | rsaz_1024_gather5_avx2: 23 | .byte 0x0f,0x0b 24 | .byte 0xf3,0xc3 25 | .size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2 26 | -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/crypto/modes/asm/aesni-gcm-x86_64.S: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | .globl aesni_gcm_encrypt 4 | .type aesni_gcm_encrypt,@function 5 | aesni_gcm_encrypt: 6 | xorl %eax,%eax 7 | .byte 0xf3,0xc3 8 | .size aesni_gcm_encrypt,.-aesni_gcm_encrypt 9 | 10 | .globl aesni_gcm_decrypt 11 | .type aesni_gcm_decrypt,@function 12 | aesni_gcm_decrypt: 13 | xorl %eax,%eax 14 | .byte 0xf3,0xc3 15 | .size aesni_gcm_decrypt,.-aesni_gcm_decrypt 16 | -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/aes.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/aes/aes.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/asn1.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/asn1/asn1.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/asn1_mac.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/asn1/asn1_mac.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/asn1t.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/asn1/asn1t.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/bio.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/bio/bio.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/bf/blowfish.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/bn.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/bn/bn.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/buffer/buffer.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/camellia.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/camellia/camellia.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/cast.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/cast/cast.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/cmac/cmac.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/cms.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/cms/cms.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/comp/comp.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/conf.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/conf/conf.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/conf/conf_api.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/crypto.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/crypto.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/des.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/des/des.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/des_old.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/des/des_old.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/dh.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/dh/dh.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/dsa.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/dsa/dsa.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/dso.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/dso/dso.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/dtls1.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/dtls1.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/e_os2.h: -------------------------------------------------------------------------------- 1 | ../../../src/e_os2.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ebcdic.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ec.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ec/ec.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ecdh/ecdh.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ecdsa.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ecdsa/ecdsa.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/engine.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/engine/engine.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/err.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/err/err.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/evp.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/evp/evp.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/hmac/hmac.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/idea.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/idea/idea.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/krb5_asn.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/krb5/krb5_asn.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/kssl.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/kssl.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/lhash.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/lhash/lhash.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/md4.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/md4/md4.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/md5.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/md5/md5.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/mdc2/mdc2.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/modes.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/modes/modes.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/obj_mac.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/objects/obj_mac.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/objects.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/objects/objects.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ocsp.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ocsp/ocsp.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/opensslv.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ossl_typ.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ossl_typ.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/pem.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/pem/pem.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/pem/pem2.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/pkcs12.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/pkcs12/pkcs12.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/pkcs7.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/pkcs7/pkcs7.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/pqueue/pqueue.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/rand.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/rand/rand.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/rc2/rc2.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/rc4/rc4.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ripemd/ripemd.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/rsa.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/rsa/rsa.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/safestack.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/stack/safestack.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/seed.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/seed/seed.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/sha.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/sha/sha.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/srp.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/srp/srp.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/srtp.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/srtp.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ssl.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/ssl.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ssl2.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/ssl2.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/ssl23.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ssl3.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/ssl3.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/stack.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/stack/stack.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/symhacks.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/symhacks.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/tls1.h: -------------------------------------------------------------------------------- 1 | ../../../src/ssl/tls1.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ts.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ts/ts.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/txt_db/txt_db.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ui.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ui/ui.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/ui/ui_compat.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/whrlpool/whrlpool.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/x509.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/x509/x509.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/x509_vfy.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/x509/x509_vfy.h -------------------------------------------------------------------------------- /third_party/openssl/linux-x86_64/include/openssl/x509v3.h: -------------------------------------------------------------------------------- 1 | ../../../src/crypto/x509v3/x509v3.h -------------------------------------------------------------------------------- /third_party/pbjson/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | name = "pbjson", 5 | srcs = [ 6 | "upstream/src/bin2ascii.h", 7 | "upstream/src/pbjson.cpp", 8 | "upstream/src/pbjson.hpp", 9 | ], 10 | hdrs = [ 11 | "pbjson.h", 12 | ], 13 | visibility = ["//visibility:public"], 14 | deps = [ 15 | "//third_party/protobuf", 16 | "//third_party/rapidjson", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /third_party/pbjson/pbjson.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "upstream/src/pbjson.hpp" 4 | -------------------------------------------------------------------------------- /third_party/plink/BUILD: -------------------------------------------------------------------------------- 1 | licenses(['notice']) 2 | package(default_visibility = ["//visibility:public"]) 3 | exports_files([ 4 | 'plink.py' 5 | ]) 6 | -------------------------------------------------------------------------------- /third_party/plink/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Mike Solomon 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of the project nor the names of its contributors may be 14 | used to endorse or promote products derived from this software without 15 | specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /third_party/plink/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from distutils.core import setup 4 | 5 | desc = ''' 6 | Link a python source tree into a single self-executing zip archive. 7 | 8 | It makes embedded C extensions loadable by extracting .so files to disk 9 | on demand. The zip input is staged and then compressed. The plink bootstrap 10 | module is embedded as __main__.py and the actual main module is copied to 11 | __run__.py. The result is an executable zip archive similar to Java JAR file. 12 | 13 | plink --main-file
--pkg-dir 14 | 15 | PLINK_DEBUG=1 ./main-module.par 16 | ''' 17 | 18 | setup( 19 | name='plink', 20 | version='0.2', 21 | description='Link a python source tree into a single self-executing zip archive.', 22 | author='Mike Solomon', 23 | author_email='', 24 | py_modules=['plink'], 25 | long_description=desc, 26 | license='BSD', 27 | classifiers=[ 28 | 'Development Status :: 4 - Beta', 29 | 'Environment :: Console', 30 | 'Intended Audience :: Developers', 31 | 'License :: OSI Approved :: BSD License', 32 | 'Natural Language :: English', 33 | 'Programming Language :: Python', 34 | 'Topic :: Software Development :: Build Tools', 35 | ], 36 | ) 37 | -------------------------------------------------------------------------------- /third_party/rapidjson/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | name = "rapidjson", 5 | hdrs = glob([ 6 | "upstream/include/rapidjson/*.h", 7 | "upstream/include/rapidjson/**/*.h", 8 | ]), 9 | includes = [ 10 | "upstream/include", 11 | ], 12 | visibility = ["//visibility:public"], 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/snappy/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name="snappy", 7 | hdrs = [ 8 | "upstream/snappy.h", 9 | "upstream/snappy-sinksource.h", 10 | "upstream/snappy-c.h", 11 | ], 12 | srcs = [ 13 | "linux-k8/config.h", 14 | "linux-k8/snappy-stubs-public.h", 15 | "upstream/snappy-c.cc", 16 | "upstream/snappy-internal.h", 17 | "upstream/snappy-sinksource.cc", 18 | "upstream/snappy-stubs-internal.cc", 19 | "upstream/snappy-stubs-internal.h", 20 | "upstream/snappy.cc", 21 | ], 22 | copts = [ 23 | "-Ithird_party/snappy/linux-k8", 24 | "-DHAVE_CONFIG_H", 25 | "-Wno-unused-function" 26 | ], 27 | deps = [ 28 | ] 29 | ) 30 | -------------------------------------------------------------------------------- /third_party/v8/base/trace_event/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/third_party/v8/base/trace_event/.keep -------------------------------------------------------------------------------- /third_party/wangle/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | cc_library( 4 | name = "acceptor", 5 | visibility = ["//visibility:public"], 6 | includes = [ 7 | "upstream", 8 | ], 9 | hdrs = glob(["upstream/wangle/acceptor/*.h"]), 10 | srcs = glob(["upstream/wangle/acceptor/*.cpp"]), 11 | deps = [ 12 | ":ssl", 13 | "//third_party/folly:async", 14 | "//third_party/folly:ssl", 15 | "//third_party/boost:parameter", 16 | ] 17 | ) 18 | 19 | cc_library( 20 | name = "bootstrap", 21 | visibility = ["//visibility:public"], 22 | includes = [ 23 | "upstream", 24 | ], 25 | hdrs = glob([ 26 | "upstream/wangle/bootstrap/*.h" 27 | ]), 28 | srcs = [ 29 | "upstream/wangle/bootstrap/ServerBootstrap.cpp" 30 | ], 31 | deps = [ 32 | ":acceptor", 33 | ":channel", 34 | "//third_party/folly:async", 35 | "//third_party/folly:futures", 36 | "//third_party/boost:parameter", 37 | ] 38 | ) 39 | 40 | cc_library( 41 | name = "channel", 42 | visibility = ["//visibility:public"], 43 | includes = [ 44 | "upstream", 45 | ], 46 | hdrs = glob(["upstream/wangle/channel/*.h"]), 47 | srcs = glob(["upstream/wangle/channel/*.cpp"]), 48 | deps = [ 49 | ":acceptor", 50 | ":concurrent", 51 | "//third_party/folly:futures", 52 | "//third_party/boost:variant", 53 | ] 54 | ) 55 | 56 | cc_library( 57 | name = "concurrent", 58 | visibility = ["//visibility:public"], 59 | includes = [ 60 | "upstream", 61 | ], 62 | hdrs = glob([ 63 | "upstream/wangle/concurrent/*.h", 64 | "upstream/wangle/deprecated/rx/*.h", 65 | ]), 66 | srcs = glob(["upstream/wangle/concurrent/*.cpp"]), 67 | deps = [ 68 | "//third_party/folly:futures", 69 | ] 70 | ) 71 | 72 | cc_library( 73 | name = "ssl", 74 | visibility = ["//visibility:public"], 75 | includes = [ 76 | "upstream", 77 | ], 78 | hdrs = glob(["upstream/wangle/ssl/*.h"]) + [ 79 | 'upstream/wangle/acceptor/SSLContextSelectionMisc.h' 80 | ], 81 | srcs = glob(["upstream/wangle/ssl/*.cpp"]), 82 | deps = [ 83 | "//third_party/folly:ssl", 84 | ] 85 | ) 86 | 87 | # Disabled because dependings on boost/thread 88 | # 89 | # cc_test( 90 | # name = "bootstrap_test", 91 | # srcs = [ 92 | # "upstream/wangle/bootstrap/BootstrapTest.cpp" 93 | # ], 94 | # deps = [ 95 | # ":wangle", 96 | # "//third_party/gtest:gtest_main", 97 | # ] 98 | # ) 99 | 100 | cc_test( 101 | name = "concurrent_test", 102 | srcs = [ 103 | "upstream/wangle/concurrent/test/CodelTest.cpp", 104 | "upstream/wangle/concurrent/test/GlobalExecutorTest.cpp", 105 | "upstream/wangle/concurrent/test/ThreadPoolExecutorTest.cpp", 106 | ], 107 | deps = [ 108 | ":wangle", 109 | "//third_party/gtest:gtest_main", 110 | ] 111 | ) 112 | 113 | cc_library( 114 | name = "wangle", 115 | visibility = ["//visibility:public"], 116 | deps = [ 117 | ":acceptor", 118 | ":bootstrap", 119 | ":channel", 120 | ":concurrent", 121 | ":ssl", 122 | ] 123 | ) 124 | -------------------------------------------------------------------------------- /third_party/zlib/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) # BSD/MIT-like license (for zlib) 4 | 5 | cc_library( 6 | name = "zlib", 7 | srcs = [ 8 | "upstream/adler32.c", 9 | "upstream/compress.c", 10 | "upstream/crc32.c", 11 | "upstream/deflate.c", 12 | "upstream/gzclose.c", 13 | "upstream/gzlib.c", 14 | "upstream/gzread.c", 15 | "upstream/gzwrite.c", 16 | "upstream/infback.c", 17 | "upstream/inffast.c", 18 | "upstream/inflate.c", 19 | "upstream/inftrees.c", 20 | "upstream/trees.c", 21 | "upstream/uncompr.c", 22 | "upstream/zutil.c", 23 | ], 24 | hdrs = [ 25 | "upstream/crc32.h", 26 | "upstream/deflate.h", 27 | "upstream/gzguts.h", 28 | "upstream/inffast.h", 29 | "upstream/inffixed.h", 30 | "upstream/inflate.h", 31 | "upstream/inftrees.h", 32 | "upstream/trees.h", 33 | "upstream/zconf.h", 34 | "upstream/zlib.h", 35 | "upstream/zutil.h", 36 | ], 37 | copts = [ 38 | "-Wno-unused-variable", 39 | "-Wno-implicit-function-declaration", 40 | ], 41 | ) 42 | -------------------------------------------------------------------------------- /tools/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | # Used by Bazel. If a test program depends on this target, it is 4 | # assumed to be sharding-compliant. 5 | exports_files(["test_sharding_compliant"]) 6 | 7 | filegroup( 8 | name = "srcs", 9 | srcs = glob(["**"]) + [ 10 | "//tools/android:srcs", 11 | "//tools/android/jack:srcs", 12 | "//tools/jdk:srcs", 13 | "//tools/genrule:srcs", 14 | "//tools/cpp:srcs", 15 | "//tools/objc:srcs", 16 | "//tools/test:srcs", 17 | "//tools/python:srcs", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /tools/android/aar_generator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2014 Google Inc. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | exec ${TEST_SRCDIR-$0.runfiles}/src/tools/android/java/com/google/devtools/build/android/AarGeneratorAction "$@" 16 | -------------------------------------------------------------------------------- /tools/android/build_split_manifest_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Unit tests for stubify_application_manifest.""" 16 | 17 | import unittest 18 | from xml.etree import ElementTree 19 | 20 | from tools.android.build_split_manifest import BuildSplitManifest 21 | 22 | 23 | MAIN_MANIFEST = """ 24 | 29 | 30 | """ 31 | 32 | 33 | class BuildSplitManifestTest(unittest.TestCase): 34 | 35 | def testNoPackageOveride(self): 36 | split = BuildSplitManifest(MAIN_MANIFEST, None, "split", False) 37 | manifest = ElementTree.fromstring(split) 38 | self.assertEqual("com.google.package", 39 | manifest.get("package")) 40 | 41 | def testPackageOveride(self): 42 | split = BuildSplitManifest(MAIN_MANIFEST, "package.other", "split", False) 43 | manifest = ElementTree.fromstring(split) 44 | self.assertEqual("package.other", 45 | manifest.get("package")) 46 | 47 | def testSplitName(self): 48 | split = BuildSplitManifest(MAIN_MANIFEST, None, "my.little.splony", False) 49 | manifest = ElementTree.fromstring(split) 50 | self.assertEqual("my.little.splony", manifest.get("split")) 51 | 52 | 53 | if __name__ == "__main__": 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /tools/android/jack/BUILD: -------------------------------------------------------------------------------- 1 | # Stub tools for the upcoming Jack support in Bazel. 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | sh_binary( 6 | name = "jack", 7 | srcs = ["fail.sh"], 8 | ) 9 | 10 | filegroup( 11 | name = "android_jack", 12 | srcs = ["empty"], 13 | ) 14 | 15 | sh_binary( 16 | name = "jill", 17 | srcs = ["fail.sh"], 18 | ) 19 | 20 | sh_binary( 21 | name = "resource_extractor", 22 | srcs = ["fail.sh"], 23 | ) 24 | 25 | filegroup( 26 | name = "srcs", 27 | srcs = glob(["**"]), 28 | ) 29 | -------------------------------------------------------------------------------- /tools/android/jack/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bazelment/trunk/59a5322299b5e73e5252e4ddff6a75b055d3bfc9/tools/android/jack/empty -------------------------------------------------------------------------------- /tools/android/jack/fail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2015 Google Inc. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http:#www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | exit 1 16 | -------------------------------------------------------------------------------- /tools/android/proguard_whitelister.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Checks for proguard configuration rules that cannot be combined across libs. 16 | 17 | The only valid proguard arguments for a library are -keep, -assumenosideeffects, 18 | and -dontnote and -dontwarn and -checkdiscard when they are provided with 19 | arguments. 20 | """ 21 | 22 | import re 23 | import sys 24 | 25 | from third_party.py import gflags 26 | 27 | gflags.DEFINE_string('path', None, 'Path to the proguard config to validate') 28 | gflags.DEFINE_string('output', None, 'Where to put the validated config') 29 | 30 | FLAGS = gflags.FLAGS 31 | PROGUARD_COMMENTS_PATTERN = '#.*(\n|$)' 32 | 33 | 34 | def main(): 35 | with open(FLAGS.path) as config: 36 | config_string = config.read() 37 | invalid_configs = Validate(config_string) 38 | if invalid_configs: 39 | raise RuntimeError('Invalid proguard config parameters: ' 40 | + str(invalid_configs)) 41 | with open(FLAGS.output, 'w+') as outconfig: 42 | config_string = ('# Merged from %s \n' % FLAGS.path) + config_string 43 | outconfig.write(config_string) 44 | 45 | 46 | def Validate(config): 47 | """Checks the config for illegal arguments.""" 48 | config = re.sub(PROGUARD_COMMENTS_PATTERN, '', config) 49 | args = config.split('-') 50 | invalid_configs = [] 51 | for arg in args: 52 | arg = arg.strip() 53 | if not arg: 54 | continue 55 | elif arg.startswith('checkdiscard'): 56 | continue 57 | elif arg.startswith('keep'): 58 | continue 59 | elif arg.startswith('assumenosideeffects'): 60 | continue 61 | elif arg.split()[0] == 'dontnote': 62 | if len(arg.split()) > 1: 63 | continue 64 | elif arg.split()[0] == 'dontwarn': 65 | if len(arg.split()) > 1: 66 | continue 67 | invalid_configs.append('-' + arg.split()[0]) 68 | 69 | return invalid_configs 70 | 71 | if __name__ == '__main__': 72 | FLAGS(sys.argv) 73 | main() 74 | -------------------------------------------------------------------------------- /tools/android/proguard_whitelister_input.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Note: put any environment specific flags in their respective proguard files: 16 | # proguard_test.flags, proguard_dev.flags, proguard_release.flags, etc 17 | 18 | # These classes reference resources that don't exist in pre-v11 builds 19 | -dontwarn com.google.android.apps.testapp.TestActivity 20 | 21 | # References to a hidden class 22 | -dontnote android.os.SystemProperties 23 | -keep class android.os.SystemProperties { *** get(...);} 24 | 25 | # Keep all classes extended from com.google.android.apps.testapp.MyBaseClass 26 | # because, e.g., we use reflection. 27 | -keep class * extends com.google.android.apps.testapp.MyBaseClass { 28 | @com.google.android.apps.testapp.MyBaseClass$Inner ; 29 | } 30 | 31 | # Needed because this field is accessed reflectively, and it exists in generated code. 32 | -keepclassmembers class * extends com.google.protobuf.nano.MessageNano { 33 | *** apiHeader; 34 | } 35 | 36 | # Extensions are deserialized with a reflective call to newInstance(). 37 | -keepclassmembers class * extends com.google.protobuf.nano.Extension { 38 | (); 39 | } 40 | 41 | -dontnote android.support.v?.app.Fragment 42 | 43 | -keepnames class com.google.android.testapp.** extends com.google.android.testapp.resources.Resource { *; } 44 | 45 | -keepclasseswithmembers class derp.foo { bar;} -keepattributes * 46 | 47 | # This is a comment, so this should not cause problems -dontobfuscate 48 | # This is a comment, so # this should not cause problems -dontnote 49 | -------------------------------------------------------------------------------- /tools/android/proguard_whitelister_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | import unittest 17 | 18 | from tools.android import proguard_whitelister 19 | 20 | 21 | class ValidateProguardTest(unittest.TestCase): 22 | 23 | def testValidConfig(self): 24 | path = os.path.join( 25 | os.path.dirname(__file__), "proguard_whitelister_input.cfg") 26 | with open(path) as config: 27 | self.assertEqual([], proguard_whitelister.Validate(config.read())) 28 | 29 | def testInvalidNoteConfig(self): 30 | self.assertEqual(["-dontnote"], proguard_whitelister.Validate( 31 | """# We don't want libraries disabling notes globally. 32 | -dontnote 33 | """)) 34 | 35 | def testInvalidWarnConfig(self): 36 | self.assertEqual(["-dontwarn"], proguard_whitelister.Validate( 37 | """# We don't want libraries disabling warnings globally. 38 | -dontwarn 39 | """)) 40 | 41 | def testInvalidOptimizationConfig(self): 42 | self.assertEqual(["-optimizations"], proguard_whitelister.Validate( 43 | """#We don't want libraries disabling global optimizations. 44 | -optimizations !class/merging/*,!code/allocation/variable 45 | """)) 46 | 47 | def testMultipleInvalidArgs(self): 48 | self.assertEqual( 49 | ["-optimizations", "-dontnote"], proguard_whitelister.Validate( 50 | """#We don't want libraries disabling global optimizations. 51 | -optimizations !class/merging/*,!code/allocation/variable 52 | -dontnote 53 | """)) 54 | 55 | 56 | if __name__ == "__main__": 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /tools/android/resources_processor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2015 Google Inc. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | exec ${TEST_SRCDIR-$0.runfiles}/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction "$@" 16 | -------------------------------------------------------------------------------- /tools/android/strip_resources.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Removes the resources from a resource APK for incremental deployment. 16 | 17 | The reason this utility exists is that the only way we can build a binary 18 | AndroidManifest.xml is by invoking aapt, which builds a whole resource .apk. 19 | 20 | Thus, in order to build the AndroidManifest.xml for an incremental .apk, we 21 | invoke aapt, then extract AndroidManifest.xml from its output. 22 | """ 23 | 24 | import sys 25 | import zipfile 26 | 27 | from third_party.py import gflags 28 | 29 | 30 | gflags.DEFINE_string("input_resource_apk", None, "The input resource .apk") 31 | gflags.DEFINE_string("output_resource_apk", None, "The output resource .apk") 32 | 33 | FLAGS = gflags.FLAGS 34 | HERMETIC_TIMESTAMP = (2001, 1, 1, 0, 0, 0) 35 | 36 | 37 | def main(): 38 | with zipfile.ZipFile(FLAGS.input_resource_apk) as input_zip: 39 | with input_zip.open("AndroidManifest.xml") as android_manifest_entry: 40 | android_manifest = android_manifest_entry.read() 41 | 42 | with zipfile.ZipFile(FLAGS.output_resource_apk, "w") as output_zip: 43 | # Timestamp is explicitly set so that the resulting zip file is hermetic 44 | zipinfo = zipfile.ZipInfo( 45 | filename="AndroidManifest.xml", 46 | date_time=HERMETIC_TIMESTAMP) 47 | output_zip.writestr(zipinfo, android_manifest) 48 | 49 | 50 | if __name__ == "__main__": 51 | FLAGS(sys.argv) 52 | main() 53 | -------------------------------------------------------------------------------- /tools/bazel.rc: -------------------------------------------------------------------------------- 1 | build --workspace_status_command=tools/buildstamp/get_workspace_status 2 | 3 | # Address sanitizer 4 | # To use it: bazel build --config asan 5 | build:asan --crosstool_top //tools/lrte:toolchain 6 | build:asan --compiler clang 7 | build:asan --strip=never 8 | build:asan --copt -fsanitize=address 9 | build:asan --copt -DADDRESS_SANITIZER 10 | build:asan --copt -O1 11 | build:asan --copt -g 12 | build:asan --copt -fno-omit-frame-pointer 13 | build:asan --linkopt -fsanitize=address 14 | 15 | # Thread sanitizer 16 | # bazel build --config tsan 17 | build:tsan --crosstool_top //tools/lrte:toolchain 18 | build:tsan --compiler clang 19 | build:tsan --strip=never 20 | build:tsan --copt -fsanitize=thread 21 | build:tsan --copt -DTHREAD_SANITIZER 22 | build:tsan --copt -DDYNAMIC_ANNOTATIONS_ENABLED=1 23 | build:tsan --copt -DDYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1 24 | build:tsan --copt -O1 25 | build:tsan --copt -fno-omit-frame-pointer 26 | build:tsan --linkopt -fsanitize=thread 27 | 28 | # --config msan: Memory sanitizer 29 | build:msan --crosstool_top //tools/lrte:toolchain 30 | build:msan --compiler clang 31 | build:msan --strip=never 32 | build:msan --copt -fsanitize=memory 33 | build:msan --copt -DADDRESS_SANITIZER 34 | build:msan --copt -O1 35 | build:msan --copt -fno-omit-frame-pointer 36 | build:msan --linkopt -fsanitize=memory 37 | 38 | # --config ubsan: Undefined Behavior Sanitizer 39 | build:ubsan --crosstool_top //tools/lrte:toolchain 40 | build:ubsan --compiler clang 41 | build:ubsan --strip=never 42 | build:ubsan --copt -fsanitize=undefined 43 | build:ubsan --copt -O1 44 | build:ubsan --copt -fno-omit-frame-pointer 45 | build:ubsan --linkopt -fsanitize=undefined 46 | build:ubsan --linkopt -lubsan 47 | -------------------------------------------------------------------------------- /tools/build_rules/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//:__subpackages__"]) 2 | -------------------------------------------------------------------------------- /tools/build_rules/appengine/BUILD: -------------------------------------------------------------------------------- 1 | # A target to ensure the servlet-api is not linked in the webapp. 2 | java_library( 3 | name = "javax.servlet.api", 4 | neverlink = 1, 5 | visibility = ["//visibility:public"], 6 | exports = ["@javax-servlet-api//jar:jar"], 7 | ) 8 | -------------------------------------------------------------------------------- /tools/build_rules/appengine/appengine.BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # BUILD file to use the Java AppEngine SDK with a remote repository. 16 | java_import( 17 | name = "jars", 18 | jars = glob(["**/*.jar"]), 19 | visibility = ["//visibility:public"], 20 | ) 21 | 22 | java_import( 23 | name = "api", 24 | jars = ["appengine-java-sdk-1.9.23/lib/impl/appengine-api.jar"], 25 | visibility = ["//visibility:public"], 26 | neverlink = 1, 27 | ) 28 | 29 | filegroup( 30 | name = "sdk", 31 | srcs = glob(["appengine-java-sdk-1.9.23/**"]), 32 | visibility = ["//visibility:public"], 33 | path = "appengine-java-sdk-1.9.23", 34 | ) -------------------------------------------------------------------------------- /tools/build_rules/appengine/appengine.WORKSPACE: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # WORKSPACE file example to download Java AppEngine dependencies. 16 | new_http_archive( 17 | name = "appengine-java", 18 | url = "http://central.maven.org/maven2/com/google/appengine/appengine-java-sdk/1.9.23/appengine-java-sdk-1.9.23.zip", 19 | sha256 = "05e667036e9ef4f999b829fc08f8e5395b33a5a3c30afa9919213088db2b2e89", 20 | build_file = "tools/build_rules/appengine/appengine.BUILD", 21 | ) 22 | 23 | bind( 24 | name = "appengine/java/sdk", 25 | actual = "@appengine-java//:sdk", 26 | ) 27 | 28 | bind( 29 | name = "appengine/java/api", 30 | actual = "@appengine-java//:api", 31 | ) 32 | 33 | bind( 34 | name = "appengine/java/jars", 35 | actual = "@appengine-java//:jars", 36 | ) 37 | 38 | maven_jar( 39 | name = "javax-servlet-api", 40 | artifact = "javax.servlet:servlet-api:2.5", 41 | ) 42 | 43 | bind( 44 | name = "javax/servlet/api", 45 | actual = "//tools/build_rules/appengine:javax.servlet.api", 46 | ) 47 | -------------------------------------------------------------------------------- /tools/build_rules/boost.bzl: -------------------------------------------------------------------------------- 1 | includes_pattern = "upstream/%s/include" 2 | include_pattern1 = includes_pattern + "/boost/**/*.h" 3 | include_pattern2 = includes_pattern + "/boost/**/*pp" 4 | 5 | def includes_list( library_name ): 6 | return [ includes_pattern % library_name ] 7 | 8 | def hdr_list( library_name ): 9 | return native.glob([ 10 | include_pattern1 % library_name, 11 | include_pattern2 % library_name, 12 | ]) 13 | 14 | def boost_library( name, defines=None, includes=None, hdrs=None, srcs=None, deps=None, copts=None ): 15 | 16 | if defines == None: 17 | defines = [] 18 | 19 | if includes == None: 20 | includes = [] 21 | 22 | if hdrs == None: 23 | hdrs = [] 24 | 25 | if srcs == None: 26 | srcs = [] 27 | 28 | if deps == None: 29 | deps = [] 30 | 31 | if copts == None: 32 | copts = [] 33 | 34 | return native.cc_library( 35 | name = name, 36 | visibility = ["//visibility:public"], 37 | defines = defines, 38 | includes = includes_list(name) + includes, 39 | hdrs = hdr_list(name) + hdrs, 40 | srcs = [] + srcs, 41 | deps = deps, 42 | copts = copts, 43 | ) 44 | -------------------------------------------------------------------------------- /tools/build_rules/closure/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | java_binary( 16 | name = "closure_stylesheets", 17 | main_class = "com.google.common.css.compiler.commandline.ClosureCommandLineCompiler", 18 | visibility = ["//visibility:public"], 19 | runtime_deps = ["@closure_stylesheets//jar"], 20 | ) 21 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure.WORKSPACE: -------------------------------------------------------------------------------- 1 | new_http_archive( 2 | name = "closure_compiler", 3 | build_file = "tools/build_rules/closure/closure_compiler.BUILD", 4 | sha256 = "8e59c1996b8b114c60570f47f36168f111152f4ca9029562e971c987b2aee23a", 5 | url = "http://dl.google.com/closure-compiler/compiler-20150609.zip", 6 | ) 7 | 8 | http_jar( 9 | name = "closure_stylesheets", 10 | sha256 = "8b2ae8ec3733171ec0c2e6536566df0b3c6da3e59b4784993bc9e73125d29c82", 11 | url = "https://closure-stylesheets.googlecode.com/files/closure-stylesheets-20111230.jar", 12 | ) 13 | 14 | new_http_archive( 15 | name = "closure_templates", 16 | build_file = "tools/build_rules/closure/closure_templates.BUILD", 17 | sha256 = "72f87d71e1e9bf297fa6f8d9ec4e615c6e278c8e0ee37ac6e1eb625bb1806440", 18 | url = "https://closure-templates.googlecode.com/files/closure-templates-for-javascript-2012-12-21.zip", 19 | ) 20 | 21 | bind( 22 | name = "closure_compiler_", 23 | actual = "@closure_compiler//:closure_compiler", 24 | ) 25 | 26 | bind( 27 | name = "closure_templates_", 28 | actual = "@closure_templates//:closure_templates", 29 | ) 30 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_compiler.BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | java_import( 16 | name = "closure_compiler_jar", 17 | jars = ["compiler.jar"], 18 | ) 19 | 20 | java_binary( 21 | name = "closure_compiler", 22 | main_class = "com.google.javascript.jscomp.CommandLineRunner", 23 | visibility = ["//visibility:public"], 24 | runtime_deps = [":closure_compiler_jar"], 25 | ) 26 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_js_binary.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Build definitions for JavaScript binaries compiled with the Closure Compiler. 16 | 17 | A single file is produced with the _compiled.js suffix. 18 | 19 | By default, the name of the entry point is assumed to be the same as that of the 20 | build target. This behaviour may be overridden with the "main" attribute. 21 | 22 | The optimization level may be set with the "compilation_level" attribute. 23 | Supported values are: unobfuscated, simple, and advanced. 24 | 25 | Example: 26 | 27 | closure_js_binary( 28 | name = "hello", 29 | deps = [ 30 | ":hello_lib", 31 | "//third_party/javascript/closure_library", 32 | ], 33 | compilation_level = "simple", 34 | ) 35 | 36 | This rule will produce hello_combined.js. 37 | """ 38 | 39 | _COMPILATION_LEVELS = { 40 | "unobfuscated": [ 41 | "--compilation_level=WHITESPACE_ONLY", 42 | "--formatting=PRETTY_PRINT" 43 | ], 44 | "simple": ["--compilation_level=SIMPLE"], 45 | "advanced": ["--compilation_level=ADVANCED"] 46 | } 47 | 48 | def _impl(ctx): 49 | externs = set(order="compile") 50 | srcs = set(order="compile") 51 | for dep in ctx.attr.deps: 52 | externs += dep.transitive_js_externs 53 | srcs += dep.transitive_js_srcs 54 | 55 | args = [ 56 | "--closure_entry_point=%s" % ctx.attr.main, 57 | "--js_output_file=%s" % ctx.outputs.out.path, 58 | "--language_in=ECMASCRIPT5_STRICT", 59 | "--manage_closure_dependencies", 60 | "--warning_level=VERBOSE", 61 | ] + (["--js=%s" % src.path for src in srcs] + 62 | ["--externs=%s" % extern.path for extern in externs]) 63 | 64 | # Set the compilation level. 65 | if ctx.attr.compilation_level in _COMPILATION_LEVELS: 66 | args += _COMPILATION_LEVELS[ctx.attr.compilation_level] 67 | else: 68 | fail("Invalid compilation_level '%s', expected one of %s" % 69 | (ctx.attr.compilation_level, _COMPILATION_LEVELS.keys())) 70 | 71 | ctx.action( 72 | inputs=list(srcs), 73 | outputs=[ctx.outputs.out], 74 | arguments=args, 75 | executable=ctx.executable._closure_compiler) 76 | 77 | return struct(files=set([ctx.outputs.out])) 78 | 79 | closure_js_binary = rule( 80 | implementation=_impl, 81 | attrs={ 82 | "deps": attr.label_list( 83 | allow_files=False, 84 | providers=["transitive_js_externs", "transitive_js_srcs"]), 85 | "main": attr.string(default="%{name}"), 86 | "compilation_level": attr.string(default="advanced"), 87 | "_closure_compiler": attr.label( 88 | default=Label("//external:closure_compiler_"), 89 | executable=True), 90 | }, 91 | outputs={"out": "%{name}_combined.js"}) 92 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_js_library.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Build definitions for JavaScript libraries. The library targets may be used 16 | in closure_js_binary rules. 17 | 18 | Example: 19 | 20 | closure_js_library( 21 | name = "hello_lib", 22 | srcs = ["hello.js"], 23 | deps = ["//third_party/javascript/closure_library"], 24 | ) 25 | """ 26 | 27 | _JS_FILE_TYPE = FileType([".js"]) 28 | 29 | def _impl(ctx): 30 | externs = set(order="compile") 31 | srcs = set(order="compile") 32 | for dep in ctx.attr.deps: 33 | externs += dep.transitive_js_externs 34 | srcs += dep.transitive_js_srcs 35 | 36 | externs += _JS_FILE_TYPE.filter(ctx.files.externs) 37 | srcs += _JS_FILE_TYPE.filter(ctx.files.srcs) 38 | 39 | return struct( 40 | files=set(), transitive_js_externs=externs, transitive_js_srcs=srcs) 41 | 42 | closure_js_library = rule( 43 | implementation=_impl, 44 | attrs={ 45 | "externs": attr.label_list(allow_files=_JS_FILE_TYPE), 46 | "srcs": attr.label_list(allow_files=_JS_FILE_TYPE), 47 | "deps": attr.label_list( 48 | providers=["transitive_js_externs", "transitive_js_srcs"]) 49 | }) 50 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_library.BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | load("/tools/build_rules/closure/closure_js_library", "closure_js_library") 16 | load("/tools/build_rules/closure/closure_stylesheet_library", "closure_stylesheet_library") 17 | 18 | closure_js_library( 19 | name = "closure_library", 20 | srcs = glob( 21 | [ 22 | "closure/goog/**/*.js", 23 | "third_party/closure/goog/**/*.js", 24 | ], 25 | exclude = [ 26 | "closure/goog/**/*_test.js", 27 | "closure/goog/demos/**/*.js", 28 | ], 29 | ), 30 | visibility = ["//visibility:public"], 31 | ) 32 | 33 | closure_stylesheet_library( 34 | name = "closure_library_css", 35 | srcs = glob(["closure/goog/css/**/*.css"]), 36 | visibility = ["//visibility:public"], 37 | ) 38 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_stylesheet_library.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Build definitions for Closure stylesheets. Two files are produced: a minified 16 | and obfuscated CSS file and a JS file defining a map between CSS classes and the 17 | obfuscated class name. The stylesheet targets may be used in closure_js_binary 18 | rules. 19 | 20 | Both CSS and GSS files may be used with this rule. 21 | 22 | Example: 23 | 24 | closure_stylesheet_library( 25 | name = "hello_css", 26 | srcs = ["hello.gss"]. 27 | ) 28 | 29 | This rule will produce hello_css_combined.css and hello_css_renaming.js. 30 | """ 31 | 32 | _GSS_FILE_TYPE = FileType([".css", ".gss"]) 33 | 34 | def _impl(ctx): 35 | srcs = set(order="compile") 36 | for dep in ctx.attr.deps: 37 | srcs += dep.transitive_gss_srcs 38 | 39 | srcs += _GSS_FILE_TYPE.filter(ctx.files.srcs) 40 | 41 | args = [ 42 | "--output-file", 43 | ctx.outputs.out.path, 44 | "--output-renaming-map", 45 | ctx.outputs.out_renaming.path, 46 | "--output-renaming-map-format", 47 | "CLOSURE_COMPILED", 48 | "--rename", 49 | "CLOSURE" 50 | ] + [src.path for src in srcs] 51 | 52 | ctx.action( 53 | inputs=list(srcs), 54 | outputs=[ctx.outputs.out, ctx.outputs.out_renaming], 55 | arguments=args, 56 | executable=ctx.executable._closure_stylesheets) 57 | 58 | return struct( 59 | files=set([ctx.outputs.out]), 60 | transitive_gss_srcs=srcs, 61 | transitive_js_externs=set(), 62 | transitive_js_srcs=[ctx.outputs.out_renaming]) 63 | 64 | # There are two outputs: 65 | # - %{name}_combined.css: A minified and obfuscated CSS file. 66 | # - %{name}_renaming.js: A map from the original CSS class name to the 67 | # obfuscated name. This file is used by 68 | # closure_js_binary rules. 69 | closure_stylesheet_library = rule( 70 | implementation=_impl, 71 | attrs={ 72 | "srcs": attr.label_list(allow_files=_GSS_FILE_TYPE), 73 | "deps": attr.label_list( 74 | providers=["transitive_gss_srcs", "transitive_js_srcs"]), 75 | "_closure_stylesheets": attr.label( 76 | default=Label("//tools/build_rules/closure:closure_stylesheets"), 77 | executable=True), 78 | }, 79 | outputs={ 80 | "out": "%{name}_combined.css", 81 | "out_renaming": "%{name}_renaming.js" 82 | }) 83 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_template_library.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Build definitions for Closure templates. The template targets may be used in 16 | closure_js_binary rules. 17 | 18 | Example: 19 | 20 | closure_template_library( 21 | name = "hello_soy", 22 | srcs = ["hello.soy"], 23 | ) 24 | 25 | This rule will produce hello_soy.js. 26 | """ 27 | 28 | _SOY_FILE_TYPE = FileType([".soy"]) 29 | 30 | def _impl(ctx): 31 | srcs = ctx.files.srcs 32 | args = [ 33 | "--cssHandlingScheme", 34 | "goog", 35 | "--outputPathFormat", 36 | ctx.outputs.out.path, 37 | "--shouldGenerateJsdoc", 38 | "--shouldProvideRequireSoyNamespaces", 39 | "--srcs", 40 | ",".join([src.path for src in srcs]) 41 | ] 42 | 43 | ctx.action( 44 | inputs=list(srcs), 45 | outputs=[ctx.outputs.out], 46 | arguments=args, 47 | executable=ctx.executable._closure_templates) 48 | 49 | return struct( 50 | files=set(), transitive_js_externs=set(), 51 | transitive_js_srcs=set([ctx.outputs.out])) 52 | 53 | closure_template_library = rule( 54 | implementation=_impl, 55 | attrs={ 56 | "srcs": attr.label_list(allow_files=_SOY_FILE_TYPE), 57 | "_closure_templates": attr.label( 58 | default=Label("//external:closure_templates_"), 59 | executable=True), 60 | }, 61 | outputs={"out": "%{name}.js"}) 62 | -------------------------------------------------------------------------------- /tools/build_rules/closure/closure_templates.BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | load("/tools/build_rules/closure/closure_js_library", "closure_js_library") 16 | 17 | java_import( 18 | name = "closure_templates_jar", 19 | jars = ["SoyToJsSrcCompiler.jar"], 20 | ) 21 | 22 | java_binary( 23 | name = "closure_templates", 24 | main_class = "com.google.template.soy.SoyToJsSrcCompiler", 25 | visibility = ["//visibility:public"], 26 | runtime_deps = [":closure_templates_jar"], 27 | ) 28 | 29 | closure_js_library( 30 | name = "closure_templates_js", 31 | srcs = ["soyutils_usegoog.js"], 32 | visibility = ["//visibility:public"], 33 | ) 34 | -------------------------------------------------------------------------------- /tools/build_rules/genproto.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Google Inc. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # This is a quick and dirty rule to make Bazel compile itself. It 16 | # only supports Java. 17 | 18 | proto_filetype = FileType([".proto"]) 19 | 20 | def gensrcjar_impl(ctx): 21 | out = ctx.outputs.srcjar 22 | proto_output = out.path + ".proto_output" 23 | proto_compiler = ctx.file._proto_compiler 24 | sub_commands = [ 25 | "rm -rf " + proto_output, 26 | "mkdir " + proto_output, 27 | ' '.join([proto_compiler.path, "--java_out=" + proto_output, 28 | ctx.file.src.path]), 29 | "touch -t 198001010000 $(find " + proto_output + ")", 30 | ctx.file._jar.path + " cMf " + out.path + " -C " + proto_output + " .", 31 | ] 32 | 33 | ctx.action( 34 | command=" && ".join(sub_commands), 35 | inputs=[ctx.file.src, proto_compiler, ctx.file._jar], 36 | outputs=[out], 37 | mnemonic="GenProtoSrcJar", 38 | use_default_shell_env = True) 39 | 40 | gensrcjar = rule( 41 | gensrcjar_impl, 42 | attrs={ 43 | "src": attr.label(allow_files=proto_filetype, single_file=True), 44 | # TODO(bazel-team): this should be a hidden attribute with a default 45 | # value, but Skylark needs to support select first. 46 | "_proto_compiler": attr.label( 47 | default=Label("//third_party:protoc"), 48 | allow_files=True, 49 | single_file=True), 50 | "_jar": attr.label( 51 | default=Label("//external:jar"), 52 | allow_files=True, 53 | single_file=True), 54 | }, 55 | outputs={"srcjar": "lib%{name}.srcjar"}, 56 | ) 57 | 58 | # TODO(bazel-team): support proto => proto dependencies too 59 | def proto_java_library(name, src): 60 | gensrcjar(name=name + "_srcjar", src=src) 61 | native.java_library( 62 | name=name, 63 | srcs=[name + "_srcjar"], 64 | deps=["//third_party:protobuf"]) 65 | -------------------------------------------------------------------------------- /tools/build_rules/run_under.bzl: -------------------------------------------------------------------------------- 1 | # This file creates custom rules to make tests can easily run under 2 | # certain environment(like inside a docker). 3 | # 4 | # For example: 5 | # 6 | # run_under_test( 7 | # name = "test_under_docker", 8 | # under = "//tools/docker:zookeper", 9 | # command = "//sometest", 10 | # data = [ 11 | # ], 12 | # args = [ 13 | # "--gtest_filter=abc", 14 | # ] 15 | # ) 16 | # 17 | # This is almost equivalent to 18 | # bazel run --script_path "name" --run_under "under" "command" 19 | # 20 | # under: any build target that produces an executable binary, this is 21 | # the top level command to run, and it should take another executable 22 | # as command line flag to run as subprocess. 23 | # 24 | # command: any build target that produces an executable binary. 25 | # 26 | # data: list of files that need to be accessed when running the 27 | # "under" and the "command". 28 | def _run_under_impl(ctx): 29 | bin_dir = ctx.configuration.bin_dir 30 | build_directory = str(bin_dir)[:-len('[derived]')] + '/' 31 | under = ctx.executable.under 32 | under_args = ctx.attr.under_args 33 | command = ctx.executable.command 34 | exe = ctx.outputs.executable 35 | ctx.file_action(output=exe, 36 | content='''#!/bin/bash 37 | cd %s.runfiles && \\ 38 | exec %s %s \\ 39 | %s "$@" 40 | ''' % (build_directory + exe.short_path, 41 | build_directory + under.short_path, 42 | " ".join(under_args), 43 | build_directory + command.short_path)) 44 | # The $@ above will pass ctx.attr.args along to the command 45 | runfiles = [command, under] + ctx.files.data 46 | return struct( 47 | runfiles=ctx.runfiles( 48 | files=runfiles, 49 | collect_data=True, 50 | collect_default=True) 51 | ) 52 | 53 | 54 | run_under_attr = { 55 | "command": attr.label(mandatory=True, 56 | allow_files=True, 57 | cfg='target', 58 | executable=True), 59 | "under": attr.label(mandatory=True, 60 | allow_files=True, 61 | cfg='target', 62 | executable=True), 63 | # Arguments for the "under" command to setup the environment. 64 | "under_args": attr.string_list(), 65 | "data": attr.label_list(allow_files=True, 66 | cfg='target'), 67 | # bazel automatically implements "args": attr.string_list() 68 | # and passes them on invocation 69 | } 70 | 71 | run_under_binary = rule( 72 | _run_under_impl, 73 | attrs = run_under_attr, 74 | executable=True) 75 | 76 | run_under_test = rule( 77 | _run_under_impl, 78 | test = True, 79 | attrs = run_under_attr, 80 | executable=True) 81 | -------------------------------------------------------------------------------- /tools/buildstamp/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "all", 5 | srcs = [ 6 | "get_workspace_status", 7 | ], 8 | ) 9 | 10 | filegroup( 11 | name = "srcs", 12 | srcs = glob(["**"]), 13 | ) 14 | -------------------------------------------------------------------------------- /tools/buildstamp/get_workspace_status: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script will be run bazel when building process starts to 4 | # generate key-value information that represents the status of the 5 | # workspace. The output should be like 6 | # 7 | # KEY1 VALUE1 8 | # KEY2 VALUE2 9 | # 10 | # If the script exits with non-zero code, it's considered as a failure 11 | # and the output will be discarded. 12 | 13 | # The code below presents an implementation that works for git repository 14 | git_rev=$(git rev-parse HEAD) 15 | if [[ $? != 0 ]]; 16 | then 17 | exit 1 18 | fi 19 | echo "BUILD_SCM_REVISION ${git_rev}" 20 | 21 | # Check whether there are any uncommited changes 22 | git diff-index --quiet HEAD -- 23 | if [[ $? == 0 ]]; 24 | then 25 | tree_status="Clean" 26 | else 27 | tree_status="Modified" 28 | fi 29 | echo "BUILD_SCM_STATUS ${tree_status}" 30 | -------------------------------------------------------------------------------- /tools/cpp/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | # This can used to enable some conditional setting based on when 4 | # asan/msan/tsan/ubsan is used. 5 | config_setting( 6 | name = "asan_enabled", 7 | values = { 8 | "copt" : "-fsanitize=address", 9 | } 10 | ) 11 | 12 | config_setting( 13 | name = "msan_enabled", 14 | values = { 15 | "copt" : "-fsanitize=memory", 16 | } 17 | ) 18 | 19 | config_setting( 20 | name = "tsan_enabled", 21 | values = { 22 | "copt" : "-fsanitize=thread", 23 | } 24 | ) 25 | 26 | config_setting( 27 | name = "ubsan_enabled", 28 | values = { 29 | "copt" : "-fsanitize=undefined", 30 | } 31 | ) 32 | 33 | config_setting( 34 | name = "debug_enabled", 35 | values = { 36 | "compilation_mode": "dbg" 37 | } 38 | ) 39 | 40 | config_setting( 41 | name = "opt_enabled", 42 | values = { 43 | "compilation_mode": "opt" 44 | } 45 | ) 46 | 47 | # This can used to enable some conditional setting for ARM CPU 48 | config_setting( 49 | name = "arm", 50 | values = { 51 | "cpu": "arm", 52 | } 53 | ) 54 | 55 | # This can used to enable some conditional setting for X86 32 bit CPU 56 | config_setting( 57 | name = "x86_32", 58 | values = { 59 | "cpu": "piii", 60 | } 61 | ) 62 | -------------------------------------------------------------------------------- /tools/defaults/BUILD: -------------------------------------------------------------------------------- 1 | # At runtime, a package is synthesized in memory that corresponds 2 | # the command-line flag settings. 3 | -------------------------------------------------------------------------------- /tools/genrule/BUILD: -------------------------------------------------------------------------------- 1 | exports_files(["genrule-setup.sh"]) 2 | 3 | filegroup( 4 | name = "srcs", 5 | srcs = [ 6 | "BUILD", 7 | "genrule-setup.sh", 8 | ], 9 | visibility = ["//tools:__pkg__"], 10 | ) 11 | -------------------------------------------------------------------------------- /tools/genrule/genrule-setup.sh: -------------------------------------------------------------------------------- 1 | # exit immediately if a command or pipeline fails, unless it is in a test expression 2 | set -e 3 | 4 | # treat unset variables as errors 5 | set -u 6 | 7 | # exit code of a pipeline is 0, or the non-zero exit code of the rightmost failing command 8 | set -o pipefail 9 | -------------------------------------------------------------------------------- /tools/jdk/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "jni_header", 5 | srcs = ["//external:jni_header"], 6 | ) 7 | 8 | filegroup( 9 | name = "jni_md_header-darwin", 10 | srcs = ["//external:jni_md_header-darwin"], 11 | ) 12 | 13 | filegroup( 14 | name = "jni_md_header-linux", 15 | srcs = ["//external:jni_md_header-linux"], 16 | ) 17 | 18 | filegroup( 19 | name = "java", 20 | srcs = ["//external:java"], 21 | ) 22 | 23 | filegroup( 24 | name = "jar", 25 | srcs = ["//external:jar"], 26 | ) 27 | 28 | filegroup( 29 | name = "javac", 30 | srcs = ["//external:javac"], 31 | ) 32 | 33 | BOOTCLASS_JARS = [ 34 | "rt.jar", 35 | "resources.jar", 36 | "jsse.jar", 37 | "jce.jar", 38 | "charsets.jar", 39 | ] 40 | 41 | filegroup( 42 | name = "bootclasspath", 43 | srcs = ["//external:bootclasspath"], 44 | ) 45 | 46 | filegroup( 47 | name = "extdir", 48 | srcs = ["//external:extdir"], 49 | ) 50 | 51 | filegroup( 52 | name = "langtools", 53 | srcs = ["//third_party/java/jdk/langtools:javac_jar"], 54 | ) 55 | 56 | java_import( 57 | name = "langtools-neverlink", 58 | jars = [":langtools"], 59 | neverlink = 1, 60 | ) 61 | 62 | # This one is just needed because of how filegroup redirection works. 63 | filegroup(name = "jdk-null") 64 | 65 | filegroup( 66 | name = "jdk", 67 | srcs = [ 68 | ":jdk-null", 69 | "//external:jdk-default", 70 | ], 71 | ) 72 | 73 | java_toolchain( 74 | name = "toolchain", 75 | bootclasspath = [":bootclasspath"], 76 | encoding = "UTF-8", 77 | extclasspath = [":extdir"], 78 | genclass = ["//tools/jdk:GenClass_deploy.jar"], 79 | header_compiler = ["//tools/jdk:turbine_deploy.jar"], 80 | ijar = ["//tools/jdk:ijar"], 81 | javabuilder = ["//tools/jdk:JavaBuilder_deploy.jar"], 82 | javac = ["//third_party/java/jdk/langtools:javac_jar"], 83 | jvm_opts = [ 84 | "-XX:+TieredCompilation", 85 | "-XX:TieredStopAtLevel=1", 86 | ], 87 | singlejar = ["//tools/jdk:SingleJar_deploy.jar"], 88 | source_version = "7", 89 | target_version = "7", 90 | misc = [ 91 | "-extra_checks:off", 92 | ], 93 | ) 94 | 95 | filegroup( 96 | name = "ijar", 97 | srcs = [ 98 | "//third_party/ijar:ijar", 99 | ], 100 | ) 101 | 102 | exports_files([ 103 | "GenClass_deploy.jar", 104 | "JavaBuilder_deploy.jar", 105 | "SingleJar_deploy.jar", 106 | ]) 107 | 108 | filegroup( 109 | name = "srcs", 110 | srcs = ["BUILD"], # Tools are build from the workspace for tests. 111 | ) 112 | -------------------------------------------------------------------------------- /tools/lrte/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "empty", 5 | srcs = [], 6 | ) 7 | 8 | # This is the entry point for --crosstool_top. Toolchains are found 9 | # by lopping off the name of --crosstool_top and searching for 10 | # "cc-compiler-${CPU}" in this BUILD file, where CPU is the target CPU 11 | # specified in --cpu. 12 | # 13 | # This file group should include 14 | # * all cc_toolchain targets supported 15 | # * all file groups that said cc_toolchain might refer to, 16 | # including the default_grte_top setting in the CROSSTOOL 17 | # protobuf. 18 | 19 | cc_toolchain_suite( 20 | name = "toolchain", 21 | toolchains = { 22 | "local|compiler": ":cc-compiler-local", 23 | "k8|clang": ":cc-compiler-k8", 24 | "k8|gcc": ":cc-compiler-k8", 25 | }, 26 | ) 27 | 28 | # The crosstool is loaded by following --crosstool_top, loading the 29 | # definition inside CROSSTOOL proto file, and matched based on the 30 | # required settings, which are defined compiler, cpu, glibc version. 31 | 32 | # These rules defines filegroups, which contain files that will be 33 | # used by selected toolchain when it's compiling. The filegroup is 34 | # selected based as "cc-compiler-target-cpu" 35 | cc_toolchain( 36 | name = "cc-compiler-local", 37 | all_files = ":empty", 38 | compiler_files = ":empty", 39 | cpu = "local", 40 | dwp_files = ":empty", 41 | dynamic_runtime_libs = [":empty"], 42 | linker_files = ":empty", 43 | objcopy_files = ":empty", 44 | static_runtime_libs = [":empty"], 45 | strip_files = ":empty", 46 | # Instead parsing all compiler/linker options through command line, 47 | # enabling this option will make bazel write most of the options to 48 | # a param file, and invoke the toolchain with the param file, which 49 | # avoids potential issue when the list becomes longer than the 50 | # system limit. 51 | supports_param_files = 1, 52 | ) 53 | 54 | cc_toolchain( 55 | name = "cc-compiler-k8", 56 | all_files = ":empty", 57 | compiler_files = ":empty", 58 | cpu = "local", 59 | dwp_files = ":empty", 60 | dynamic_runtime_libs = [":empty"], 61 | linker_files = ":empty", 62 | objcopy_files = ":empty", 63 | static_runtime_libs = [":empty"], 64 | strip_files = ":empty", 65 | supports_param_files = 1, 66 | ) 67 | 68 | 69 | filegroup( 70 | name = "srcs", 71 | srcs = glob(["**"]), 72 | ) 73 | -------------------------------------------------------------------------------- /tools/objc/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | # Files which shouldn't be publicly visible and dependencies of all objc_* or ios_* rules shouldn't be in this package. 4 | exports_files(glob(["**"])) 5 | 6 | java_binary( 7 | name = "bundlemerge", 8 | main_class = "com.google.devtools.build.xcode.bundlemerge.BundleMerge", 9 | runtime_deps = [":bundlemerge_import"], 10 | ) 11 | 12 | java_import( 13 | name = "bundlemerge_import", 14 | jars = [":precomp_bundlemerge_deploy.jar"], 15 | ) 16 | 17 | java_binary( 18 | name = "plmerge", 19 | main_class = "com.google.devtools.build.xcode.plmerge.PlMerge", 20 | runtime_deps = [":plmerge_import"], 21 | ) 22 | 23 | java_import( 24 | name = "plmerge_import", 25 | jars = [":precomp_plmerge_deploy.jar"], 26 | ) 27 | 28 | java_binary( 29 | name = "xcodegen", 30 | main_class = "com.google.devtools.build.xcode.xcodegen.XcodeGen", 31 | runtime_deps = [":xcodegen_import"], 32 | ) 33 | 34 | java_import( 35 | name = "xcodegen_import", 36 | jars = [":precomp_xcodegen_deploy.jar"], 37 | ) 38 | 39 | filegroup( 40 | name = "srcs", 41 | srcs = glob(["**"]) + [ 42 | "//tools/objc/memleaks:srcs", 43 | "//tools/objc/sim_devices:BUILD", 44 | ], 45 | ) 46 | 47 | filegroup( 48 | name = "testrunner", 49 | srcs = [":testrunner_stub"], 50 | ) 51 | 52 | filegroup( 53 | name = "memleaks_plugin", 54 | srcs = [":memleaks_plugin_stub"], 55 | ) 56 | 57 | sh_binary( 58 | name = "ibtoolwrapper", 59 | srcs = [":ibtoolwrapper.sh"], 60 | data = [ 61 | ":realpath", 62 | ":xcrunwrapper", 63 | ], 64 | ) 65 | 66 | sh_binary( 67 | name = "actoolwrapper", 68 | srcs = [":actoolwrapper.sh"], 69 | data = [ 70 | ":realpath", 71 | ":xcrunwrapper", 72 | ], 73 | ) 74 | 75 | sh_binary( 76 | name = "momcwrapper", 77 | srcs = [":momcwrapper.sh"], 78 | data = [ 79 | ":realpath", 80 | ":xcrunwrapper", 81 | ], 82 | ) 83 | 84 | sh_binary( 85 | name = "swiftstdlibtoolwrapper", 86 | srcs = [":swiftstdlibtoolwrapper.sh"], 87 | data = [ 88 | ":realpath", 89 | ":xcrunwrapper", 90 | ], 91 | ) 92 | 93 | sh_binary( 94 | name = "xcrunwrapper", 95 | srcs = [":xcrunwrapper.sh"], 96 | ) 97 | 98 | xcode_config( 99 | name = "host_xcodes", 100 | ) 101 | 102 | # TODO(bazel-team): Open-source the script once J2ObjC support is open-sourced. 103 | py_library( 104 | name = "j2objc_dead_code_pruner", 105 | srcs = ["j2objc_dead_code_pruner.py"], 106 | ) 107 | -------------------------------------------------------------------------------- /tools/objc/dummy.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* 16 | * Include this file in a target if it requires some source but you don't have 17 | * any. 18 | * 19 | * ios_extension_binary rules only generate a static library Xcode target, and 20 | * the ios_extension will generate an actual bundling Xcode target. Application 21 | * and app extension targets need at least one source file for Xcode to be 22 | * happy, so we can add this file for them. 23 | */ 24 | 25 | static int dummy __attribute__((unused,used)) = 0; 26 | -------------------------------------------------------------------------------- /tools/objc/ios_runner.sh.mac_template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2015 The Bazel Authors. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -e 18 | 19 | if [[ "$(uname)" != Darwin ]]; then 20 | echo "Cannot run iOS targets on a non-mac machine." 21 | exit 1 22 | fi 23 | 24 | # Note: SDK_VERSION and SIM_DEVICE might contain spaces, but they are already 25 | # provided in quoted form in the template variables, so we should not quote them 26 | # again here. 27 | readonly SDK_VERSION=%sdk_version% 28 | readonly SIM_DEVICE=%sim_device% 29 | readonly APP_DIR=$(mktemp -d -t extracted_app) 30 | 31 | args=() 32 | # Pass environment variables prefixed with IOS_ to the simulator, stripping 33 | # the prefix. 34 | while read -r envvar; do 35 | if [[ "${envvar}" == IOS_* ]]; then 36 | args+=(-e "${envvar#IOS_}") 37 | fi 38 | done < <(env) 39 | 40 | unzip -qq '%ipa_file%' -d "${APP_DIR}" 41 | %iossim% -d "${SIM_DEVICE}" -s "${SDK_VERSION}" \ 42 | "${args[@]}" \ 43 | "${APP_DIR}/Payload/%app_name%.app" \ 44 | "$@" 45 | -------------------------------------------------------------------------------- /tools/objc/ios_test.sh.bazel_template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2015 The Bazel Authors. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -eu 18 | 19 | TEST_APP_DIR="$(mktemp -d -t test_app_dir)" 20 | unzip -qq -d "${TEST_APP_DIR}" "%(test_app_ipa)s" 21 | TEST_APP_DIR="${TEST_APP_DIR}/Payload/%(test_app_name)s.app" 22 | 23 | XCTEST_APP_DIR="$(mktemp -d -t xctest_app_dir)" 24 | unzip -qq -d "${XCTEST_APP_DIR}" "%(xctest_app_ipa)s" 25 | XCTEST_APP_DIR="${XCTEST_APP_DIR}/Payload/%(xctest_app_name)s.app" 26 | 27 | killall "iOS Simulator" >/dev/null 2>/dev/null || : 28 | 29 | SIMHOME="$(mktemp -d -t simhome)" 30 | 31 | LOGFILE="$(mktemp -t logfile)" 32 | 33 | SIMULATOR_PLATFORM="$(/usr/bin/xcrun --sdk iphonesimulator --show-sdk-platform-path)" 34 | SIMULATOR_DEV_LIBRARY="$SIMULATOR_PLATFORM/Developer/Library" 35 | 36 | "%(iossim_path)s" \ 37 | -u "${SIMHOME}" \ 38 | -d "%(device_type)s" \ 39 | -s "%(simulator_sdk)s" \ 40 | -t 60 \ 41 | -e DYLD_INSERT_LIBRARIES="$SIMULATOR_DEV_LIBRARY/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection" \ 42 | -e "XCInjectBundle=${TEST_APP_DIR}" \ 43 | -e "XCInjectBundleInto=${XCTEST_APP_DIR}" \ 44 | -e DYLD_FALLBACK_FRAMEWORK_PATH="$SIMULATOR_DEV_LIBRARY/Frameworks" \ 45 | "${XCTEST_APP_DIR}" \ 46 | -NSTreatUnknownArgumentsAsOpen NO \ 47 | -ApplePersistenceIgnoreState YES \ 48 | -XCTest All \ 49 | "${TEST_APP_DIR}" \ 50 | 2>&1 | tee "${LOGFILE}" 51 | 52 | killall "iOS Simulator" >/dev/null 2>/dev/null || : 53 | 54 | # TODO(danielwh): Much better support for detecting failures. Actually parse the log. 55 | if grep -q "with [1-9].* failure" "${LOGFILE}"; then 56 | exit 1 57 | fi 58 | -------------------------------------------------------------------------------- /tools/objc/memleaks/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "memleaks", 5 | srcs = [":memleaks_stub"], 6 | ) 7 | 8 | filegroup( 9 | name = "srcs", 10 | srcs = glob(["**"]), 11 | ) 12 | -------------------------------------------------------------------------------- /tools/objc/memleaks/memleaks_stub: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ( 4 | printf 'Bazel does not yet support memleaks detection for ios_tests.\n' 5 | ) >&2 6 | 7 | exit 1 8 | -------------------------------------------------------------------------------- /tools/objc/memleaks_plugin_stub: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ( 4 | printf 'Bazel does not yet support memleaks detection for ios_tests.\n' 5 | ) >&2 6 | 7 | exit 1 8 | -------------------------------------------------------------------------------- /tools/objc/sim_devices/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | ios_device( 4 | name = "default", 5 | ios_version = "8.4", 6 | type = "IPHONE", 7 | ) 8 | -------------------------------------------------------------------------------- /tools/objc/testrunner_stub: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ( 4 | printf 'Bazel does not support running ios_tests directly.\n' 5 | printf 'Use "bazel build (TARGET) to generate an .xcodeproj."\n' 6 | ) >&2 7 | 8 | exit 1 9 | -------------------------------------------------------------------------------- /tools/python/2to3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit 1 4 | -------------------------------------------------------------------------------- /tools/python/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | sh_binary( 4 | name = "2to3", 5 | srcs = ["2to3.sh"], 6 | ) 7 | 8 | sh_binary( 9 | name = "plink", 10 | srcs = ["plink_wrapper.sh"], 11 | data = [ 12 | "//third_party/plink:plink.py" 13 | ], 14 | ) 15 | 16 | filegroup( 17 | name = "srcs", 18 | srcs = [ 19 | # Tools are build from the workspace for tests. 20 | "2to3.sh", 21 | "BUILD", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /tools/python/plink_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | INTERPRETER=$(which $1) 3 | shift 4 | if [[ $(basename $INTERPRETER) == "python2" ]]; then 5 | PLINK=plink.py 6 | else 7 | PLINK=plink3.py 8 | fi 9 | exec $INTERPRETER third_pary/plink/$PLINK --python-binary "$INTERPRETER -ESs" $@ 10 | -------------------------------------------------------------------------------- /tools/test/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | # Members of this filegroup shouldn't have duplicate basenames, otherwise 4 | # TestRunnerAction#getRuntimeArtifact() will get confused. 5 | filegroup( 6 | name = "runtime", 7 | srcs = ["test-setup.sh"], 8 | ) 9 | 10 | filegroup( 11 | name = "coverage_support", 12 | srcs = [], 13 | ) 14 | 15 | filegroup( 16 | name = "coverage_report_generator", 17 | srcs = ["dummy_coverage_report_generator"], 18 | ) 19 | 20 | filegroup( 21 | name = "srcs", 22 | srcs = glob(["*"]), 23 | ) 24 | -------------------------------------------------------------------------------- /tools/test/dummy_coverage_report_generator: -------------------------------------------------------------------------------- 1 | # Dummy file. Bazel requires there to be a single file in the coverage report 2 | # generator attribute, even though it's currently not used in Bazel. 3 | -------------------------------------------------------------------------------- /tools/test_sharding_compliant: -------------------------------------------------------------------------------- 1 | Used by Bazel. It is just a file to have an explicit target that 2 | sharding-compliant targets can depend on. The content of this file 3 | does not matter. 4 | --------------------------------------------------------------------------------