diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 00000000..5ca85ce0 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,40 @@ +# build --remote_cache=http://bazelcache.inc.alipay.net + +# specify java version +build --java_language_version=8 +#build --java_runtime_version=localjdk +#build --tool_java_runtime_version=localjdk +#build --extra_toolchains=@local_jdk//:all +#build --java_toolchain=//:default_toolchain + +# specify javac options +build --javacopt="-Aproject=org.example/sparrow-cli -source 8 -target 8" + +# verbose test failed message +build --verbose_failures +build --test_output=errors + +# for c +build --repo_env=CC=clang --repo_env=CXX=clang++ +build --action_env=BAZEL_CXXOPTS="-std=gnu++17" +build --cxxopt=-std=gnu++17 --host_cxxopt=-std=gnu++17 +build --features=-default_link_flags + +# For linux-specific configurations +build --enable_platform_specific_config +build:linux --linkopt=-fuse-ld=gold --host_linkopt=-fuse-ld=gold + +# Links all targets in mostly static mode. If -static is set in linkopts, targets will change to fully static. +build --dynamic_mode=off + +# build with optimization enabled and with assert() calls disabled +build --compilation_mode opt + +# for js +build --strategy=Genrule=standalone + +# for go +# set GOPROXY +test --action_env=GOPROXY=https://goproxy.cn +build --action_env=GOPROXY=https://goproxy.cn +run --action_env=GOPROXY=https://goproxy.cn diff --git a/BUILD b/BUILD new file mode 100644 index 00000000..36a6b1bb --- /dev/null +++ b/BUILD @@ -0,0 +1,732 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") +load("@rules_pkg//pkg:tar.bzl", "pkg_tar") +load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files", "strip_prefix") + +# This rule is deprecated but useful to pack a directory from output of genrule +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", pkg_tar_old = "pkg_tar") +load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") +load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") +load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory") + +# By using select() in a configurable attribute, the attribute effectively adopts different values when different conditions hold. +config_setting( + name = "custom_build", + values = { + "define": "enable_swift_extractor=false", + }, +) + +# For convenience to use bazel run command (e.g. bazel run -- //:sparrow-cli-entrypoint database create) to execute sparrow-cli, +# so make this target as entrypoint for bazel run +genrule( + name = "sparrow-cli-entrypoint", + srcs = [":sparrow-cli"], + outs = ["dist/sparrow-cli/sparrow"], + cmd = """ + rm -rf $(RULEDIR)/dist + mkdir -p $(RULEDIR)/dist + tar -zxvf $(SRCS) -C $(RULEDIR)/dist + """, + executable = 1, +) + +# CLI executable +# Current pkg_tar/pkg_files rules can't pack a directory generated from genrule. +# To workaround this, use the deprecated pkg_tar rule instead +pkg_tar_old( + name = "sparrow-cli-pkg", + srcs = [ + "//cli:pyinstaller-sparrow-cli", + ], + mode = "0755", + package_dir = "cli", +) + +# Pack C family artifacts +# pkg_files( +# name = "coref-cfamily-lib-03-pkg", +# srcs = [ +# "//language/cfamily:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/cfamily", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-cfamily-lib-script-pkg", + srcs = [ + "//language/cfamily:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/cfamily", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +# Current pkg_tar/pkg_files rules can't pack a directory generated from genrule. +# To workaround this, use the deprecated pkg_tar rule instead +pkg_tar_old( + name = "coref-cfamily-src-extractor-pkg", + srcs = [ + "//:generate-coref-cfamily-src-extractor-library", + ], + mode = "0755", + package_dir = "language/cfamily/extractor", + strip_prefix = "coref-cfamily-src-extractor", +) + +# TODO Shoud not use this script to change rpath. Should put dylib during linking to have correct rpath. +genrule( + name = "generate-coref-cfamily-src-extractor-library", + srcs = [ + "//language/cfamily/extractor:coref-cfamily-src-extractor", + "//:tool/build-utils/pack_libs.py", + "//language/cfamily/extractor:copy-clang-builtin-headers", + ], + # Normally outs of genrule should be a list of files, not just a directory, but don't see another way to workaround this + outs = [ + "coref-cfamily-src-extractor", + ], + cmd = """ + mkdir -p $@/usr/bin + cp $(location //language/cfamily/extractor:coref-cfamily-src-extractor) $@/usr/bin + python3 $(location //:tool/build-utils/pack_libs.py) $@/usr + cp -r $(location //language/cfamily/extractor:copy-clang-builtin-headers) $@/usr/lib + """, +) + +# Pack Go artifacts +# pkg_files( +# name = "coref-go-lib-03-pkg", +# srcs = [ +# "//language/go:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/go", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +# pkg_files( +# name = "coref-go-lib-script-pkg", +# srcs = [ +# "//language/go:lib", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib/coref/go", +# strip_prefix = strip_prefix.from_pkg() + "lib", +# ) + +# pkg_files( +# name = "coref-go-src-extractor-pkg", +# srcs = [ +# "//language/go/extractor/src/cli/auto-builder:coref-go-src-extractor", +# "//language/go/extractor/src/cli/auto-builder:generate-go-sdk", +# ], +# attributes = pkg_attributes( +# mode = "0755", +# ), +# prefix = "language/go/extractor", +# ) + +# Pack Java artifacts +# pkg_files( +# name = "coref-java-lib-03-pkg", +# srcs = [ +# "//language/java:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/java", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-java-lib-script-pkg", + srcs = [ + "//language/java:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/java", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +pkg_files( + name = "coref-java-src-extractor-pkg", + srcs = [ + "//language/java/extractor:coref-java-src-extractor_deploy.jar", + ], + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "language/java/extractor", +) + +# Pack JavaScript artifacts +# pkg_files( +# name = "coref-javascript-lib-03-pkg", +# srcs = [ +# "//language/javascript:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/javascript", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-javascript-lib-script-pkg", + srcs = [ + "//language/javascript:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/javascript", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +pkg_files( + name = "coref-javascript-src-extractor-pkg", + srcs = [ + "//language/javascript/extractor:coref-javascript-src-extractor", + ], + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "language/javascript/extractor", +) + +# Pack Python artifacts +# pkg_files( +# name = "coref-python-lib-03-pkg", +# srcs = [ +# "//language/python:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/python", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-python-lib-script-pkg", + srcs = [ + "//language/python:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/python", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +pkg_files( + name = "coref-python-src-extractor-pkg", + srcs = [ + "//language/python/extractor:test1", + ], + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "language/python/extractor/", +) + +# Pack XML artifacts +# pkg_files( +# name = "coref-xml-lib-03-pkg", +# srcs = [ +# "//language/xml:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/xml", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-xml-lib-script-pkg", + srcs = [ + "//language/xml:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/xml", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +pkg_files( + name = "coref-xml-extractor-pkg", + srcs = [ + "//language/xml/extractor:coref-xml-extractor_deploy.jar", + ], + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "language/xml/extractor", +) + +# Pack Swift artifacts +# pkg_files( +# name = "coref-swift-lib-03-pkg", +# srcs = [ +# "//language/swift:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/swift", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +# pkg_files( +# name = "coref-swift-lib-script-pkg", +# srcs = [ +# "//language/swift:lib", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib/coref/swift", +# strip_prefix = strip_prefix.from_pkg() + "lib", +# ) + +# Pack SQL artifacts +# pkg_files( +# name = "coref-sql-lib-03-pkg", +# srcs = [ +# "//language/sql:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/sql", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-sql-lib-script-pkg", + srcs = [ + "//language/sql:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/sql", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +pkg_files( + name = "coref-sql-src-extractor-pkg", + srcs = [ + "//language/sql/extractor:coref-sql-src-extractor_deploy.jar", + ], + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "language/sql/extractor", +) + +# Pack Properties artifacts +# pkg_files( +# name = "coref-properties-lib-03-pkg", +# srcs = [ +# "//language/properties:lib-03", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib-03/coref/properties", +# strip_prefix = strip_prefix.from_pkg() + "lib-03", +# ) + +pkg_files( + name = "coref-properties-lib-script-pkg", + srcs = [ + "//language/properties:lib", + ], + attributes = pkg_attributes( + mode = "0644", + ), + prefix = "lib/coref/properties", + strip_prefix = strip_prefix.from_pkg() + "lib", +) + +pkg_files( + name = "coref-properties-extractor-pkg", + srcs = [ + "//language/properties/extractor:coref-properties-src-extractor_deploy.jar", + ], + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "language/properties/extractor", +) + +# Pack ArkTs artifacts +# pkg_files( +# name = "coref-arkts-lib-script-pkg", +# srcs = [ +# "//language/arkts:lib", +# ], +# attributes = pkg_attributes( +# mode = "0644", +# ), +# prefix = "lib/coref/arkts", +# strip_prefix = strip_prefix.from_pkg() + "lib", +# ) + +# pkg_files( +# name = "coref-arkts-src-extractor-pkg", +# srcs = [ +# "//language/arkts/extractor:coref-arkts-src-extractor", +# ], +# attributes = pkg_attributes( +# mode = "0755", +# ), +# prefix = "language/arkts/extractor", +# ) + +# Current pkg_tar/pkg_files rules can't pack a directory generated from genrule. +# To workaround this, use the deprecated pkg_tar rule instead +# pkg_tar_old( +# name = "coref-swift-src-extractor-pkg", +# srcs = [ +# "//:generate-coref-swift-src-extractor-library", +# ], +# mode = "0755", +# package_dir = "language/swift/extractor", +# strip_prefix = "coref-swift-src-extractor", +# ) + +# TODO Shoud not use this script to change rpath. Should put dylib during linking to have correct rpath. +# genrule( +# name = "generate-coref-swift-src-extractor-library", +# srcs = [ +# "//language/swift/extractor:coref-swift-src-extractor", +# "//:tool/build-utils/pack_libs.py", +# ], +# # Normally outs of genrule should be a list of files, not just a directory, but don't see another way to workaround this +# outs = [ +# "coref-swift-src-extractor", +# ], +# cmd = """ +# mkdir -p $@/usr/bin +# cp $(location //language/swift/extractor:coref-swift-src-extractor) $@/usr/bin +# python3 $(location //:tool/build-utils/pack_libs.py) $@/usr +# """, +# ) + +# Pack Godel 0.3 & script artifacts +# pkg_files( +# name = "godel-0.3-pkg", +# srcs = select({ +# "@bazel_tools//src/conditions:darwin": ["@osx_godel_0.3//:all"], +# "//conditions:default": ["@linux_godel_0.3//:all"], +# }), +# attributes = pkg_attributes( +# mode = "0755", +# ), +# prefix = "godel-0.3", +# strip_prefix = strip_prefix.from_pkg(), +# ) + +pkg_files( + name = "godel-script-pkg", + srcs = select({ + "@bazel_tools//src/conditions:darwin": ["@osx_godel_script//:all"], + "//conditions:default": ["@linux_godel_script//:all"], + }), + attributes = pkg_attributes( + mode = "0755", + ), + prefix = "godel-script", + strip_prefix = strip_prefix.from_pkg(), +) + +# copy file to sparrowHome, for local debug +copy_to_bin( + name = "copy-version-file", + srcs = [ + "version.txt", + ], + visibility = ["//visibility:public"], +) + + +# copy_to_directory( +# name = "copy-godel-0.3-lib", +# srcs = [ +# "//language/cfamily:lib-03", +# "//language/go:lib-03", +# "//language/java:lib-03", +# "//language/javascript:lib-03", +# "//language/properties:lib-03", +# "//language/python:lib-03", +# "//language/sql:lib-03", +# "//language/xml:lib-03", +# ], +# out = "lib-03", +# visibility = ["//visibility:public"], +# ) + +# coref_lib_03_pkgs = [ +# ":coref-cfamily-lib-03-pkg", +# ":coref-go-lib-03-pkg", +# ":coref-sql-lib-03-pkg", +# ":coref-java-lib-03-pkg", +# ":coref-javascript-lib-03-pkg", +# ":coref-python-lib-03-pkg", +# ":coref-xml-lib-03-pkg", +# ":coref-properties-lib-03-pkg", +# ] + select({ +# ":custom_build": [], +# "//conditions:default": [":coref-swift-lib-03-pkg"], +# }) + +coref_lib_script_pkgs = [ + # ":coref-go-lib-script-pkg", + ":coref-java-lib-script-pkg", + ":coref-javascript-lib-script-pkg", + ":coref-python-lib-script-pkg", + ":coref-xml-lib-script-pkg", + ":coref-cfamily-lib-script-pkg", + ":coref-properties-lib-script-pkg", + ":coref-sql-lib-script-pkg", + # ":coref-arkts-lib-script-pkg", +] + select({ + ":custom_build": [], + "//conditions:default": [":coref-swift-lib-script-pkg"], +}) + +coref_libscript_languages = [ + "java", + "javascript", + # "go", + "python", + "xml", + "cfamily", + "properties", + "sql", + # "swift", + # "arkts", +] + +copy_to_directory( + name = "copy-godel-script", + srcs = select({ + "@bazel_tools//src/conditions:darwin": ["@osx_godel_script//:all"], + "//conditions:default": ["@linux_godel_script//:all"], + }), + out = "godel-script", + include_external_repositories = [ + "osx_godel_script", + "linux_godel_script", + ], + visibility = ["//visibility:public"], +) + +copy_to_directory( + name = "copy-java-lib-script", + srcs = [ + "//language/java:lib", + ], + out = "lib/coref/java", + replace_prefixes = {"language/java/lib": ""}, + visibility = ["//visibility:public"], +) + +copy_to_directory( + name = "copy-javascript-lib-script", + srcs = [ + "//language/javascript:lib", + ], + out = "lib/coref/javascript", + replace_prefixes = {"language/javascript/lib": ""}, + visibility = ["//visibility:public"], +) + +# copy_to_directory( +# name = "copy-go-lib-script", +# srcs = [ +# "//language/go:lib", +# ], +# out = "lib/coref/go", +# replace_prefixes = {"language/go/lib": ""}, +# visibility = ["//visibility:public"], +# ) + +copy_to_directory( + name = "copy-python-lib-script", + srcs = [ + "//language/python:lib", + ], + out = "lib/coref/python", + replace_prefixes = {"language/python/lib": ""}, + visibility = ["//visibility:public"], +) + +copy_to_directory( + name = "copy-xml-lib-script", + srcs = [ + "//language/xml:lib", + ], + out = "lib/coref/xml", + replace_prefixes = {"language/xml/lib": ""}, + visibility = ["//visibility:public"], +) + +copy_to_directory( + name = "copy-properties-lib-script", + srcs = [ + "//language/properties:lib", + ], + out = "lib/coref/properties", + replace_prefixes = {"language/properties/lib": ""}, + visibility = ["//visibility:public"], +) + +copy_to_directory( + name = "copy-sql-lib-script", + srcs = [ + "//language/sql:lib", + ], + out = "lib/coref/sql", + replace_prefixes = {"language/sql/lib": ""}, + visibility = ["//visibility:public"], +) + +copy_to_directory( + name = "copy-cfamily-lib-script", + srcs = [ + "//language/cfamily:lib", + ], + out = "lib/coref/cfamily", + replace_prefixes = {"language/cfamily/lib": ""}, + visibility = ["//visibility:public"], +) + +# copy_to_directory( +# name = "copy-swift-lib-script", +# srcs = [ +# "//language/swift:lib", +# ], +# out = "lib/coref/swift", +# replace_prefixes = {"language/swift/lib": ""}, +# visibility = ["//visibility:public"], +# ) + +# copy_to_directory( +# name = "copy-arkts-lib-script", +# srcs = [ +# "//language/arkts:lib", +# ], +# out = "lib/coref/arkts", +# replace_prefixes = {"language/arkts/lib": ""}, +# visibility = ["//visibility:public"], +# ) + +genrule( + name = "coref-lib-script-gen", + srcs = [ + "//cli:pyinstaller-sparrow-cli", + ":copy-godel-script", + ":copy-java-lib-script", + ":copy-javascript-lib-script", + # ":copy-go-lib-script", + ":copy-python-lib-script", + ":copy-xml-lib-script", + ":copy-properties-lib-script", + ":copy-sql-lib-script", + ":copy-cfamily-lib-script", + # ":copy-swift-lib-script", + # ":copy-arkts-lib-script", + ], + outs = ["lib/coref/%s.gdl" % language for language in coref_libscript_languages], + cmd = """ + string="$(locations //cli:pyinstaller-sparrow-cli)" + # Remove everything before the last space character + result="$${string##* }" + echo "$$result" + $$result --sparrow-cli-internal $(@D) rebuild lib -lang all + """, + local = True, + visibility = ["//visibility:public"], +) + +pkg_files( + name = "coref-lib-pkg", + srcs = [ + ":coref-lib-script-gen", + ], + attributes = pkg_attributes( + mode = "0644", + ), + strip_prefix = strip_prefix.from_pkg(), +) + +# Pack final sparrow-cli package +pkg_tar( + name = "sparrow-cli", + srcs = [ + ":coref-lib-pkg", + # ":coref-arkts-src-extractor-pkg", + # ":coref-go-src-extractor-pkg", + ":coref-sql-src-extractor-pkg", + ":coref-java-src-extractor-pkg", + ":coref-javascript-src-extractor-pkg", + ":coref-python-src-extractor-pkg", + ":coref-xml-extractor-pkg", + ":coref-properties-extractor-pkg", + # ":godel-0.3-pkg", + ":godel-script-pkg", + "//cli:sparrow", + "version.txt", + ] + coref_lib_script_pkgs, + extension = "tar.gz", + mode = "0755", + package_dir = "sparrow-cli", + strip_prefix = strip_prefix.from_pkg(), + visibility = ["//visibility:public"], + deps = [ + ":sparrow-cli-pkg", + ":coref-cfamily-src-extractor-pkg", + ] + select({ + ":custom_build": [], + "//conditions:default": [":coref-swift-src-extractor-pkg"], + }), +) + +# buildifier( +# name = "buildifier", +# ) + +# load("@bazel_gazelle//:def.bzl", "gazelle") + +# # gazelle:prefix alipay.com/code_insight/coref-go-extractor +# gazelle(name = "gazelle") + +# gazelle( +# name = "gazelle-update-repos", +# args = [ +# "-from_file=language/go/extractor/go.mod", +# "-to_macro=deps.bzl%go_dependencies", +# "-prune", +# "-build_file_proto_mode=disable_global", +# ], +# command = "update-repos", +# ) \ No newline at end of file diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 00000000..8059d2de --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,548 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") +load("//:junit5.bzl", "junit_jupiter_java_repositories", "junit_platform_java_repositories") + +### c dependencies + +# SQLITE_VERSION "3.39.0" +SQLITE_BAZEL_COMMIT = "57ff3012abd4c832b40148aeb6ec1d5d0b4cc3f7" + +SQLITE_BAZEL_SHA = "95d9872a38f9162e0138de8b38b124af250b38719c5380f0ee863ad306d70573" + +http_archive( + name = "com_github_rockwotj_sqlite_bazel", + sha256 = SQLITE_BAZEL_SHA, + strip_prefix = "sqlite-bazel-" + SQLITE_BAZEL_COMMIT, + urls = ["https://github.com/rockwotj/sqlite-bazel/archive/%s.zip" % SQLITE_BAZEL_COMMIT], +) + +# LLVM +SKYLIB_VERSION = "1.3.0" + +http_archive( + name = "bazel_skylib", + sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION), + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION), + "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION), + ], +) + +# LLVM 13.0.1 Release +# Replace with the LLVM commit you want to use. +LLVM_COMMIT = "75e33f71c2dae584b13a7d1186ae0a038ba98838" + +# The easiest way to calculate this for a new commit is to set it to empty and +# then run a bazel build and it will report the digest necessary to cache the +# archive and make the build reproducible. +LLVM_SHA256 = "9e2ef2fac7525a77220742a3384cafe7a35adc7e5c9750378b2cf25c2d2933f5" + +http_archive( + name = "llvm-raw", + build_file_content = "# empty", + sha256 = LLVM_SHA256, + strip_prefix = "llvm-project-" + LLVM_COMMIT, + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/llvm/{commit}.tar.gz".format(commit = LLVM_COMMIT), + "https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT), + ], +) + +http_archive( + name = "llvm-bazel", + sha256 = LLVM_SHA256, + strip_prefix = "llvm-project-{}/utils/bazel".format(LLVM_COMMIT), + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/llvm/{commit}.tar.gz".format(commit = LLVM_COMMIT), + "https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT), + ], +) + +load("@llvm-bazel//:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps") + +llvm_configure( + name = "llvm-project", + src_path = ".", + src_workspace = "@llvm-raw//:WORKSPACE", + targets = ["X86"], +) + +# Disables optional dependencies for Support like zlib and terminfo. You may +# instead want to configure them using the macros in the corresponding bzl +# files. +llvm_disable_optional_support_deps() + +### java dependencies +RULES_JVM_EXTERNAL_TAG = "4.2" + +RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" + +JUNIT_JUPITER_VERSION = "5.9.1" + +JUNIT_PLATFORM_VERSION = "1.9.1" + +junit_jupiter_java_repositories( + version = JUNIT_JUPITER_VERSION, +) + +junit_platform_java_repositories( + version = JUNIT_PLATFORM_VERSION, +) + +http_archive( + name = "rules_jvm_external", + sha256 = RULES_JVM_EXTERNAL_SHA, + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, + patches = ["//external/rules_jvm_external:versions.bzl.patch"], +) + +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") + +rules_jvm_external_deps() + +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") + +rules_jvm_external_setup() + +load("@rules_jvm_external//:defs.bzl", "maven_install") + +maven_install( + artifacts = [ + "info.picocli:picocli-codegen:4.6.1", + "org.apache.commons:commons-compress:1.21", + "org.apache.commons:commons-lang3:3.12.0", + "commons-io:commons-io:2.8.0", + "commons-lang:commons-lang:2.4", + "org.slf4j:slf4j-api:1.7.21", + "org.slf4j:slf4j-log4j12:1.7.21", + "org.projectlombok:lombok:1.18.16", + "com.aliyun.oss:aliyun-sdk-oss:3.10.2", + "com.alibaba:fastjson:1.2.72_noneautotype", + "com.contrastsecurity:java-sarif:2.0", + "com.fasterxml.jackson.core:jackson-core:2.13.4", + "com.fasterxml.jackson.core:jackson-databind:2.13.4", + "com.fasterxml.jackson.core:jackson-annotations:2.13.4", + "org.powermock:powermock-module-junit4:2.0.9", + "org.powermock:powermock-api-mockito2:2.0.9", + "org.mybatis:mybatis:3.5.7", + "org.mybatis.dynamic-sql:mybatis-dynamic-sql:1.3.0", + "org.mybatis.generator:mybatis-generator-core:1.4.0", + "javax.annotation:javax.annotation-api:1.3.2", + "commons-codec:commons-codec:1.15", + "com.ibm.icu:icu4j:59.1", + "me.tongfei:progressbar:0.9.2", + "org.jetbrains:annotations:22.0.0", + "org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.21", + "org.jetbrains.kotlin:kotlin-reflect:1.5.21", + "org.jetbrains.kotlin:kotlin-script-runtime:1.5.21", + "org.jetbrains.kotlin:kotlin-stdlib:1.5.21", + "uk.com.robust-it:cloning:1.9.12", + "com.google.code.gson:gson:2.8.9", + "com.google.guava:guava:30.1.1-jre", + "org.hamcrest:hamcrest-all:1.3", + "com.google.re2j:re2j:1.6", + "net.java.dev.jna:jna:4.1.0", + "org.xerial:sqlite-jdbc:3.41.2.2", + "tk.mybatis:mapper:4.1.5", + "org.apache.logging.log4j:log4j-core:2.17.1", + "org.apache.logging.log4j:log4j-api:2.17.1", + "org.apache.logging.log4j:log4j-slf4j-impl:2.17.1", + "stax:stax-api:1.0.1", + "javax.persistence:javax.persistence-api:2.2", + "org.codehaus.woodstox:stax2-api:4.2.1", + "commons-collections:commons-collections:3.2.2", + "com.aliyun.oss:aliyun-sdk-oss:3.10.2", + "org.ini4j:ini4j:0.5.4", + "org.benf:cfr:0.151", + "org.jd:jd-core:1.1.3", + "com.alibaba:druid:1.2.12", + "net.java.dev.msv:msv-core:2013.6.1", + "net.java.dev.msv:xsdlib:2013.6.1", + "relaxngDatatype:relaxngDatatype:20020414", + "org.osgi:osgi.core:5.0.0", + "biz.aQute.bnd:biz.aQute.bnd.annotation:6.3.1", + "org.codehaus.jettison:jettison:1.5.4", + "org.jetbrains:intellij-fernflower:1.2.1.16", + ], + repositories = [ + # Private repositories are supported through HTTP Basic auth + "http://mvn.dev.alipay.net/artifactory/content/groups/public/", + "http://mvn.test.alipay.net/artifactory/content/groups/public", + ], +) + +### js dependencies +http_archive( + name = "build_bazel_rules_nodejs", + sha256 = "ee3280a7f58aa5c1caa45cb9e08cbb8f4d74300848c508374daf37314d5390d6", + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/rules_nodejs-5.5.1.tar.gz", + "https://github.com/bazelbuild/rules_nodejs/releases/download/5.5.1/rules_nodejs-5.5.1.tar.gz", + ], +) + +load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") + +build_bazel_rules_nodejs_dependencies() + +# fetches nodejs and yarn +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install", "yarn_install") + +node_repositories( + node_urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/node/v{version}/{filename}", + "https://nodejs.org/dist/v{version}/{filename}", + ], + node_version = "16.14.2", + yarn_releases = { + "1.22.11": ("yarn-v1.22.11.tar.gz", "yarn-v1.22.11", "2c320de14a6014f62d29c34fec78fdbb0bc71c9ccba48ed0668de452c1f5fe6c"), + }, + # yarn repository info + yarn_repository_name = "yarn", + yarn_urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/yarn/v{version}/{filename}", + "https://github.com/yarnpkg/yarn/releases/download/v{version}/{filename}", + ], + yarn_version = "1.22.11", +) + +yarn_install( + name = "npm", + package_json = "//language/javascript/extractor:package.json", + symlink_node_modules = True, + use_global_yarn_cache = False, + yarn_lock = "//language/javascript/extractor:yarn.lock", +) + +http_archive( + name = "pkg_cache", + build_file = "//:tool/build_rule/pkg_cache.BUILD", + sha256 = "ee392cf2bfe0d0a5a493e073651fb70b03503dfe98e347ed61b91e9ef9ada122", + url = "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/pkg-cache.tar.gz", +) + +http_archive( + name = "osx_godel_0.3", + build_file = "godel.BUILD", + sha256 = "1e7e0151f1acd1656f4079b7b16dfa4e5da607a1239149a88e9df3b543b23c30", + urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/osx-godel/godel-multipleinput-20221115.tar.gz"], +) + +http_archive( + name = "linux_godel_0.3", + build_file = "godel.BUILD", + sha256 = "4dbc04677b9c785a00c127228368919ba6cee2a1f160e83e497d44fb4820dcd3", + urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/linux-godel/godel-multipleinput-20221115.tar.gz"], +) + +http_archive( + name = "osx_godel_script", + build_file = "godel.BUILD", + sha256 = "4c4189320523ca63d9fb50e37aa0bcbd452109011a8d669d878b91492168e4e0", + urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/godel-script/osx/godel-script-osx-2ac5184520240812.tar.gz"], +) + +http_archive( + name = "linux_godel_script", + build_file = "godel.BUILD", + sha256 = "ac7c0d62b02cb3d7c673dac0c69079e347f727232a56053402ebbab655fd5649", + urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/godel-script/linux/godel-script-linux-2ac5184520240812.tar.gz"], +) + +# Setting up for bazel go dependency +http_archive( + name = "io_bazel_rules_go", + sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f", + urls = [ + "http://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/rules_go-v0.29.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip", + ], +) + +http_archive( + name = "bazel_gazelle", + sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f", + urls = [ + "http://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/bazel-gazelle-v0.23.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz", + ], +) + +load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies") +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +load("//:deps.bzl", "go_dependencies") + +# gazelle:repository_macro deps.bzl%go_dependencies +go_dependencies() + +go_rules_dependencies() + +# fetch golang package from oss with first priority. +go_download_sdk( + name = "go_sdk", + sdks = { + # Avoid the dependency on the index file for the SHA-256 checksums. + # Filenames and checksums from https://go.dev/dl/ + "linux_amd64": ("go1.18.3.linux-amd64.tar.gz", "956f8507b302ab0bb747613695cdae10af99bbd39a90cae522b7c0302cc27245"), + "darwin_amd64": ("go1.18.3.darwin-amd64.tar.gz", "d9dcf8fc35da54c6f259be41954783a9f4984945a855d03a003a7fd6ea4c5ca1"), + "darwin_arm64": ("go1.18.3.darwin-arm64.tar.gz", "40ecd383c941cc9f0682e6a6f2a333539d58c7dea15c842434d03afafe2f7242"), + }, + urls = [ + "http://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/golang/{}", + "https://dl.google.com/go/{}", + ], + version = "1.18.3", +) + +go_register_toolchains() + +# If you use WORKSPACE.bazel, use the following line instead of the bare gazelle_dependencies(): +# gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel") +gazelle_dependencies() + +http_archive( + name = "com_google_protobuf", + sha256 = "3bd7828aa5af4b13b99c191e8b1e884ebfa9ad371b0ce264605d347f135d2568", + strip_prefix = "protobuf-3.19.4", + urls = [ + "http://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/protobuf-3.19.4.tar.gz", + "https://github.com/protocolbuffers/protobuf/archive/v3.19.4.tar.gz", + ], +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + +http_archive( + name = "com_github_bazelbuild_buildtools", + sha256 = "ae34c344514e08c23e90da0e2d6cb700fcd28e80c02e23e4d5715dddcb42f7b3", + strip_prefix = "buildtools-4.2.2", + urls = [ + "http://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/buildtools-4.2.2.tar.gz", + "https://github.com/bazelbuild/buildtools/archive/refs/tags/4.2.2.tar.gz", + ], +) + +http_archive( + name = "rules_python", + sha256 = "a3a6e99f497be089f81ec082882e40246bfd435f52f4e82f37e89449b04573f6", + strip_prefix = "rules_python-0.10.2", + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/rules_python-0.10.2.tar.gz", + "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.10.2.tar.gz", + ], + patches = ["//external/rules_python:repositories.bzl.patch"], +) + +load("@rules_python//python:repositories.bzl", "python_register_toolchains") + +python_register_toolchains( + name = "python3_10", + base_url = "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/cpython", + # Available versions are listed in @rules_python//python:versions.bzl. + # We recommend using the same version your team is already standardized on. + python_version = "3.10.4", + tool_versions = { + "3.10.4": { + "url": "20220502/cpython-{python_version}%2B20220502-{platform}-{build}.tar.gz", + "sha256": { + "aarch64-apple-darwin": "2c99983d1e83e4b6e7411ed9334019f193fba626344a50c36fba6c25d4de78a2", + "aarch64-unknown-linux-gnu": "d8098c0c54546637e7516f93b13403b11f9db285def8d7abd825c31407a13d7e", + "x86_64-apple-darwin": "f2711eaffff3477826a401d09a013c6802f11c04c63ab3686aa72664f1216a05", + "x86_64-pc-windows-msvc": "bee24a3a5c83325215521d261d73a5207ab7060ef3481f76f69b4366744eb81d", + "x86_64-unknown-linux-gnu": "f6f871e53a7b1469c13f9bd7920ad98c4589e549acad8e5a1e14760fff3dd5c9", + }, + "strip_prefix": "python", + }, + }, +) + +load("@python3_10//:defs.bzl", "interpreter") +load("@rules_python//python:pip.bzl", "pip_install") + +# Create a central external repo, @deps, that contains Bazel targets for all the +# third-party packages specified in the requirements.txt file. +pip_install( + name = "deps", + python_interpreter_target = interpreter, + requirements = "//language/python/extractor:requirements.txt", +) + +pip_install( + name = "cli-deps", + python_interpreter_target = interpreter, + requirements = "//cli:requirements.txt", +) + +RULES_PKG_VERSION = "0.7.0" + +http_archive( + name = "rules_pkg", + sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/%s/rules_pkg-%s.tar.gz" % (RULES_PKG_VERSION, RULES_PKG_VERSION), + "https://github.com/bazelbuild/rules_pkg/releases/download/%s/rules_pkg-%s.tar.gz" % (RULES_PKG_VERSION, RULES_PKG_VERSION), + ], +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + +http_archive( + name = "aspect_bazel_lib", + sha256 = "0154b46f350c7941919eaa30a4f2284a0128ac13c706901a5c768a829af49e11", + strip_prefix = "bazel-lib-1.13.0", + url = "https://github.com/aspect-build/bazel-lib/archive/refs/tags/v1.13.0.tar.gz", +) + +load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies") + +aspect_bazel_lib_dependencies() + +# ### Swift dependencies +# # Introduce Swift Package Manager Rules for Bazel +# http_archive( +# name = "cgrindel_rules_spm", +# sha256 = "03718eb865a100ba4449ebcbca6d97bf6ea78fa17346ce6d55532312e8bf9aa8", +# strip_prefix = "rules_spm-0.11.0", +# urls = [ +# "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/swift/v0.11.0.tar.gz", +# "http://github.com/cgrindel/rules_spm/archive/v0.11.0.tar.gz", +# ], +# ) + +# load( +# "@cgrindel_rules_spm//spm:deps.bzl", +# "spm_rules_dependencies", +# ) + +# spm_rules_dependencies() + +# load("@cgrindel_rules_spm//spm:defs.bzl", "spm_pkg", "spm_repositories") + +# spm_repositories( +# name = "swift_pkgs_darwin", +# dependencies = [ +# spm_pkg( +# "https://oauth:a12681eba8d14255a49a74cd1c2d5f8d@code.alipay.com/codeinsight_thirdparty/swift-argument-parser.git", +# from_version = "1.1.1", +# products = ["ArgumentParser"], +# ), +# spm_pkg( +# "https://oauth:d7ece9eda5bb4b438b3f5797321a5d2c@code.alipay.com/codeinsight_thirdparty/swift-log.git", +# from_version = "1.4.4", +# products = ["Logging"], +# ), +# spm_pkg( +# "https://oauth:07e4fc6a7ce14b41a4f71561208ca118@code.alipay.com/codeinsight_thirdparty/SQLite.swift.git", +# from_version = "0.13.3", +# products = ["SQLite"], +# ), +# ], +# ) + +# spm_repositories( +# name = "swift_pkgs_linux", +# dependencies = [ +# spm_pkg( +# "https://oauth:a12681eba8d14255a49a74cd1c2d5f8d@code.alipay.com/codeinsight_thirdparty/swift-argument-parser.git", +# from_version = "1.1.1", +# products = ["ArgumentParser"], +# ), +# spm_pkg( +# "https://oauth:d7ece9eda5bb4b438b3f5797321a5d2c@code.alipay.com/codeinsight_thirdparty/swift-log.git", +# from_version = "1.4.4", +# products = ["Logging"], +# ), +# # On Linux, this package relies on SQLite3 and it search for its system library /usr/include/sqlite3.h +# # which is outdated on CentOS, therefore causing linking failure. +# # So I fork this project and make my own patch to make it totally compiled from SQLite3 C source code +# spm_pkg( +# "https://oauth:07e4fc6a7ce14b41a4f71561208ca118@code.alipay.com/codeinsight_thirdparty/SQLite.swift.git", +# products = ["SQLite"], +# # Commit for 0.13.3-patch +# revision = "821d4cff02dfd9c0ac426bb3e4d67e40fef6c882", +# ), +# spm_pkg( +# name = "SwiftSyntax", +# exact_version = "0.50500.0", +# products = ["SwiftSyntax"], +# url = "https://oauth:e23f9a1ec4c94580a41d7fd761e7f172@code.alipay.com/codeinsight_thirdparty/swift-syntax.git", +# ), +# ], +# ) + +# # Introduce Apple Rules for Bazel depended by the rule @com_github_keith_swift_syntax +# http_archive( +# name = "build_bazel_rules_apple", +# sha256 = "90e3b5e8ff942be134e64a83499974203ea64797fd620eddeb71b3a8e1bff681", +# urls = [ +# "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/swift/rules_apple.1.1.2.tar.gz", +# "https://github.com/bazelbuild/rules_apple/releases/download/1.1.2/rules_apple.1.1.2.tar.gz", +# ], +# ) + +# load( +# "@build_bazel_rules_apple//apple:repositories.bzl", +# "apple_rules_dependencies", +# ) + +# apple_rules_dependencies() + +# load( +# "@build_bazel_rules_swift//swift:repositories.bzl", +# "swift_rules_dependencies", +# ) + +# swift_rules_dependencies() + +# load( +# "@build_bazel_rules_swift//swift:extras.bzl", +# "swift_rules_extra_dependencies", +# ) + +# swift_rules_extra_dependencies() + +# load( +# "@build_bazel_apple_support//lib:repositories.bzl", +# "apple_support_dependencies", +# ) + +# apple_support_dependencies() + +# # This repo provides a bazel target for SwiftSyntax. Most importantly it handles vendoring lib_InternalSwiftSyntaxParser +# # as a static library so your tool doesn't depend on a specific Xcode.app path or version. +# # This release switched to using an actual static version of the framework produced here https://github.com/keith/StaticInternalSwiftSyntaxParser/releases/tag/5.5.2 +# # instead of managing a dylib. +# http_archive( +# name = "com_github_keith_swift_syntax_bazel", +# patch_args = ["-p1"], +# # Apply patch to make the rule to download StaticInternalSwiftSyntaxParser stored in OSS +# patches = ["//language/swift/extractor:bazel/swift-syntax-bazel.patch"], +# sha256 = "c05d0c21ccb4beb62428e49187a4bf2c3c8f2e0d46d53324180aff7cadf80be6", +# strip_prefix = "swift-syntax-bazel-13.2.1.13C100", +# urls = [ +# "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/swift/13.2.1.13C100.tar.gz", +# "https://github.com/keith/swift-syntax-bazel/archive/refs/tags/13.2.1.13C100.tar.gz", +# ], +# ) + +# load("@com_github_keith_swift_syntax_bazel//:deps.bzl", "swift_syntax_deps") + +# swift_syntax_deps() + +# # Linux only. Download the prebuilt shared library to make the swift extractor executable self-contained +# # macOS don't need this thanks to the rule @com_github_keith_swift_syntax +# http_archive( +# name = "linux_lib_InternalSwiftSyntaxParser", +# build_file = "//:language/swift/extractor/bazel/lib_InternalSwiftSyntaxParser.BUILD", +# sha256 = "d4292d9b898a9d264c3e8ea58c83074a63d0c8d84602f4a85b9dbb1b4dcd52ad", +# urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/swift/lib_InternalSwiftSyntaxParser/5.5.3-alios7/lib_InternalSwiftSyntaxParser.zip"], +# ) diff --git a/cli/BUILD.bazel b/cli/BUILD.bazel new file mode 100644 index 00000000..d1ff5c07 --- /dev/null +++ b/cli/BUILD.bazel @@ -0,0 +1,38 @@ +filegroup( + name = "source-code", + srcs = glob(["**/*.py"]), +) + +filegroup( + name = "requirements", + srcs = ["requirements.txt"], +) + +filegroup( + name = "pyinstaller-spec-file", + srcs = ["sparrow-cli.spec"], +) + +genrule( + name = "pyinstaller-sparrow-cli", + srcs = [ + ":source-code", + ":requirements", + ":pyinstaller-spec-file", + ], + outs = [ + "_internal", + "sparrow-cli", + ], + cmd = """ + chmod -R 755 $$(dirname $(PYTHON3))/../lib/python3.10/site-packages + $(PYTHON3) -m pip install -r cli/requirements.txt -i https://pypi.antfin-inc.com/simple + $(PYTHON3) -m PyInstaller ./cli/sparrow-cli.spec --distpath $(RULEDIR) --workpath ./pyinstaller-build -y --clean + mv $(RULEDIR)/cli/* $(RULEDIR)/ + rmdir $(RULEDIR)/cli + """, + toolchains = ["@rules_python//python:current_py_toolchain"], + visibility = ["//visibility:public"], +) + +exports_files(["sparrow"]) diff --git a/deps.bzl b/deps.bzl new file mode 100644 index 00000000..f85e4fba --- /dev/null +++ b/deps.bzl @@ -0,0 +1,2083 @@ +load("@bazel_gazelle//:deps.bzl", "go_repository") + +def go_dependencies(): + go_repository( + name = "co_honnef_go_tools", + build_file_proto_mode = "disable_global", + importpath = "honnef.co/go/tools", + sum = "h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=", + version = "v0.0.1-2020.1.4", + ) + go_repository( + name = "com_github_alecthomas_template", + build_file_proto_mode = "disable_global", + importpath = "github.com/alecthomas/template", + sum = "h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=", + version = "v0.0.0-20190718012654-fb15b899a751", + ) + go_repository( + name = "com_github_alecthomas_units", + build_file_proto_mode = "disable_global", + importpath = "github.com/alecthomas/units", + sum = "h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=", + version = "v0.0.0-20190924025748-f65c72e2690d", + ) + go_repository( + name = "com_github_alicebob_gopher_json", + build_file_proto_mode = "disable_global", + importpath = "github.com/alicebob/gopher-json", + sum = "h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=", + version = "v0.0.0-20200520072559-a9ecdc9d1d3a", + ) + go_repository( + name = "com_github_alicebob_miniredis_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/alicebob/miniredis/v2", + sum = "h1:+lwAJYjvvdIVg6doFHuotFjueJ/7KY10xo/vm3X3Scw=", + version = "v2.23.0", + ) + go_repository( + name = "com_github_antihax_optional", + build_file_proto_mode = "disable_global", + importpath = "github.com/antihax/optional", + sum = "h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_armon_go_socks5", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/go-socks5", + sum = "h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=", + version = "v0.0.0-20160902184237-e75332964ef5", + ) + go_repository( + name = "com_github_asaskevich_govalidator", + build_file_proto_mode = "disable_global", + importpath = "github.com/asaskevich/govalidator", + sum = "h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=", + version = "v0.0.0-20190424111038-f61b66f89f4a", + ) + go_repository( + name = "com_github_azure_go_autorest", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest", + sum = "h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=", + version = "v14.2.0+incompatible", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest", + sum = "h1:F3R3q42aWytozkV8ihzcgMO4OA4cuqr3bNlsEuF6//A=", + version = "v0.11.27", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_adal", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/adal", + sum = "h1:gJ3E98kMpFB1MFqQCvA1yFab8vthOeD4VlFRQULxahg=", + version = "v0.9.20", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_date", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/date", + sum = "h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_mocks", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/mocks", + sum = "h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=", + version = "v0.4.1", + ) + go_repository( + name = "com_github_azure_go_autorest_logger", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/logger", + sum = "h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_azure_go_autorest_tracing", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/tracing", + sum = "h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=", + version = "v0.6.0", + ) + go_repository( + name = "com_github_benbjohnson_clock", + build_file_proto_mode = "disable_global", + importpath = "github.com/benbjohnson/clock", + sum = "h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_beorn7_perks", + build_file_proto_mode = "disable_global", + importpath = "github.com/beorn7/perks", + sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_bkaradzic_go_lz4", + build_file_proto_mode = "disable_global", + importpath = "github.com/bkaradzic/go-lz4", + sum = "h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAKk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_burntsushi_toml", + build_file_proto_mode = "disable_global", + importpath = "github.com/BurntSushi/toml", + sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=", + version = "v0.3.1", + ) + go_repository( + name = "com_github_burntsushi_xgb", + build_file_proto_mode = "disable_global", + importpath = "github.com/BurntSushi/xgb", + sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", + version = "v0.0.0-20160522181843-27f122750802", + ) + go_repository( + name = "com_github_cenkalti_backoff_v4", + build_file_proto_mode = "disable_global", + importpath = "github.com/cenkalti/backoff/v4", + sum = "h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4=", + version = "v4.1.3", + ) + go_repository( + name = "com_github_census_instrumentation_opencensus_proto", + build_file_proto_mode = "disable_global", + importpath = "github.com/census-instrumentation/opencensus-proto", + sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_cespare_xxhash", + build_file_proto_mode = "disable_global", + importpath = "github.com/cespare/xxhash", + sum = "h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_cespare_xxhash_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/cespare/xxhash/v2", + sum = "h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=", + version = "v2.1.2", + ) + go_repository( + name = "com_github_chzyer_logex", + build_file_proto_mode = "disable_global", + importpath = "github.com/chzyer/logex", + sum = "h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=", + version = "v1.1.10", + ) + go_repository( + name = "com_github_chzyer_readline", + build_file_proto_mode = "disable_global", + importpath = "github.com/chzyer/readline", + sum = "h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=", + version = "v0.0.0-20180603132655-2972be24d48e", + ) + go_repository( + name = "com_github_chzyer_test", + build_file_proto_mode = "disable_global", + importpath = "github.com/chzyer/test", + sum = "h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=", + version = "v0.0.0-20180213035817-a1ea475d72b1", + ) + go_repository( + name = "com_github_clickhouse_clickhouse_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/ClickHouse/clickhouse-go", + sum = "h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=", + version = "v1.5.4", + ) + go_repository( + name = "com_github_clickhouse_clickhouse_go_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/ClickHouse/clickhouse-go/v2", + sum = "h1:7HW+MXPaQfVyCzPGEn/LciMc8K6cG58FZMUc7DXQmro=", + version = "v2.0.14", + ) + go_repository( + name = "com_github_client9_misspell", + build_file_proto_mode = "disable_global", + importpath = "github.com/client9/misspell", + sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", + version = "v0.3.4", + ) + go_repository( + name = "com_github_cloudflare_golz4", + build_file_proto_mode = "disable_global", + importpath = "github.com/cloudflare/golz4", + sum = "h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg=", + version = "v0.0.0-20150217214814-ef862a3cdc58", + ) + go_repository( + name = "com_github_cncf_udpa_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cncf/udpa/go", + sum = "h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI=", + version = "v0.0.0-20210930031921-04548b0d99d4", + ) + go_repository( + name = "com_github_cncf_xds_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cncf/xds/go", + sum = "h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw=", + version = "v0.0.0-20211011173535-cb28da3451f1", + ) + go_repository( + name = "com_github_coreos_go_semver", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-semver", + sum = "h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_coreos_go_systemd_v22", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-systemd/v22", + sum = "h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=", + version = "v22.3.2", + ) + go_repository( + name = "com_github_cpuguy83_go_md2man_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/cpuguy83/go-md2man/v2", + sum = "h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=", + version = "v2.0.0-20190314233015-f79a8a8ca69d", + ) + go_repository( + name = "com_github_creack_pty", + build_file_proto_mode = "disable_global", + importpath = "github.com/creack/pty", + sum = "h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=", + version = "v1.1.9", + ) + go_repository( + name = "com_github_data_dog_go_sqlmock", + build_file_proto_mode = "disable_global", + importpath = "github.com/DATA-DOG/go-sqlmock", + sum = "h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=", + version = "v1.5.0", + ) + + go_repository( + name = "com_github_davecgh_go_spew", + build_file_proto_mode = "disable_global", + importpath = "github.com/davecgh/go-spew", + sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_dgryski_go_rendezvous", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgryski/go-rendezvous", + sum = "h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=", + version = "v0.0.0-20200823014737-9f7001d12a5f", + ) + go_repository( + name = "com_github_docopt_docopt_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/docopt/docopt-go", + sum = "h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=", + version = "v0.0.0-20180111231733-ee0de3bc6815", + ) + + go_repository( + name = "com_github_dustin_go_humanize", + build_file_proto_mode = "disable_global", + importpath = "github.com/dustin/go-humanize", + sum = "h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_eapache_go_resiliency", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/go-resiliency", + sum = "h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_eapache_go_xerial_snappy", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/go-xerial-snappy", + sum = "h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=", + version = "v0.0.0-20180814174437-776d5712da21", + ) + go_repository( + name = "com_github_eapache_queue", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/queue", + sum = "h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_elazarl_goproxy", + build_file_proto_mode = "disable_global", + importpath = "github.com/elazarl/goproxy", + sum = "h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=", + version = "v0.0.0-20180725130230-947c36da3153", + ) + go_repository( + name = "com_github_emicklei_go_restful", + build_file_proto_mode = "disable_global", + importpath = "github.com/emicklei/go-restful", + sum = "h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=", + version = "v0.0.0-20170410110728-ff4f55a20633", + ) + go_repository( + name = "com_github_emicklei_go_restful_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/emicklei/go-restful/v3", + sum = "h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw=", + version = "v3.8.0", + ) + go_repository( + name = "com_github_envoyproxy_go_control_plane", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/go-control-plane", + sum = "h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0=", + version = "v0.10.2-0.20220325020618-49ff273808a1", + ) + go_repository( + name = "com_github_envoyproxy_protoc_gen_validate", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/protoc-gen-validate", + sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_evanphx_json_patch", + build_file_proto_mode = "disable_global", + importpath = "github.com/evanphx/json-patch", + sum = "h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=", + version = "v4.12.0+incompatible", + ) + go_repository( + name = "com_github_fatih_color", + build_file_proto_mode = "disable_global", + importpath = "github.com/fatih/color", + sum = "h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=", + version = "v1.13.0", + ) + go_repository( + name = "com_github_form3tech_oss_jwt_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/form3tech-oss/jwt-go", + sum = "h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=", + version = "v3.2.3+incompatible", + ) + go_repository( + name = "com_github_fortytw2_leaktest", + build_file_proto_mode = "disable_global", + importpath = "github.com/fortytw2/leaktest", + sum = "h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_frankban_quicktest", + build_file_proto_mode = "disable_global", + importpath = "github.com/frankban/quicktest", + sum = "h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=", + version = "v1.11.3", + ) + go_repository( + name = "com_github_fsnotify_fsnotify", + build_file_proto_mode = "disable_global", + importpath = "github.com/fsnotify/fsnotify", + sum = "h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=", + version = "v1.4.9", + ) + go_repository( + name = "com_github_fullstorydev_grpcurl", + build_file_proto_mode = "disable_global", + importpath = "github.com/fullstorydev/grpcurl", + sum = "h1:xJWosq3BQovQ4QrdPO72OrPiWuGgEsxY8ldYsJbPrqI=", + version = "v1.8.7", + ) + go_repository( + name = "com_github_ghodss_yaml", + build_file_proto_mode = "disable_global", + importpath = "github.com/ghodss/yaml", + sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=", + version = "v1.0.0", + ) + + go_repository( + name = "com_github_glebarez_go_sqlite", + build_file_proto_mode = "disable_global", + importpath = "github.com/glebarez/go-sqlite", + sum = "h1:gyTyFr2RFFQd2gp6fOOdfnTvUn99zwvVOrQFHA4S+DY=", + version = "v1.17.2", + ) + go_repository( + name = "com_github_glebarez_sqlite", + build_file_proto_mode = "disable_global", + importpath = "github.com/glebarez/sqlite", + sum = "h1:oaJupO4X9iTn4sXRvP5Vs15BNvKh9dx5AQfciKlDvV4=", + version = "v1.4.5", + ) + go_repository( + name = "com_github_globalsign_mgo", + build_file_proto_mode = "disable_global", + importpath = "github.com/globalsign/mgo", + sum = "h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is=", + version = "v0.0.0-20181015135952-eeefdecb41b8", + ) + go_repository( + name = "com_github_go_gl_glfw", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-gl/glfw", + sum = "h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=", + version = "v0.0.0-20190409004039-e6da0acd62b1", + ) + go_repository( + name = "com_github_go_gl_glfw_v3_3_glfw", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-gl/glfw/v3.3/glfw", + sum = "h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=", + version = "v0.0.0-20200222043503-6f7a984d4dc4", + ) + go_repository( + name = "com_github_go_kit_kit", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-kit/kit", + sum = "h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_go_kit_log", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-kit/log", + sum = "h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_go_logfmt_logfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-logfmt/logfmt", + sum = "h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=", + version = "v0.5.1", + ) + go_repository( + name = "com_github_go_logr_logr", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-logr/logr", + sum = "h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=", + version = "v1.2.3", + ) + go_repository( + name = "com_github_go_logr_stdr", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-logr/stdr", + sum = "h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_go_ole_go_ole", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-ole/go-ole", + sum = "h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=", + version = "v1.2.4", + ) + go_repository( + name = "com_github_go_openapi_jsonpointer", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-openapi/jsonpointer", + sum = "h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=", + version = "v0.19.5", + ) + go_repository( + name = "com_github_go_openapi_jsonreference", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-openapi/jsonreference", + sum = "h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM=", + version = "v0.19.5", + ) + go_repository( + name = "com_github_go_openapi_swag", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-openapi/swag", + sum = "h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng=", + version = "v0.19.14", + ) + go_repository( + name = "com_github_go_redis_redis_v8", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-redis/redis/v8", + sum = "h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=", + version = "v8.11.5", + ) + go_repository( + name = "com_github_go_sql_driver_mysql", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-sql-driver/mysql", + sum = "h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_go_stack_stack", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-stack/stack", + sum = "h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_go_task_slim_sprig", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-task/slim-sprig", + sum = "h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=", + version = "v0.0.0-20210107165309-348f09dbbbc0", + ) + go_repository( + name = "com_github_godbus_dbus_v5", + build_file_proto_mode = "disable_global", + importpath = "github.com/godbus/dbus/v5", + sum = "h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=", + version = "v5.0.4", + ) + go_repository( + name = "com_github_gofrs_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/gofrs/uuid", + sum = "h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI=", + version = "v4.3.1+incompatible", + ) + go_repository( + name = "com_github_gogo_protobuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/protobuf", + sum = "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_golang_glog", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/glog", + sum = "h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_golang_groupcache", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/groupcache", + sum = "h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=", + version = "v0.0.0-20210331224755-41bb18bfe9da", + ) + go_repository( + name = "com_github_golang_jwt_jwt_v4", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang-jwt/jwt/v4", + sum = "h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=", + version = "v4.4.2", + ) + go_repository( + name = "com_github_golang_mock", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/mock", + sum = "h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_golang_protobuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/protobuf", + sum = "h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=", + version = "v1.5.2", + ) + go_repository( + name = "com_github_golang_snappy", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/snappy", + sum = "h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=", + version = "v0.0.4", + ) + go_repository( + name = "com_github_google_btree", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/btree", + sum = "h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_google_gnostic", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/gnostic", + sum = "h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=", + version = "v0.5.7-v3refs", + ) + + go_repository( + name = "com_github_google_go_cmp", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/go-cmp", + sum = "h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=", + version = "v0.5.8", + ) + go_repository( + name = "com_github_google_gofuzz", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/gofuzz", + sum = "h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_google_martian", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/martian", + sum = "h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_google_martian_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/martian/v3", + sum = "h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs=", + version = "v3.0.0", + ) + go_repository( + name = "com_github_google_pprof", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/pprof", + sum = "h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=", + version = "v0.0.0-20210407192527-94a9f03dee38", + ) + go_repository( + name = "com_github_google_renameio", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/renameio", + sum = "h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=", + version = "v0.1.0", + ) + + go_repository( + name = "com_github_google_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/uuid", + sum = "h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_googleapis_gax_go_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/googleapis/gax-go/v2", + sum = "h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=", + version = "v2.0.5", + ) + go_repository( + name = "com_github_googleapis_gnostic", + build_file_proto_mode = "disable_global", + importpath = "github.com/googleapis/gnostic", + sum = "h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw=", + version = "v0.5.5", + ) + go_repository( + name = "com_github_gorilla_handlers", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/handlers", + sum = "h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_gorilla_mux", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/mux", + sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_gorilla_securecookie", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/securecookie", + sum = "h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_gorilla_sessions", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/sessions", + sum = "h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_gorilla_websocket", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/websocket", + sum = "h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_gregjones_httpcache", + build_file_proto_mode = "disable_global", + importpath = "github.com/gregjones/httpcache", + sum = "h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=", + version = "v0.0.0-20180305231024-9cad4c3443a7", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_prometheus", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/go-grpc-prometheus", + sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_grpc_gateway", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/grpc-gateway", + sum = "h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=", + version = "v1.16.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_grpc_gateway_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/grpc-gateway/v2", + sum = "h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=", + version = "v2.7.0", + ) + go_repository( + name = "com_github_h2non_parth", + build_file_proto_mode = "disable_global", + importpath = "github.com/h2non/parth", + sum = "h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=", + version = "v0.0.0-20190131123155-b4df798d6542", + ) + go_repository( + name = "com_github_hashicorp_go_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-uuid", + sum = "h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_hashicorp_golang_lru", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/golang-lru", + sum = "h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=", + version = "v0.5.1", + ) + go_repository( + name = "com_github_hpcloud_tail", + build_file_proto_mode = "disable_global", + importpath = "github.com/hpcloud/tail", + sum = "h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_ianlancetaylor_demangle", + build_file_proto_mode = "disable_global", + importpath = "github.com/ianlancetaylor/demangle", + sum = "h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI=", + version = "v0.0.0-20200824232613-28f6c0f3b639", + ) + go_repository( + name = "com_github_imdario_mergo", + build_file_proto_mode = "disable_global", + importpath = "github.com/imdario/mergo", + sum = "h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=", + version = "v0.3.6", + ) + go_repository( + name = "com_github_jcmturner_aescts_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/aescts/v2", + sum = "h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_jcmturner_dnsutils_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/dnsutils/v2", + sum = "h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_jcmturner_gofork", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/gofork", + sum = "h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jcmturner_goidentity_v6", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/goidentity/v6", + sum = "h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=", + version = "v6.0.1", + ) + go_repository( + name = "com_github_jcmturner_gokrb5_v8", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/gokrb5/v8", + sum = "h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA=", + version = "v8.4.2", + ) + go_repository( + name = "com_github_jcmturner_rpc_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/rpc/v2", + sum = "h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=", + version = "v2.0.3", + ) + go_repository( + name = "com_github_jhump_gopoet", + build_file_proto_mode = "disable_global", + importpath = "github.com/jhump/gopoet", + sum = "h1:gYjOPnzHd2nzB37xYQZxj4EIQNpBrBskRqQQ3q4ZgSg=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_jhump_goprotoc", + build_file_proto_mode = "disable_global", + importpath = "github.com/jhump/goprotoc", + sum = "h1:Y1UgUX+txUznfqcGdDef8ZOVlyQvnV0pKWZH08RmZuo=", + version = "v0.5.0", + ) + go_repository( + name = "com_github_jhump_protoreflect", + build_file_proto_mode = "disable_global", + importpath = "github.com/jhump/protoreflect", + sum = "h1:zrrZqa7JAc2YGgPSzZZkmUXJ5G6NRPdxOg/9t7ISImA=", + version = "v1.13.0", + ) + + go_repository( + name = "com_github_jinzhu_inflection", + build_file_proto_mode = "disable_global", + importpath = "github.com/jinzhu/inflection", + sum = "h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jinzhu_now", + build_file_proto_mode = "disable_global", + importpath = "github.com/jinzhu/now", + sum = "h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas=", + version = "v1.1.4", + ) + go_repository( + name = "com_github_jmoiron_sqlx", + build_file_proto_mode = "disable_global", + importpath = "github.com/jmoiron/sqlx", + sum = "h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_josharian_intern", + build_file_proto_mode = "disable_global", + importpath = "github.com/josharian/intern", + sum = "h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jpillora_backoff", + build_file_proto_mode = "disable_global", + importpath = "github.com/jpillora/backoff", + sum = "h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_json_iterator_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/json-iterator/go", + sum = "h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=", + version = "v1.1.12", + ) + go_repository( + name = "com_github_jstemmer_go_junit_report", + build_file_proto_mode = "disable_global", + importpath = "github.com/jstemmer/go-junit-report", + sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_julienschmidt_httprouter", + build_file_proto_mode = "disable_global", + importpath = "github.com/julienschmidt/httprouter", + sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", + version = "v1.3.0", + ) + + go_repository( + name = "com_github_kballard_go_shellquote", + build_file_proto_mode = "disable_global", + importpath = "github.com/kballard/go-shellquote", + sum = "h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=", + version = "v0.0.0-20180428030007-95032a82bc51", + ) + go_repository( + name = "com_github_kisielk_errcheck", + build_file_proto_mode = "disable_global", + importpath = "github.com/kisielk/errcheck", + sum = "h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_kisielk_gotool", + build_file_proto_mode = "disable_global", + importpath = "github.com/kisielk/gotool", + sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_klauspost_compress", + build_file_proto_mode = "disable_global", + importpath = "github.com/klauspost/compress", + sum = "h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=", + version = "v1.13.6", + ) + go_repository( + name = "com_github_konsorten_go_windows_terminal_sequences", + build_file_proto_mode = "disable_global", + importpath = "github.com/konsorten/go-windows-terminal-sequences", + sum = "h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=", + version = "v1.0.3", + ) + go_repository( + name = "com_github_kr_logfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/logfmt", + sum = "h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=", + version = "v0.0.0-20140226030751-b84e30acd515", + ) + go_repository( + name = "com_github_kr_pretty", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/pretty", + sum = "h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_kr_pty", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/pty", + sum = "h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_kr_text", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/text", + sum = "h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_lib_pq", + build_file_proto_mode = "disable_global", + importpath = "github.com/lib/pq", + sum = "h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=", + version = "v1.10.7", + ) + go_repository( + name = "com_github_mailru_easyjson", + build_file_proto_mode = "disable_global", + importpath = "github.com/mailru/easyjson", + sum = "h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=", + version = "v0.7.6", + ) + go_repository( + name = "com_github_mattn_go_colorable", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-colorable", + sum = "h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=", + version = "v0.1.9", + ) + + go_repository( + name = "com_github_mattn_go_isatty", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-isatty", + sum = "h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=", + version = "v0.0.16", + ) + go_repository( + name = "com_github_mattn_go_runewidth", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-runewidth", + sum = "h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=", + version = "v0.0.13", + ) + + go_repository( + name = "com_github_mattn_go_sqlite3", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-sqlite3", + sum = "h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0=", + version = "v1.14.12", + ) + go_repository( + name = "com_github_matttproud_golang_protobuf_extensions", + build_file_proto_mode = "disable_global", + importpath = "github.com/matttproud/golang_protobuf_extensions", + sum = "h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=", + version = "v1.0.2-0.20181231171920-c182affec369", + ) + go_repository( + name = "com_github_mitchellh_mapstructure", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/mapstructure", + sum = "h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=", + version = "v1.1.2", + ) + go_repository( + name = "com_github_mkevac_debugcharts", + build_file_proto_mode = "disable_global", + importpath = "github.com/mkevac/debugcharts", + sum = "h1:/mD+ABZyXD39BzJI2XyRJlqdZG11gXFo0SSynL+OFeU=", + version = "v0.0.0-20191222103121-ae1c48aa8615", + ) + go_repository( + name = "com_github_moby_spdystream", + build_file_proto_mode = "disable_global", + importpath = "github.com/moby/spdystream", + sum = "h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_modern_go_concurrent", + build_file_proto_mode = "disable_global", + importpath = "github.com/modern-go/concurrent", + sum = "h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=", + version = "v0.0.0-20180306012644-bacd9c7ef1dd", + ) + go_repository( + name = "com_github_modern_go_reflect2", + build_file_proto_mode = "disable_global", + importpath = "github.com/modern-go/reflect2", + sum = "h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_montanaflynn_stats", + build_file_proto_mode = "disable_global", + importpath = "github.com/montanaflynn/stats", + sum = "h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=", + version = "v0.0.0-20171201202039-1bf9dbcd8cbe", + ) + go_repository( + name = "com_github_munnerz_goautoneg", + build_file_proto_mode = "disable_global", + importpath = "github.com/munnerz/goautoneg", + sum = "h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=", + version = "v0.0.0-20191010083416-a7dc8b61c822", + ) + go_repository( + name = "com_github_mwitkow_go_conntrack", + build_file_proto_mode = "disable_global", + importpath = "github.com/mwitkow/go-conntrack", + sum = "h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=", + version = "v0.0.0-20190716064945-2f068394615f", + ) + go_repository( + name = "com_github_mxk_go_flowrate", + build_file_proto_mode = "disable_global", + importpath = "github.com/mxk/go-flowrate", + sum = "h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=", + version = "v0.0.0-20140419014527-cca7078d478f", + ) + go_repository( + name = "com_github_nbio_st", + build_file_proto_mode = "disable_global", + importpath = "github.com/nbio/st", + sum = "h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=", + version = "v0.0.0-20140626010706-e9e8d9816f32", + ) + go_repository( + name = "com_github_niemeyer_pretty", + build_file_proto_mode = "disable_global", + importpath = "github.com/niemeyer/pretty", + sum = "h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=", + version = "v0.0.0-20200227124842-a10e7caefd8e", + ) + go_repository( + name = "com_github_nxadm_tail", + build_file_proto_mode = "disable_global", + importpath = "github.com/nxadm/tail", + sum = "h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=", + version = "v1.4.8", + ) + go_repository( + name = "com_github_nytimes_gziphandler", + build_file_proto_mode = "disable_global", + importpath = "github.com/NYTimes/gziphandler", + sum = "h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0=", + version = "v0.0.0-20170623195520-56545f4a5d46", + ) + go_repository( + name = "com_github_olekukonko_tablewriter", + build_file_proto_mode = "disable_global", + importpath = "github.com/olekukonko/tablewriter", + sum = "h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=", + version = "v0.0.5", + ) + go_repository( + name = "com_github_oneofone_xxhash", + build_file_proto_mode = "disable_global", + importpath = "github.com/OneOfOne/xxhash", + sum = "h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_onsi_ginkgo", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/ginkgo", + sum = "h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=", + version = "v1.16.5", + ) + go_repository( + name = "com_github_onsi_ginkgo_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/ginkgo/v2", + sum = "h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU=", + version = "v2.1.6", + ) + go_repository( + name = "com_github_onsi_gomega", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/gomega", + sum = "h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q=", + version = "v1.20.1", + ) + go_repository( + name = "com_github_openzipkin_zipkin_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/openzipkin/zipkin-go", + sum = "h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_paulmach_orb", + build_file_proto_mode = "disable_global", + importpath = "github.com/paulmach/orb", + sum = "h1:sNhJV5ML+mv1F077ljOck/9inorF4ahDO8iNNpHbKHY=", + version = "v0.5.0", + ) + go_repository( + name = "com_github_paulmach_protoscan", + build_file_proto_mode = "disable_global", + importpath = "github.com/paulmach/protoscan", + sum = "h1:rM0FpcTjUMvPUNk2BhPJrreDKetq43ChnL+x1sRg8O8=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_pelletier_go_toml_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/pelletier/go-toml/v2", + sum = "h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg=", + version = "v2.0.5", + ) + go_repository( + name = "com_github_peterbourgon_diskv", + build_file_proto_mode = "disable_global", + importpath = "github.com/peterbourgon/diskv", + sum = "h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=", + version = "v2.0.1+incompatible", + ) + go_repository( + name = "com_github_pierrec_lz4", + build_file_proto_mode = "disable_global", + importpath = "github.com/pierrec/lz4", + sum = "h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=", + version = "v2.6.1+incompatible", + ) + go_repository( + name = "com_github_pierrec_lz4_v4", + build_file_proto_mode = "disable_global", + importpath = "github.com/pierrec/lz4/v4", + sum = "h1:+fL8AQEZtz/ijeNnpduH0bROTu0O3NZAlPjQxGn8LwE=", + version = "v4.1.14", + ) + go_repository( + name = "com_github_pkg_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/errors", + sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=", + version = "v0.9.1", + ) + + go_repository( + name = "com_github_pmezard_go_difflib", + build_file_proto_mode = "disable_global", + importpath = "github.com/pmezard/go-difflib", + sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_prashantv_gostub", + build_file_proto_mode = "disable_global", + importpath = "github.com/prashantv/gostub", + sum = "h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_prometheus_client_golang", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/client_golang", + sum = "h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU=", + version = "v1.13.0", + ) + go_repository( + name = "com_github_prometheus_client_model", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/client_model", + sum = "h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_prometheus_common", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/common", + sum = "h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=", + version = "v0.37.0", + ) + go_repository( + name = "com_github_prometheus_procfs", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/procfs", + sum = "h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=", + version = "v0.8.0", + ) + go_repository( + name = "com_github_puerkitobio_purell", + build_file_proto_mode = "disable_global", + importpath = "github.com/PuerkitoBio/purell", + sum = "h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_puerkitobio_urlesc", + build_file_proto_mode = "disable_global", + importpath = "github.com/PuerkitoBio/urlesc", + sum = "h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=", + version = "v0.0.0-20170810143723-de5bf2ad4578", + ) + go_repository( + name = "com_github_rabbitmq_amqp091_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/rabbitmq/amqp091-go", + sum = "h1:qx8cGMJha71/5t31Z+LdPLdPrkj/BvD38cqC3Bi1pNI=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_rcrowley_go_metrics", + build_file_proto_mode = "disable_global", + importpath = "github.com/rcrowley/go-metrics", + sum = "h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=", + version = "v0.0.0-20201227073835-cf1acfcdf475", + ) + + go_repository( + name = "com_github_remyoudompheng_bigfft", + build_file_proto_mode = "disable_global", + importpath = "github.com/remyoudompheng/bigfft", + sum = "h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=", + version = "v0.0.0-20200410134404-eec4a21b6bb0", + ) + go_repository( + name = "com_github_rivo_uniseg", + build_file_proto_mode = "disable_global", + importpath = "github.com/rivo/uniseg", + sum = "h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_rogpeppe_fastuuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/rogpeppe/fastuuid", + sum = "h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_rogpeppe_go_internal", + build_file_proto_mode = "disable_global", + importpath = "github.com/rogpeppe/go-internal", + sum = "h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_russross_blackfriday_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/russross/blackfriday/v2", + sum = "h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=", + version = "v2.0.1", + ) + go_repository( + name = "com_github_shirou_gopsutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/shirou/gopsutil", + sum = "h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=", + version = "v3.21.11+incompatible", + ) + go_repository( + name = "com_github_shirou_w32", + build_file_proto_mode = "disable_global", + importpath = "github.com/shirou/w32", + sum = "h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U=", + version = "v0.0.0-20160930032740-bb4de0191aa4", + ) + go_repository( + name = "com_github_shopify_sarama", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/sarama", + sum = "h1:TOZL6r37xJBDEMLx4yjB77jxbZYXPaDow08TSK6vIL0=", + version = "v1.30.0", + ) + go_repository( + name = "com_github_shopify_toxiproxy_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/toxiproxy/v2", + sum = "h1:ePgznFqEG1v3AjMklnK8H7BSc++FDSo7xfK9K7Af+0Y=", + version = "v2.1.6-0.20210914104332-15ea381dcdae", + ) + go_repository( + name = "com_github_shopspring_decimal", + build_file_proto_mode = "disable_global", + importpath = "github.com/shopspring/decimal", + sum = "h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=", + version = "v1.3.1", + ) + go_repository( + name = "com_github_shurcool_sanitized_anchor_name", + build_file_proto_mode = "disable_global", + importpath = "github.com/shurcooL/sanitized_anchor_name", + sum = "h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_sirupsen_logrus", + build_file_proto_mode = "disable_global", + importpath = "github.com/sirupsen/logrus", + sum = "h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=", + version = "v1.8.1", + ) + go_repository( + name = "com_github_spaolacci_murmur3", + build_file_proto_mode = "disable_global", + importpath = "github.com/spaolacci/murmur3", + sum = "h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_spf13_afero", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/afero", + sum = "h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_spf13_pflag", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/pflag", + sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", + version = "v1.0.5", + ) + go_repository( + name = "com_github_stackexchange_wmi", + build_file_proto_mode = "disable_global", + importpath = "github.com/StackExchange/wmi", + sum = "h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=", + version = "v0.0.0-20190523213315-cbe66965904d", + ) + go_repository( + name = "com_github_stoewer_go_strcase", + build_file_proto_mode = "disable_global", + importpath = "github.com/stoewer/go-strcase", + sum = "h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=", + version = "v1.2.0", + ) + + go_repository( + name = "com_github_stretchr_objx", + build_file_proto_mode = "disable_global", + importpath = "github.com/stretchr/objx", + sum = "h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_stretchr_testify", + build_file_proto_mode = "disable_global", + importpath = "github.com/stretchr/testify", + sum = "h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_tidwall_pretty", + build_file_proto_mode = "disable_global", + importpath = "github.com/tidwall/pretty", + sum = "h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_tklauser_go_sysconf", + build_file_proto_mode = "disable_global", + importpath = "github.com/tklauser/go-sysconf", + sum = "h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw=", + version = "v0.3.10", + ) + go_repository( + name = "com_github_tklauser_numcpus", + build_file_proto_mode = "disable_global", + importpath = "github.com/tklauser/numcpus", + sum = "h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_urfave_cli_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/urfave/cli/v2", + sum = "h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=", + version = "v2.3.0", + ) + go_repository( + name = "com_github_xdg_go_pbkdf2", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg-go/pbkdf2", + sum = "h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_xdg_go_scram", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg-go/scram", + sum = "h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_xdg_go_stringprep", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg-go/stringprep", + sum = "h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs=", + version = "v1.0.3", + ) + go_repository( + name = "com_github_youmark_pkcs8", + build_file_proto_mode = "disable_global", + importpath = "github.com/youmark/pkcs8", + sum = "h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=", + version = "v0.0.0-20181117223130-1be2e3e5546d", + ) + + go_repository( + name = "com_github_yuin_goldmark", + build_file_proto_mode = "disable_global", + importpath = "github.com/yuin/goldmark", + sum = "h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=", + version = "v1.4.13", + ) + go_repository( + name = "com_github_yuin_gopher_lua", + build_file_proto_mode = "disable_global", + importpath = "github.com/yuin/gopher-lua", + sum = "h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw=", + version = "v0.0.0-20210529063254-f4c35e4016d9", + ) + go_repository( + name = "com_github_zeromicro_go_zero", + build_file_proto_mode = "disable_global", + importpath = "github.com/zeromicro/go-zero", + sum = "h1:1P9TuzxONqxQG3Bvpk7r7vPOGEnfXn3lTX/4W5Y2GlQ=", + version = "v1.4.2", + ) + go_repository( + name = "com_google_cloud_go", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go", + sum = "h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8=", + version = "v0.97.0", + ) + go_repository( + name = "com_google_cloud_go_bigquery", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/bigquery", + sum = "h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=", + version = "v1.8.0", + ) + go_repository( + name = "com_google_cloud_go_datastore", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/datastore", + sum = "h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=", + version = "v1.1.0", + ) + go_repository( + name = "com_google_cloud_go_pubsub", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/pubsub", + sum = "h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=", + version = "v1.3.1", + ) + go_repository( + name = "com_google_cloud_go_storage", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/storage", + sum = "h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=", + version = "v1.10.0", + ) + + go_repository( + name = "com_lukechampine_uint128", + build_file_proto_mode = "disable_global", + importpath = "lukechampine.com/uint128", + sum = "h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU=", + version = "v1.1.1", + ) + go_repository( + name = "com_shuralyov_dmitri_gpu_mtl", + build_file_proto_mode = "disable_global", + importpath = "dmitri.shuralyov.com/gpu/mtl", + sum = "h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=", + version = "v0.0.0-20190408044501-666a987793e9", + ) + go_repository( + name = "in_gopkg_alecthomas_kingpin_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/alecthomas/kingpin.v2", + sum = "h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=", + version = "v2.2.6", + ) + + go_repository( + name = "in_gopkg_check_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/check.v1", + sum = "h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=", + version = "v1.0.0-20201130134442-10cb98267c6c", + ) + go_repository( + name = "in_gopkg_cheggaaa_pb_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/cheggaaa/pb.v1", + sum = "h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=", + version = "v1.0.28", + ) + go_repository( + name = "in_gopkg_errgo_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/errgo.v2", + sum = "h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=", + version = "v2.1.0", + ) + go_repository( + name = "in_gopkg_fsnotify_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/fsnotify.v1", + sum = "h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=", + version = "v1.4.7", + ) + go_repository( + name = "in_gopkg_h2non_gock_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/h2non/gock.v1", + sum = "h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=", + version = "v1.1.2", + ) + go_repository( + name = "in_gopkg_inf_v0", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/inf.v0", + sum = "h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=", + version = "v0.9.1", + ) + go_repository( + name = "in_gopkg_tomb_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/tomb.v1", + sum = "h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=", + version = "v1.0.0-20141024135613-dd632973f1e7", + ) + go_repository( + name = "in_gopkg_yaml_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/yaml.v2", + sum = "h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=", + version = "v2.4.0", + ) + + go_repository( + name = "in_gopkg_yaml_v3", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/yaml.v3", + sum = "h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=", + version = "v3.0.1", + ) + go_repository( + name = "io_etcd_go_etcd_api_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/api/v3", + sum = "h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0=", + version = "v3.5.5", + ) + go_repository( + name = "io_etcd_go_etcd_client_pkg_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/client/pkg/v3", + sum = "h1:9S0JUVvmrVl7wCF39iTQthdaaNIiAaQbmK75ogO6GU8=", + version = "v3.5.5", + ) + go_repository( + name = "io_etcd_go_etcd_client_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/client/v3", + sum = "h1:q++2WTJbUgpQu4B6hCuT7VkdwaTP7Qz6Daak3WzbrlI=", + version = "v3.5.5", + ) + + go_repository( + name = "io_gorm_gorm", + build_file_proto_mode = "disable_global", + importpath = "gorm.io/gorm", + sum = "h1:TnlF26wScKSvknUC/Rn8t0NLLM22fypYBlvj1+aH6dM=", + version = "v1.23.5", + ) + go_repository( + name = "io_k8s_api", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/api", + sum = "h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs=", + version = "v0.25.4", + ) + go_repository( + name = "io_k8s_apimachinery", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/apimachinery", + sum = "h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc=", + version = "v0.25.4", + ) + go_repository( + name = "io_k8s_client_go", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/client-go", + sum = "h1:3RNRDffAkNU56M/a7gUfXaEzdhZlYhoW8dgViGy5fn8=", + version = "v0.25.4", + ) + go_repository( + name = "io_k8s_gengo", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/gengo", + sum = "h1:sAvhNk5RRuc6FNYGqe7Ygz3PSo/2wGWbulskmzRX8Vs=", + version = "v0.0.0-20200413195148-3a45101e95ac", + ) + go_repository( + name = "io_k8s_klog_v2", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/klog/v2", + sum = "h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ=", + version = "v2.70.1", + ) + go_repository( + name = "io_k8s_kube_openapi", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/kube-openapi", + sum = "h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA=", + version = "v0.0.0-20220803162953-67bda5d908f1", + ) + go_repository( + name = "io_k8s_sigs_json", + build_file_proto_mode = "disable_global", + importpath = "sigs.k8s.io/json", + sum = "h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=", + version = "v0.0.0-20220713155537-f223a00ba0e2", + ) + go_repository( + name = "io_k8s_sigs_structured_merge_diff_v4", + build_file_proto_mode = "disable_global", + importpath = "sigs.k8s.io/structured-merge-diff/v4", + sum = "h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=", + version = "v4.2.3", + ) + go_repository( + name = "io_k8s_sigs_yaml", + build_file_proto_mode = "disable_global", + importpath = "sigs.k8s.io/yaml", + sum = "h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=", + version = "v1.2.0", + ) + go_repository( + name = "io_k8s_utils", + build_file_proto_mode = "disable_global", + importpath = "k8s.io/utils", + sum = "h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4=", + version = "v0.0.0-20220728103510-ee6ede2d64ed", + ) + go_repository( + name = "io_opencensus_go", + build_file_proto_mode = "disable_global", + importpath = "go.opencensus.io", + sum = "h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=", + version = "v0.22.4", + ) + go_repository( + name = "io_opentelemetry_go_otel", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel", + sum = "h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_jaeger", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/exporters/jaeger", + sum = "h1:Sv2valcFfMlfu6g8USSS+ZUN5vwbuGj1aY/CFtMG33w=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_otlp_internal_retry", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/exporters/otlp/internal/retry", + sum = "h1:0dly5et1i/6Th3WHn0M6kYiJfFNzhhxanrJ0bOfnjEo=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_otlp_otlptrace", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/exporters/otlp/otlptrace", + sum = "h1:eyJ6njZmH16h9dOKCi7lMswAnGsSOwgTqWzfxqcuNr8=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracegrpc", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc", + sum = "h1:j2RFV0Qdt38XQ2Jvi4WIsQ56w8T7eSirYbMw19VXRDg=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_zipkin", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/exporters/zipkin", + sum = "h1:v/Abo5REOWrCj4zcEIUHFZtXpsCVjrwZj28iyX2rHXE=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_sdk", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/sdk", + sum = "h1:ZnKIL9V9Ztaq+ME43IUi/eo22mNsb6a7tGfzaOWB5fo=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_trace", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/trace", + sum = "h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI=", + version = "v1.11.0", + ) + go_repository( + name = "io_opentelemetry_go_proto_otlp", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/proto/otlp", + sum = "h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=", + version = "v0.19.0", + ) + go_repository( + name = "io_rsc_binaryregexp", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/binaryregexp", + sum = "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=", + version = "v0.2.0", + ) + go_repository( + name = "io_rsc_quote_v3", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/quote/v3", + sum = "h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY=", + version = "v3.1.0", + ) + go_repository( + name = "io_rsc_sampler", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/sampler", + sum = "h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=", + version = "v1.3.0", + ) + go_repository( + name = "org_golang_google_api", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/api", + sum = "h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w=", + version = "v0.30.0", + ) + go_repository( + name = "org_golang_google_appengine", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/appengine", + sum = "h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=", + version = "v1.6.7", + ) + go_repository( + name = "org_golang_google_genproto", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/genproto", + sum = "h1:qRu95HZ148xXw+XeZ3dvqe85PxH4X8+jIo0iRPKcEnM=", + version = "v0.0.0-20220602131408-e326c6e8e9c8", + ) + go_repository( + name = "org_golang_google_grpc", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/grpc", + sum = "h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=", + version = "v1.51.0", + ) + go_repository( + name = "org_golang_google_protobuf", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/protobuf", + sum = "h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=", + version = "v1.28.1", + ) + + go_repository( + name = "org_golang_x_crypto", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/crypto", + sum = "h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=", + version = "v0.0.0-20220622213112-05595931fe9d", + ) + go_repository( + name = "org_golang_x_exp", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/exp", + sum = "h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y=", + version = "v0.0.0-20200224162631-6cc2880d07d6", + ) + go_repository( + name = "org_golang_x_image", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/image", + sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=", + version = "v0.0.0-20190802002840-cff245a6509b", + ) + go_repository( + name = "org_golang_x_lint", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/lint", + sum = "h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=", + version = "v0.0.0-20210508222113-6edffad5e616", + ) + go_repository( + name = "org_golang_x_mobile", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/mobile", + sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=", + version = "v0.0.0-20190719004257-d2bd2a29d028", + ) + + go_repository( + name = "org_golang_x_mod", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/mod", + sum = "h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=", + version = "v0.7.0", + ) + go_repository( + name = "org_golang_x_net", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/net", + sum = "h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk=", + version = "v0.3.0", + ) + go_repository( + name = "org_golang_x_oauth2", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/oauth2", + sum = "h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg=", + version = "v0.0.0-20220223155221-ee480838109b", + ) + + go_repository( + name = "org_golang_x_sync", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/sync", + sum = "h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=", + version = "v0.1.0", + ) + go_repository( + name = "org_golang_x_sys", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/sys", + sum = "h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=", + version = "v0.3.0", + ) + go_repository( + name = "org_golang_x_term", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/term", + sum = "h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=", + version = "v0.3.0", + ) + + go_repository( + name = "org_golang_x_text", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/text", + sum = "h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=", + version = "v0.5.0", + ) + go_repository( + name = "org_golang_x_time", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/time", + sum = "h1:+gHMid33q6pen7kv9xvT+JRinntgeXO2AeZVd0AWD3w=", + version = "v0.0.0-20220411224347-583f2d630306", + ) + + go_repository( + name = "org_golang_x_tools", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/tools", + sum = "h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4=", + version = "v0.4.0", + ) + go_repository( + name = "org_golang_x_xerrors", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/xerrors", + sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=", + version = "v0.0.0-20200804184101-5ec99f83aff1", + ) + go_repository( + name = "org_modernc_cc_v3", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/cc/v3", + sum = "h1:0kmRkTmqNidmu3c7BNDSdVHCxXCkWLmWmCIVX4LUboo=", + version = "v3.36.0", + ) + go_repository( + name = "org_modernc_ccgo_v3", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/ccgo/v3", + sum = "h1:3l18poV+iUemQ98O3X5OMr97LOqlzis+ytivU4NqGhA=", + version = "v3.16.6", + ) + go_repository( + name = "org_modernc_ccorpus", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/ccorpus", + sum = "h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=", + version = "v1.11.6", + ) + go_repository( + name = "org_modernc_httpfs", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/httpfs", + sum = "h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=", + version = "v1.0.6", + ) + go_repository( + name = "org_modernc_libc", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/libc", + sum = "h1:Ux98PaOMvolgoFX/YwusFOHBnanXdGRmWgI8ciI2z4o=", + version = "v1.16.8", + ) + go_repository( + name = "org_modernc_mathutil", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/mathutil", + sum = "h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8=", + version = "v1.4.1", + ) + go_repository( + name = "org_modernc_memory", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/memory", + sum = "h1:bDOL0DIDLQv7bWhP3gMvIrnoFw+Eo6F7a2QK9HPDiFU=", + version = "v1.1.1", + ) + go_repository( + name = "org_modernc_opt", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/opt", + sum = "h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A=", + version = "v0.1.1", + ) + go_repository( + name = "org_modernc_sqlite", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/sqlite", + sum = "h1:TjmF36Wi5QcPYqRoAacV1cAyJ7xB/CD0ExpVUEMebnw=", + version = "v1.17.2", + ) + go_repository( + name = "org_modernc_strutil", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/strutil", + sum = "h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs=", + version = "v1.1.1", + ) + go_repository( + name = "org_modernc_tcl", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/tcl", + sum = "h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao=", + version = "v1.13.1", + ) + go_repository( + name = "org_modernc_token", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/token", + sum = "h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk=", + version = "v1.0.0", + ) + go_repository( + name = "org_modernc_z", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/z", + sum = "h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM=", + version = "v1.5.1", + ) + go_repository( + name = "org_mongodb_go_mongo_driver", + build_file_proto_mode = "disable_global", + importpath = "go.mongodb.org/mongo-driver", + sum = "h1:XDQEvmh6z1EUsXuIkXE9TaVeqHw6SwS1uf93jFs0HBA=", + version = "v1.10.3", + ) + go_repository( + name = "org_uber_go_atomic", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/atomic", + sum = "h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=", + version = "v1.9.0", + ) + go_repository( + name = "org_uber_go_automaxprocs", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/automaxprocs", + sum = "h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk=", + version = "v1.5.1", + ) + go_repository( + name = "org_uber_go_goleak", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/goleak", + sum = "h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=", + version = "v1.2.0", + ) + go_repository( + name = "org_uber_go_multierr", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/multierr", + sum = "h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=", + version = "v1.8.0", + ) + go_repository( + name = "org_uber_go_zap", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/zap", + sum = "h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=", + version = "v1.21.0", + ) + go_repository( + name = "com_github_deckarep_golang_set", + build_file_proto_mode = "disable_global", + importpath = "github.com/deckarep/golang-set", + sum = "h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4=", + version = "v1.8.0", + ) diff --git a/external/godel.BUILD b/external/godel.BUILD new file mode 100644 index 00000000..1e9e12ea --- /dev/null +++ b/external/godel.BUILD @@ -0,0 +1,5 @@ +filegroup( + name = "all", + srcs = glob(["usr/**/*"]) + ["version.txt"], + visibility = ["//visibility:public"], +) diff --git a/external/rules_jvm_external/BUILD b/external/rules_jvm_external/BUILD new file mode 100644 index 00000000..e69de29b diff --git a/external/rules_jvm_external/versions.bzl.patch b/external/rules_jvm_external/versions.bzl.patch new file mode 100644 index 00000000..ddc28db9 --- /dev/null +++ b/external/rules_jvm_external/versions.bzl.patch @@ -0,0 +1,32 @@ +diff --git private/versions.bzl private/versions.bzl +--- private/versions.bzl ++++ private/versions.bzl +@@ -1,23 +1,24 @@ + _COURSIER_CLI_VERSION = "v2.0.16" + + COURSIER_CLI_HTTP_FILE_NAME = ("coursier_cli_" + _COURSIER_CLI_VERSION).replace(".", "_").replace("-", "_") +-COURSIER_CLI_GITHUB_ASSET_URL = "https://github.com/coursier/coursier/releases/download/{COURSIER_CLI_VERSION}/coursier.jar".format(COURSIER_CLI_VERSION = _COURSIER_CLI_VERSION) + ++COURSIER_CLI_GITHUB_ASSET_URL = "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/java/coursier/{COURSIER_CLI_VERSION}/coursier.jar".format(COURSIER_CLI_VERSION = _COURSIER_CLI_VERSION) ++ + # Run 'bazel run //:mirror_coursier' to upload a copy of the jar to the Bazel mirror. + COURSIER_CLI_BAZEL_MIRROR_URL = "https://mirror.bazel.build/coursier_cli/" + COURSIER_CLI_HTTP_FILE_NAME + ".jar" + COURSIER_CLI_SHA256 = "076de041cbebc0a1272b84f1e69f6da5df4961847850b95cb3dfa3f776145225" + + JQ_VERSIONS = { + "linux": struct( +- url = "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64", ++ url = "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/java/jq/1.6/jq-linux64", + sha256 = "af986793a515d500ab2d35f8d2aecd656e764504b789b66d7e1a0b727a124c44", + ), + "macos": struct( +- url = "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64", ++ url = "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/java/jq/1.6/jq-osx-amd64", + sha256 = "5c0a0a3ea600f302ee458b30317425dd9632d1ad8882259fcaf4e9b868b2b1ef", + ), + "windows": struct( +- url = "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe", ++ url = "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/java/jq/1.6/jq-win64.exe", + sha256 = "a51d36968dcbdeabb3142c6f5cf9b401a65dc3a095f3144bd0c118d5bb192753", + ), + } diff --git a/external/rules_python/BUILD b/external/rules_python/BUILD new file mode 100644 index 00000000..e69de29b diff --git a/external/rules_python/repositories.bzl.patch b/external/rules_python/repositories.bzl.patch new file mode 100644 index 00000000..f1a2be9b --- /dev/null +++ b/external/rules_python/repositories.bzl.patch @@ -0,0 +1,51 @@ +diff --git python/pip_install/repositories.bzl python/pip_install/repositories.bzl +--- python/pip_install/repositories.bzl ++++ python/pip_install/repositories.bzl +@@ -9,12 +9,12 @@ _RULE_DEPS = [ + _RULE_DEPS = [ + ( + "pypi__click", +- "https://files.pythonhosted.org/packages/76/0a/b6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86/click-8.0.1-py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/click-8.0.1-py3-none-any.whl", + "fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6", + ), + ( + "pypi__colorama", +- "https://files.pythonhosted.org/packages/44/98/5b86278fbbf250d239ae0ecb724f8572af1c91f4a11edf4d36a206189440/colorama-0.4.4-py2.py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/colorama-0.4.4-py2.py3-none-any.whl", + "9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2", + ), + ( +@@ -29,27 +29,27 @@ _RULE_DEPS = [ + ), + ( + "pypi__pip", +- "https://files.pythonhosted.org/packages/96/2f/caec18213f6a67852f6997fb0673ae08d2e93d1b81573edb93ba4ef06970/pip-22.1.2-py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/pip-22.1.2-py3-none-any.whl", + "a3edacb89022ef5258bf61852728bf866632a394da837ca49eb4303635835f17", + ), + ( + "pypi__pip_tools", +- "https://files.pythonhosted.org/packages/fe/5c/8995799b0ccf832906b4968b4eb2045beb9b3de79e96e6b1a6e4fc4e6974/pip_tools-6.6.2-py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/pip_tools-6.6.2-py3-none-any.whl", + "6b486548e5a139e30e4c4a225b3b7c2d46942a9f6d1a91143c21b1de4d02fd9b", + ), + ( + "pypi__setuptools", +- "https://files.pythonhosted.org/packages/7c/5b/3d92b9f0f7ca1645cba48c080b54fe7d8b1033a4e5720091d1631c4266db/setuptools-60.10.0-py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/setuptools-60.10.0-py3-none-any.whl", + "782ef48d58982ddb49920c11a0c5c9c0b02e7d7d1c2ad0aa44e1a1e133051c96", + ), + ( + "pypi__tomli", +- "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/tomli-2.0.1-py3-none-any.whl", + "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + ), + ( + "pypi__wheel", +- "https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl", ++ "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/python/pip_deps/wheel-0.37.1-py2.py3-none-any.whl", + "4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a", + ), + ] diff --git a/junit5.bzl b/junit5.bzl new file mode 100644 index 00000000..7063ab6d --- /dev/null +++ b/junit5.bzl @@ -0,0 +1,107 @@ +"""External dependencies & java_junit5_test rule""" + +load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") + +JUNIT_JUPITER_GROUP_ID = "org.junit.jupiter" +JUNIT_JUPITER_ARTIFACT_ID_LIST = [ + "junit-jupiter-api", + "junit-jupiter-engine", + "junit-jupiter-params", +] + +JUNIT_PLATFORM_GROUP_ID = "org.junit.platform" +JUNIT_PLATFORM_ARTIFACT_ID_LIST = [ + "junit-platform-commons", + "junit-platform-console", + "junit-platform-engine", + "junit-platform-launcher", + "junit-platform-suite-api", +] + +JUNIT_EXTRA_DEPENDENCIES = [ + ("org.apiguardian", "apiguardian-api", "1.0.0"), + ("org.opentest4j", "opentest4j", "1.1.1"), +] + +def junit_jupiter_java_repositories( + version = "5.9.1"): + """Imports dependencies for JUnit Jupiter""" + for artifact_id in JUNIT_JUPITER_ARTIFACT_ID_LIST: + jvm_maven_import_external( + name = _format_maven_jar_name(JUNIT_JUPITER_GROUP_ID, artifact_id), + artifact = "%s:%s:%s" % ( + JUNIT_JUPITER_GROUP_ID, + artifact_id, + version, + ), + server_urls = ["https://repo1.maven.org/maven2"], + licenses = ["notice"], # EPL 2.0 License + ) + + for t in JUNIT_EXTRA_DEPENDENCIES: + jvm_maven_import_external( + name = _format_maven_jar_name(t[0], t[1]), + artifact = "%s:%s:%s" % t, + server_urls = ["https://repo1.maven.org/maven2"], + licenses = ["notice"], # EPL 2.0 License + ) + +def junit_platform_java_repositories( + version = "1.9.1"): + """Imports dependencies for JUnit Platform""" + for artifact_id in JUNIT_PLATFORM_ARTIFACT_ID_LIST: + jvm_maven_import_external( + name = _format_maven_jar_name(JUNIT_PLATFORM_GROUP_ID, artifact_id), + artifact = "%s:%s:%s" % ( + JUNIT_PLATFORM_GROUP_ID, + artifact_id, + version, + ), + server_urls = ["https://repo1.maven.org/maven2"], + licenses = ["notice"], # EPL 2.0 License + ) + +def java_junit5_test(name, srcs, test_package, deps = [], runtime_deps = [], **kwargs): + FILTER_KWARGS = [ + "main_class", + "use_testrunner", + "args", + ] + + for arg in FILTER_KWARGS: + if arg in kwargs.keys(): + kwargs.pop(arg) + + junit_console_args = [] + if test_package: + junit_console_args += ["--select-package", test_package] + else: + fail("must specify 'test_package'") + + native.java_test( + name = name, + srcs = srcs, + use_testrunner = False, + main_class = "org.junit.platform.console.ConsoleLauncher", + args = junit_console_args, + deps = deps + [ + _format_maven_jar_dep_name(JUNIT_JUPITER_GROUP_ID, artifact_id) + for artifact_id in JUNIT_JUPITER_ARTIFACT_ID_LIST + ] + [ + _format_maven_jar_dep_name(JUNIT_PLATFORM_GROUP_ID, "junit-platform-suite-api"), + ] + [ + _format_maven_jar_dep_name(t[0], t[1]) + for t in JUNIT_EXTRA_DEPENDENCIES + ], + runtime_deps = runtime_deps + [ + _format_maven_jar_dep_name(JUNIT_PLATFORM_GROUP_ID, artifact_id) + for artifact_id in JUNIT_PLATFORM_ARTIFACT_ID_LIST + ], + **kwargs + ) + +def _format_maven_jar_name(group_id, artifact_id): + return ("%s_%s" % (group_id, artifact_id)).replace(".", "_").replace("-", "_") + +def _format_maven_jar_dep_name(group_id, artifact_id): + return "@%s//jar" % _format_maven_jar_name(group_id, artifact_id) diff --git a/language/BUILD b/language/BUILD new file mode 100644 index 00000000..9906a0a4 --- /dev/null +++ b/language/BUILD @@ -0,0 +1,6 @@ +package(default_visibility = ["//visibility:public"]) + +package_group( + name = "default_visibility", + packages = ["//language/..."], +) diff --git a/language/cfamily/BUILD b/language/cfamily/BUILD new file mode 100644 index 00000000..d5335f80 --- /dev/null +++ b/language/cfamily/BUILD @@ -0,0 +1,15 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob(["lib-03/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/cfamily/extractor/BUILD b/language/cfamily/extractor/BUILD new file mode 100644 index 00000000..e18be8c5 --- /dev/null +++ b/language/cfamily/extractor/BUILD @@ -0,0 +1,157 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +package( + default_visibility = ["//language:default_visibility"], +) + +cc_library( + name = "build-coref-files", + srcs = glob(["Coref/**/*.cpp"]), + hdrs = glob(["Coref/**/*.hpp"]), + includes = [""], + linkstatic = 1, + visibility = ["//visibility:public"], + deps = [ + "@llvm-project//clang:ast", + "@llvm-project//clang:basic", + ], +) + +cc_library( + name = "build-ast-files", + srcs = glob(["AST/**/*.cpp"]), + hdrs = glob(["AST/**/*.hpp"]) + [ + "Coref/SignatureGenerator.hpp", + "Coref/CorefUri.hpp", + "Coref/Utils/Switcher.h", + ], + includes = ["AST"], + linkstatic = 1, + visibility = ["//visibility:public"], + deps = [ + ":digestpp", + ":storage", + "@llvm-project//clang:ast", + "@llvm-project//clang:tooling", + ], +) + +cc_library( + name = "sqlite_orm", + hdrs = [ + "ThirdParty/sqlite_orm/sqlite_orm.h", + ], + linkstatic = 1, + visibility = ["//visibility:public"], +) + +cc_library( + name = "digestpp", + hdrs = glob([ + "ThirdParty/digestpp/**/*.hpp", + ]), + linkstatic = 1, + visibility = ["//visibility:public"], +) + +cc_library( + name = "model", + hdrs = [ + ":generate-headers", + ], + linkstatic = 1, +) + +cc_library( + name = "storage", + srcs = glob(["Storage/*.cpp"]), + hdrs = glob(["Storage/*.hpp"]) + [ + "Coref/CorefDef.hpp", + ":generate-headers", + ], + linkstatic = 1, + deps = [ + ":build-coref-files", + ":model", + ":sqlite_orm", + "@com_github_rockwotj_sqlite_bazel//:sqlite3", + ], +) + +filegroup( + name = "generate_headers_script", + srcs = [ + "Tools/generate_headers.py", + ], +) + +filegroup( + name = "j2-templates", + srcs = glob(["**/*.j2"]), +) + +# This rule will +# 1. run script to generate headers to source code directory +# 2. copy them to bazel sandbox directory in order to be built +genrule( + name = "generate-headers", + srcs = [ + "//language/cfamily/extractor:generate_headers_script", + ":j2-templates", + "coref_er_diagram.puml", + ], + outs = [ + "Model/Models.hpp", + # Storage/StorageFacade.hpp needs to use #include "Storage.hpp" from its current dir + # In order not to break CMAKE build, output Storage.hpp instead of Storage/Storage.hpp + "Storage.hpp", + ], + cmd = " &&".join([ + "python3 -m pip install --user -r $$(dirname $(location //language/cfamily/extractor:generate_headers_script))/requirements.txt", + "python3 $(location //language/cfamily/extractor:generate_headers_script)", + "cp $$(dirname $(location //language/cfamily/extractor:generate_headers_script))/../Model/Models.hpp $(location Model/Models.hpp)", + "cp $$(dirname $(location //language/cfamily/extractor:generate_headers_script))/../Storage/Storage.hpp $(location Storage.hpp)", + ]), + message = "Generating files from jinja template for C++ model headers", +) + +# This rule will copy Clang header files to /usr/lib/clang//include +# where CLANG_VERSION is configured by parsing bazel-bin/external/llvm-project/clang/include/clang/Basic/Version.inc file +genrule( + name = "copy-clang-builtin-headers", + srcs = [ + "@llvm-project//clang:basic_version_gen", + "@llvm-project//clang:builtin_headers_gen", + ], + outs = [ + "usr/lib/clang", + ], + cmd = """ + CLANG_VERSION_STRING=$$(grep $(location @llvm-project//clang:basic_version_gen) -e 'CLANG_VERSION_STRING') + CLANG_VERSION=$$(echo $$CLANG_VERSION_STRING | awk -F' ' '{print $$3}') + CLANG_VERSION=$$(eval echo $$CLANG_VERSION) # strip double quote + mkdir -p $@/$${CLANG_VERSION} + cp -r $$(dirname $(location @llvm-project//clang:basic_version_gen))/../../../staging/include $@/$${CLANG_VERSION} + """, + message = "Copy Clang header files to /usr/lib/clang//include", + visibility = ["//visibility:public"], +) + +cc_binary( + # Build binary under /usr/bin directory + name = "usr/bin/coref-cfamily-src-extractor", + srcs = ["main.cpp"], + data = [":copy-clang-builtin-headers"], + visibility = ["//visibility:public"], + deps = [ + ":build-ast-files", + ":build-coref-files", + ":storage", + ], +) + +alias( + name = "coref-cfamily-src-extractor", + actual = "usr/bin/coref-cfamily-src-extractor", + visibility = ["//visibility:public"], +) diff --git a/language/java/BUILD b/language/java/BUILD new file mode 100644 index 00000000..91bc7575 --- /dev/null +++ b/language/java/BUILD @@ -0,0 +1,27 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob(["lib-03/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib-1.0-append", + srcs = glob(["lib-1.0/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib-1.0-replace", + srcs = glob(["lib-1.0-replace/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/java/extractor/BUILD b/language/java/extractor/BUILD new file mode 100644 index 00000000..4a1d0bb8 --- /dev/null +++ b/language/java/extractor/BUILD @@ -0,0 +1,130 @@ +# add lombok annotation processor +java_import( + name = "lombok_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar", + ], +) + +java_plugin( + name = "lombok_processor", + # should be specified + processor_class = "lombok.launch.AnnotationProcessorHider$AnnotationProcessor", + deps = [ + ":lombok_jar", + ], +) + +# add picocli annotation processor +java_import( + name = "picocli_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/info/picocli/picocli/4.6.1/picocli-4.6.1.jar", + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/info/picocli/picocli-codegen/4.6.1/picocli-codegen-4.6.1.jar", + ], +) + +java_plugin( + name = "picocli_processor", + processor_class = "picocli.codegen.aot.graalvm.processor.NativeImageConfigGeneratorProcessor", + # processor_class = "picocli.codegen.aot.graalvm.processor.AbstractCompositeGeneratorProcessor", + deps = [ + ":picocli_jar", + ], +) + +# all in one exported processors library +java_library( + name = "all_processors", + exported_plugins = [ + ":lombok_processor", + ":picocli_processor", + ], + tags = ["maven:compile_only"], + exports = [ + "@maven//:info_picocli_picocli_codegen", + "@maven//:org_projectlombok_lombok", + ], +) + +java_library( + name = "util", + srcs = glob(["src/main/java/com/alipay/codequery/util/*.java"]), + deps = [ + "@maven//:org_apache_logging_log4j_log4j_api", + "@maven//:org_apache_logging_log4j_log4j_core", + "@maven//:org_apache_logging_log4j_log4j_slf4j_impl", + "@maven//:org_jetbrains_annotations", + "@maven//:org_jetbrains_kotlin_kotlin_compiler_embeddable", + "@maven//:org_jetbrains_kotlin_kotlin_reflect", + "@maven//:org_jetbrains_kotlin_kotlin_script_runtime", + "@maven//:org_jetbrains_kotlin_kotlin_stdlib", + "@maven//:org_slf4j_slf4j_api", + ], +) + +java_binary( + name = "coref-java-src-extractor", + srcs = glob(["src/main/java/**/*.java"]), + main_class = "com.alipay.codequery.Extractor", + resources = glob(["src/main/resources/**/*"]), + visibility = ["//visibility:public"], + deps = [ + ":all_processors", + ":util", + "@maven//:com_alibaba_fastjson", + "@maven//:com_aliyun_oss_aliyun_sdk_oss", + "@maven//:com_google_code_gson_gson", + "@maven//:com_google_guava_guava", + "@maven//:com_google_re2j_re2j", + "@maven//:com_ibm_icu_icu4j", + "@maven//:commons_codec_commons_codec", + "@maven//:commons_collections_commons_collections", + "@maven//:commons_io_commons_io", + "@maven//:info_picocli_picocli", + "@maven//:javax_annotation_javax_annotation_api", + "@maven//:me_tongfei_progressbar", + "@maven//:net_java_dev_jna_jna", + "@maven//:org_apache_commons_commons_compress", + "@maven//:org_apache_commons_commons_lang3", + "@maven//:org_apache_logging_log4j_log4j_api", + "@maven//:org_apache_logging_log4j_log4j_core", + "@maven//:org_apache_logging_log4j_log4j_slf4j_impl", + "@maven//:org_hamcrest_hamcrest_all", + "@maven//:org_ini4j_ini4j", + "@maven//:org_jetbrains_annotations", + "@maven//:org_jetbrains_kotlin_kotlin_compiler_embeddable", + "@maven//:org_jetbrains_kotlin_kotlin_reflect", + "@maven//:org_jetbrains_kotlin_kotlin_script_runtime", + "@maven//:org_jetbrains_kotlin_kotlin_stdlib", + "@maven//:org_mybatis_dynamic_sql_mybatis_dynamic_sql", + "@maven//:org_mybatis_mybatis", + "@maven//:org_projectlombok_lombok", + "@maven//:org_slf4j_slf4j_api", + "@maven//:org_xerial_sqlite_jdbc", + "@maven//:tk_mybatis_mapper", + "@maven//:uk_com_robust_it_cloning", + ], +) + +genrule( + name = "mybatis-generate", + srcs = [ + "src/main/resources/coref_java_src.db", + "src/main/resources/coref_db_ddl.sql", + "src/main/resources/generatorConfig.xml", + ], + outs = [ + "mybatis-generate.txt", + ], + cmd = """ + FOO_PATH=`pwd` + cd language/java/extractor + java -cp $$FOO_PATH/$(location @maven//:org_xerial_sqlite_jdbc):$$FOO_PATH/$(location @maven//:org_mybatis_generator_mybatis_generator_core) org.mybatis.generator.api.ShellRunner -configfile src/main/resources/generatorConfig.xml -overwrite && touch mybatis-generate.txt && mv mybatis-generate.txt ../../../$@ + """, + tools = [ + "@maven//:org_mybatis_generator_mybatis_generator_core", + "@maven//:org_xerial_sqlite_jdbc", + ], +) + diff --git a/language/java/extractor/src/main/resources/generatorConfig.xml b/language/java/extractor/src/main/resources/generatorConfig.xml index 0e711ee6..92df386a 100644 --- a/language/java/extractor/src/main/resources/generatorConfig.xml +++ b/language/java/extractor/src/main/resources/generatorConfig.xml @@ -39,7 +39,7 @@ - + @@ -47,15 +47,15 @@ - + - - + diff --git a/language/javascript/BUILD b/language/javascript/BUILD new file mode 100644 index 00000000..91bc7575 --- /dev/null +++ b/language/javascript/BUILD @@ -0,0 +1,27 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob(["lib-03/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib-1.0-append", + srcs = glob(["lib-1.0/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib-1.0-replace", + srcs = glob(["lib-1.0-replace/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/javascript/extractor/BUILD b/language/javascript/extractor/BUILD new file mode 100644 index 00000000..4ac5e57d --- /dev/null +++ b/language/javascript/extractor/BUILD @@ -0,0 +1,184 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_package_bin") +load("@npm//@bazel/typescript:index.bzl", "ts_project") +load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") + +# Declare a naive ts_project just to install dependencies +ts_project( + name = "ts-a", + srcs = [ + "package.json", + ], + declaration = True, + link_workspace_root = False, + tsconfig = { + "include": [ + "package.json", + ], + "exclude": [ + "**/node_modules/**/*", + ], + }, + validate = False, + deps = [ + "@npm//@bazel/typescript", + "@npm//@prisma/client", + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/node", + "@npm//@types/shelljs", + "@npm//@typescript-eslint/eslint-plugin", + "@npm//@typescript-eslint/parser", + "@npm//commander", + "@npm//eslint", + "@npm//ignore", + "@npm//jest", + "@npm//lodash", + "@npm//pkg", + "@npm//prettier", + "@npm//prisma", + "@npm//shelljs", + "@npm//ts-jest", + "@npm//ts-node", + "@npm//typescript", + "@npm//typescript-latest", + ], +) + +copy_to_bin( + name = "copy-prisma-schema", + srcs = [ + "prisma/schema.prisma", + ], +) + +copy_to_bin( + name = "copy-package-json", + srcs = [ + "package.json", + ], +) + +genrule( + name = "prisma-postinstall", + srcs = [ + "@npm//@prisma/client", + "prisma/schema.prisma", + ":ts-a", + ":copy-prisma-schema", + ":copy-package-json", + ], + outs = [ + "prisma-postinstall-generated", + ], + cmd = """ + $(location @nodejs_host//:npx_bin) --prefix language/javascript/extractor prisma generate --schema language/javascript/extractor/prisma/schema.prisma + touch $@ + """, + tools = [ + "@nodejs_host//:npx_bin", + "@npm//prisma/bin:prisma", + ], +) + +genrule( + name = "prisma-db", + srcs = [ + "@npm//@prisma/client", + ":copy-prisma-schema", + ":copy-package-json", + ":prisma-postinstall", + ], + outs = [ + "init.db", + ], + cmd = """ + cd $(RULEDIR) + ../../../../../../$(location @npm//prisma/bin:prisma) db push --schema prisma/schema.prisma --skip-generate + """, + tools = [ + "@npm//prisma/bin:prisma", + ], +) + +genrule( + name = "ts-src", + srcs = glob(["src/**/*.ts"]) + [ + ":prisma-postinstall", + ":copy-package-json", + ":ts-a", + "yarn.lock", + "tsconfig.json", + ], + outs = [ + "dist", + ], + cmd = """ + $(location @npm//typescript-latest/bin:tsc) --project $(locations tsconfig.json) --outDir $@ + """, + tools = [ + "@nodejs_host//:npm_bin", + "@nodejs_host//:npx_bin", + "@npm//typescript-latest/bin:tsc", + ], +) + +# export environment variable PKG_CACHE_PATH, can be used by pkg, +# pkg will find the nodejs binary file from PKG_CACHE_PATH directory. +genrule( + name = "coref-javascript-src-extractor", + srcs = [ + ":ts-src", + ":prisma-db", + ":copy-package-json", + "@pkg_cache//:node-bin", + ], + outs = [ + "coref-javascript-src-extractor", + ], + cmd = """ + chmod 666 $(RULEDIR)/init.db + chmod -R 777 $(RULEDIR) + cp -r language/javascript/extractor/node_modules $(RULEDIR)/ + cp -r language/javascript/extractor/scripts $(RULEDIR)/ + $(location @nodejs_host//:node) $(RULEDIR)/scripts/fix-dot-prisma-client-package-json.js + export PKG_CACHE_PATH=$$(dirname $$(dirname $(execpaths @pkg_cache//:node-bin))) + echo $$PKG_CACHE_PATH + $(location @npm//pkg/bin:pkg) $(RULEDIR) -C GZip -t node18 --options max-old-space-size=7168 -o $@ + """, + executable = 1, + tools = [ + "@nodejs_host//:node", + "@npm//pkg/bin:pkg", + ], + visibility = ["//visibility:public"], +) + +# genrule( +# name = "coref-javascript-src-extractor", +# srcs = glob(["src/**/*.ts"]) + [ +# "prisma/schema.prisma", +# "package.json", +# "yarn.lock", +# "tsconfig.json", +# "@pkg_cache//:node-bin", +# ], +# outs = [ +# "coref-javascript-src-extractor", +# ], +# cmd = """ +# export PKG_CACHE_PATH=$$(dirname $$(dirname $(execpaths @pkg_cache//:node-bin))) +# echo $$PKG_CACHE_PATH +# $(location @yarn//:yarn_bin) --cwd language/javascript/extractor install +# $(location @yarn//:yarn_bin) --cwd language/javascript/extractor run build +# $(location @nodejs_host//:npx_bin) --prefix language/javascript/extractor prisma db push --schema language/javascript/extractor/prisma/schema.prisma +# $(location @nodejs_host//:npx_bin) --prefix language/javascript/extractor pkg language/javascript/extractor -C GZip -t node18 -o coref-javascript-src-extractor +# mv coref-javascript-src-extractor $@ +# """, +# tools = [ +# "@nodejs_host//:node", +# "@yarn//:yarn_bin", +# "@nodejs_host//:npx_bin", +# ], +# visibility = ["//visibility:public"], +# ) diff --git a/language/properties/BUILD b/language/properties/BUILD new file mode 100644 index 00000000..d5335f80 --- /dev/null +++ b/language/properties/BUILD @@ -0,0 +1,15 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob(["lib-03/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/properties/extractor/BUILD b/language/properties/extractor/BUILD new file mode 100644 index 00000000..ae05754b --- /dev/null +++ b/language/properties/extractor/BUILD @@ -0,0 +1,85 @@ +load("//:junit5.bzl", "java_junit5_test") + +# add lombok annotation processor +java_import( + name = "lombok_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar", + ], +) + +java_plugin( + name = "lombok_processor", + # should be specified + processor_class = "lombok.launch.AnnotationProcessorHider$AnnotationProcessor", + deps = [ + ":lombok_jar", + ], +) + +# add picocli annotation processor +java_import( + name = "picocli_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/info/picocli/picocli/4.6.1/picocli-4.6.1.jar", + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/info/picocli/picocli-codegen/4.6.1/picocli-codegen-4.6.1.jar", + ], +) + +java_plugin( + name = "picocli_processor", + processor_class = "picocli.codegen.aot.graalvm.processor.NativeImageConfigGeneratorProcessor", + # processor_class = "picocli.codegen.aot.graalvm.processor.AbstractCompositeGeneratorProcessor", + deps = [ + ":picocli_jar", + ], +) + +# all in one exported processors library +java_library( + name = "all_processors", + exported_plugins = [ + ":lombok_processor", + ":picocli_processor", + ], + tags = ["maven:compile_only"], + exports = [ + "@maven//:info_picocli_picocli_codegen", + "@maven//:org_projectlombok_lombok", + ], +) + +java_binary( + name = "coref-properties-src-extractor", + srcs = glob(["src/main/java/**/*.java"]), + main_class = "com.alipay.codequery.properties.Extractor", + resources = glob(["src/main/resources/**/*"]), + visibility = ["//visibility:public"], + deps = [ + ":all_processors", + "@maven//:com_google_code_gson_gson", + "@maven//:com_google_guava_guava", + "@maven//:com_google_re2j_re2j", + "@maven//:com_ibm_icu_icu4j", + "@maven//:commons_codec_commons_codec", + "@maven//:commons_io_commons_io", + "@maven//:info_picocli_picocli", + "@maven//:javax_annotation_javax_annotation_api", + "@maven//:javax_persistence_javax_persistence_api", + "@maven//:me_tongfei_progressbar", + "@maven//:net_java_dev_jna_jna", + "@maven//:org_apache_commons_commons_lang3", + "@maven//:org_apache_logging_log4j_log4j_api", + "@maven//:org_apache_logging_log4j_log4j_core", + "@maven//:org_apache_logging_log4j_log4j_slf4j_impl", + "@maven//:org_hamcrest_hamcrest_all", + "@maven//:org_ini4j_ini4j", + "@maven//:org_mybatis_dynamic_sql_mybatis_dynamic_sql", + "@maven//:org_mybatis_mybatis_3_5_7", + "@maven//:org_projectlombok_lombok", + "@maven//:org_slf4j_slf4j_api", + "@maven//:org_xerial_sqlite_jdbc", + "@maven//:tk_mybatis_mapper", + "@maven//:uk_com_robust_it_cloning", + ], +) diff --git a/language/python/BUILD b/language/python/BUILD new file mode 100644 index 00000000..1eae8614 --- /dev/null +++ b/language/python/BUILD @@ -0,0 +1,14 @@ + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob(["lib-03/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/python/extractor/BUILD b/language/python/extractor/BUILD new file mode 100644 index 00000000..6c2279cb --- /dev/null +++ b/language/python/extractor/BUILD @@ -0,0 +1,84 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +load("@rules_python//python:defs.bzl", "py_runtime_pair") + +load("@python3_10//:defs.bzl", "interpreter") + +py_runtime( + name = "my_py3_runtime", + python_version = "PY3", + interpreter = interpreter +) + +#py_runtime_pair( +# name = "my_py_runtime_pair", +# py3_runtime = ":my_py3_runtime", +#) +# +#toolchain( +# name = "my_toolchain", +# toolchain = ":my_py_runtime_pair", +# toolchain_type = "@rules_python//python:toolchain_type", +#) + +package( + default_visibility = ["//language:default_visibility"], +) + +load("@deps//:requirements.bzl", "requirement") + +load("@rules_python//python:defs.bzl", "py_library") + + +#py_binary( +# name = "coref-python-src-extractor1", +# srcs = glob(["src/**/*.py"], exclude=["**/tests/**"]), +# main = "src/main.py", +# visibility = ["//visibility:public"], +# deps = [ +# ":test", +# requirement("tqdm"), +# requirement("SQLAlchemy"), +# requirement("pyinstaller") +# ], +#) + +py_library( + name = "test", + srcs = glob(["src/**/*.py"], exclude=["**/tests/**"]), + visibility = ["//visibility:public"], + deps = [ + requirement("tqdm"), + requirement("SQLAlchemy"), + requirement("pyinstaller"), + ], +) + +filegroup( + name = "install_source", + srcs = [ + "src/auto_build.py", + ], +) + + +genrule( + name = "test1", + srcs = [ + "//language/python/extractor:install_source", + ":test", + ], + outs = ["coref-python-src-extractor"], + cmd = """ + chmod -R 755 $$(dirname $(PYTHON3))/../lib/python3.10/site-packages + $(PYTHON3) -m pip install pyinstaller -i https://pypi.antfin-inc.com/simple + $(PYTHON3) -m pip install sqlalchemy -i https://pypi.antfin-inc.com/simple + cp language/python/extractor/src/resources/hook-_tkinter.py $$(dirname $(PYTHON3))/../lib/python3.10/site-packages/PyInstaller/hooks/hook-_tkinter.py + $(PYTHON3) $(locations //language/python/extractor:install_source) + cp language/python/extractor/src/dist/coref-python-src-extractor $(RULEDIR) + """, + toolchains=["@rules_python//python:current_py_toolchain",], + visibility = ["//visibility:public"], +) + + diff --git a/language/python/extractor/requirements.txt b/language/python/extractor/requirements.txt index fe8c65a9..715aec5a 100644 --- a/language/python/extractor/requirements.txt +++ b/language/python/extractor/requirements.txt @@ -1,3 +1,4 @@ +-i https://pypi.antfin-inc.com/simple SQLAlchemy~=1.4.32 tqdm~=4.64.0 diff --git a/language/python/extractor/src/auto_build.py b/language/python/extractor/src/auto_build.py new file mode 100644 index 00000000..1968cebf --- /dev/null +++ b/language/python/extractor/src/auto_build.py @@ -0,0 +1,13 @@ +import subprocess +import sys +import os + +print(sys.platform) +print(os.getcwd()) +src_path = os.path.join(sys.path[0], "main.spec") +current_dir = sys.path[0] +os.chdir(current_dir) +print(os.getcwd()) + +py_path = os.path.join(os.path.dirname(sys.executable), "pyinstaller") +subprocess.call([py_path, src_path]) diff --git a/language/python/extractor/src/main.spec b/language/python/extractor/src/main.spec new file mode 100644 index 00000000..d867ec08 --- /dev/null +++ b/language/python/extractor/src/main.spec @@ -0,0 +1,40 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis(['main.py'], + pathex=[], + binaries=[], + datas=[('resources', 'resources')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='coref-python-src-extractor', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) diff --git a/language/python/extractor/src/resources/hook-_tkinter.py b/language/python/extractor/src/resources/hook-_tkinter.py new file mode 100644 index 00000000..5428ca3d --- /dev/null +++ b/language/python/extractor/src/resources/hook-_tkinter.py @@ -0,0 +1,29 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 2013-2022, PyInstaller Development Team. +# +# Distributed under the terms of the GNU General Public License (version 2 +# or later) with exception for distributing the bootloader. +# +# The full license is in the file COPYING.txt, distributed with this software. +# +# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) +#----------------------------------------------------------------------------- + +import sys + +from PyInstaller import compat +from PyInstaller.utils.hooks import logger +from PyInstaller.utils.hooks.tcl_tk import collect_tcl_tk_files + + +def hook(hook_api): + # Use a hook-function to get the module's attr:`__file__` easily. + """ + Freeze all external Tcl/Tk data files if this is a supported platform *or* log a non-fatal error otherwise. + """ + # if compat.is_win or compat.is_darwin or compat.is_unix: + # # collect_tcl_tk_files() returns a Tree, so we need to store it into `hook_api.datas` in order to prevent + # # `building.imphook.format_binaries_and_datas` from crashing with "too many values to unpack". + # hook_api.add_datas(collect_tcl_tk_files(hook_api.__file__)) + # else: + logger.error("... skipping Tcl/Tk handling on unsupported platform %s", sys.platform) diff --git a/language/sql/BUILD b/language/sql/BUILD new file mode 100644 index 00000000..cea95663 --- /dev/null +++ b/language/sql/BUILD @@ -0,0 +1,18 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob( + ["lib-03/**/*"], + exclude = ["lib-03/**/*.j2"], + ), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/sql/extractor/BUILD b/language/sql/extractor/BUILD new file mode 100644 index 00000000..427caba2 --- /dev/null +++ b/language/sql/extractor/BUILD @@ -0,0 +1,100 @@ +load("//:junit5.bzl", "java_junit5_test") + +# add lombok annotation processor +java_import( + name = "lombok_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar", + ], +) + +java_plugin( + name = "lombok_processor", + # should be specified + processor_class = "lombok.launch.AnnotationProcessorHider$AnnotationProcessor", + deps = [ + ":lombok_jar", + ], +) + +# add picocli annotation processor +java_import( + name = "picocli_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/info/picocli/picocli/4.6.1/picocli-4.6.1.jar", + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/info/picocli/picocli-codegen/4.6.1/picocli-codegen-4.6.1.jar", + ], +) + +java_plugin( + name = "picocli_processor", + processor_class = "picocli.codegen.aot.graalvm.processor.NativeImageConfigGeneratorProcessor", + # processor_class = "picocli.codegen.aot.graalvm.processor.AbstractCompositeGeneratorProcessor", + deps = [ + ":picocli_jar", + ], +) + +# all in one exported processors library +java_library( + name = "all_processors", + exported_plugins = [ + ":lombok_processor", + ":picocli_processor", + ], + tags = ["maven:compile_only"], + exports = [ + "@maven//:info_picocli_picocli_codegen", + "@maven//:org_projectlombok_lombok", + ], +) + +java_library( + name = "util", + srcs = glob(["src/main/java/com/alipay/codequery/util/*.java"]), + deps = [ + "@maven//:org_apache_commons_commons_lang3", + "@maven//:org_apache_logging_log4j_log4j_api", + "@maven//:org_apache_logging_log4j_log4j_core", + "@maven//:org_apache_logging_log4j_log4j_slf4j_impl", + "@maven//:org_jetbrains_annotations", + "@maven//:org_slf4j_slf4j_api", + ], +) + +java_binary( + name = "coref-sql-src-extractor", + srcs = glob(["src/main/java/**/*.java"]), + main_class = "com.alipay.codequery.coref.sql.Extractor", + resources = glob(["src/main/resources/**/*"]), + visibility = ["//visibility:public"], + deps = [ + ":all_processors", + ":util", + "@maven//:com_alibaba_druid", + "@maven//:com_google_code_gson_gson", + "@maven//:com_google_guava_guava", + "@maven//:com_google_re2j_re2j", + "@maven//:com_ibm_icu_icu4j", + "@maven//:commons_codec_commons_codec", + "@maven//:commons_io_commons_io", + "@maven//:info_picocli_picocli", + "@maven//:javax_annotation_javax_annotation_api", + "@maven//:me_tongfei_progressbar", + "@maven//:net_java_dev_jna_jna", + "@maven//:org_apache_commons_commons_lang3", + "@maven//:org_apache_logging_log4j_log4j_api", + "@maven//:org_apache_logging_log4j_log4j_core", + "@maven//:org_apache_logging_log4j_log4j_slf4j_impl", + "@maven//:org_hamcrest_hamcrest_all", + "@maven//:org_ini4j_ini4j", + "@maven//:org_jetbrains_annotations", + "@maven//:org_mybatis_dynamic_sql_mybatis_dynamic_sql", + "@maven//:org_mybatis_mybatis", + "@maven//:org_projectlombok_lombok", + "@maven//:org_slf4j_slf4j_api", + "@maven//:org_xerial_sqlite_jdbc", + "@maven//:tk_mybatis_mapper", + "@maven//:uk_com_robust_it_cloning", + ], +) diff --git a/language/xml/BUILD b/language/xml/BUILD new file mode 100644 index 00000000..d5335f80 --- /dev/null +++ b/language/xml/BUILD @@ -0,0 +1,15 @@ +load("//:visibility.bzl", "PUBLIC_VISIBILITY") + +# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound. +# When combined with glob, filegroup can ensure that all files are explicitly known to the build system. +filegroup( + name = "lib-03", + srcs = glob(["lib-03/**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib", + srcs = glob(["lib/**/*"]), + visibility = ["//visibility:public"], +) diff --git a/language/xml/extractor/BUILD b/language/xml/extractor/BUILD new file mode 100644 index 00000000..6d1f7e21 --- /dev/null +++ b/language/xml/extractor/BUILD @@ -0,0 +1,55 @@ +# add lombok annotation processor +java_import( + name = "lombok_jar", + jars = [ + "@maven//:v1/http/mvn.dev.alipay.net/artifactory/content/groups/public/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar", + ], +) + +java_plugin( + name = "lombok_processor", + # should be specified + processor_class = "lombok.launch.AnnotationProcessorHider$AnnotationProcessor", + deps = [ + ":lombok_jar", + ], +) + +# all in one exported processors library +java_library( + name = "all_processors", + exported_plugins = [ + ":lombok_processor", + ], + tags = ["maven:compile_only"], + exports = [ + "@maven//:org_projectlombok_lombok", + ], +) + +java_import( + name = "woodstox_core_jar", + jars = ["lib/woodstox-core-6.4.1-SNAPSHOT.jar"], +) + +java_binary( + name = "coref-xml-extractor", + srcs = glob(["src/main/java/**/*.java"]), + main_class = "com.alipay.codequery.Extractor", + resources = glob(["src/main/resources/**/*"]), + visibility = ["//visibility:public"], + deps = [ + ":all_processors", + ":woodstox_core_jar", + "@maven//:javax_persistence_javax_persistence_api", + "@maven//:org_apache_commons_commons_lang3", + "@maven//:org_apache_logging_log4j_log4j_api", + "@maven//:org_apache_logging_log4j_log4j_core", + "@maven//:org_apache_logging_log4j_log4j_slf4j_impl", + "@maven//:org_codehaus_woodstox_stax2_api", + "@maven//:org_mybatis_mybatis", + "@maven//:org_projectlombok_lombok", + "@maven//:org_xerial_sqlite_jdbc", + "@maven//:tk_mybatis_mapper", + ], +) diff --git a/tool/build-utils/pack_libs.py b/tool/build-utils/pack_libs.py new file mode 100644 index 00000000..753fe3aa --- /dev/null +++ b/tool/build-utils/pack_libs.py @@ -0,0 +1,199 @@ +import os +import sys +import subprocess +import platform +import re +import argparse + + +def my_print(*args, **kargs): + sep = kargs.get('sep', ' ') + end = kargs.get('end', '\n') + for idx, arg in enumerate(args): + if idx != 0: + sys.stdout.write(sep) + sys.stdout.write(format(arg)) + if end is None: + end = '\n' + sys.stdout.write(end) + + +def covert_to_str_list(data): + # In Python 2, type(l) is str/bytes, in Python 3 it is bytes. + return list(map(lambda l: l.decode() if (type(l) is not str) else l, data)) + + +class LibTool: + def __init__(self, show_command_only): + self.show_command_only = show_command_only + + def get_libs(self, program): + return covert_to_str_list(self._get_libs(program)) + + def get_rpaths(self, program): + return [] + + def _get_libs(self, program): + return [] + + def set_rpath(self, program): + pass + + def change_reference(self, program, library): + pass + + def copy_to_libpath(self, library, libpath): + self._run('cp %s %s' % (library, libpath)) + + def _run(self, command): + my_print('** Run command: %s' % command) + if not self.show_command_only: + return subprocess.call(command, shell=True) + else: + return 0 + + +class LinuxLibTool(LibTool): + def _get_libs(self, program): + libs = subprocess.check_output(['ldd', program]).splitlines() + return list(map(lambda lib: lib[0], + filter(lambda lib: lib, + map(lambda lib: re.findall(b'\t.+ => (.+) \\(.+\\)', lib), libs)))) + + def set_rpath(self, program): + self._run("patchelf --set-rpath '$ORIGIN/../lib64' '%s'" % program) + + def change_reference(self, program, library): + pass + + +class MacLibTool(LibTool): + def _get_libs(self, program): + return subprocess.check_output("otool -L '%s' | awk '{print $1}' | grep .dylib" % program, shell=True).splitlines() + + def get_rpaths(self, program): + rs = subprocess.check_output(['otool', '-l', program]).splitlines() + rs = covert_to_str_list(rs) + rpaths = [] + for idx, line in enumerate(rs): + if 'cmd LC_RPATH' in line: + mat = re.match(r'\s*path\s*(.+?)\s*\(offset', rs[idx + 2]) + if mat: + rpaths.append(mat.group(1)) + return rpaths + + def set_rpath(self, program): + for rpath in self.get_rpaths(program): + self._run("install_name_tool -delete_rpath '%s' '%s'" % (rpath, program)) + self._run("install_name_tool -add_rpath @executable_path/../lib64 '%s'" % program) + + def change_reference(self, program, library): + self._run("install_name_tool -change '%s' @rpath/$(basename '%s') '%s'" % (library, library, program)) + + +class USRPath: + def __init__(self, usr_root): + self.root = usr_root + self.bin = os.path.join(self.root, 'bin') + self.lib = os.path.join(self.root, 'lib') + self.lib64 = os.path.join(self.root, 'lib64') + + def mkdir(self): + for path in (self.lib, self.lib64): + if not os.path.exists(path): + os.mkdir(path) + + +def is_system_lib(lib): + filter_libs = [ + 'libc.so', + 'libm.so', + 'libdl.so', + 'librt.so', + 'libresolv.so', + 'libnsl.so', + 'libutil.so', + 'libcrypt.so', + 'libpthread.so', + + 'libpam.so', + 'libgcc_s.so', + 'libcurses.so', + 'libncurses.so', + 'libz.so', + + 'libc++.1.dylib', + 'libSystem.B.dylib', + 'libcharset.1.dylib', + 'libiconv.2.dylib', + 'libncurses.5.4.dylib', + 'libffi.dylib', + 'libsqlite3.dylib', + 'libz.1.dylib', + ] + lib_name = os.path.basename(lib) + for filter_lib in filter_libs: + if lib_name.startswith(filter_lib): + return True + return False + + +def change_binary(libtool, usr_path, binary_file): + my_print('Analysing binary: %s' % binary_file) + libs = libtool.get_libs(binary_file) + rpaths = libtool.get_rpaths(binary_file) + for lib in libs: + my_print('* Analysing library: %s' % lib, end='') + if not is_system_lib(lib): + if isinstance(libtool, MacLibTool) and ('@rpath' in lib): + my_print() + for rpath in rpaths: + library = lib.replace('@rpath', rpath).replace('@executable_path', + os.path.dirname(os.path.abspath(binary_file))) + if os.path.exists(library): + libtool.copy_to_libpath(library=library, libpath=usr_path.lib64) + libtool.change_reference(binary_file, lib) + break + else: + if os.path.exists(lib): + my_print() + libtool.copy_to_libpath(library=lib, libpath=usr_path.lib64) + libtool.change_reference(binary_file, lib) + else: + my_print(' [skip: library not found]') + else: + my_print(' [skip: system library]') + libtool.set_rpath(binary_file) + + +def main(args): + parser = argparse.ArgumentParser('Pack Libs') + parser.add_argument('usr_root') + parser.add_argument('--show-command-only', action='store_true') + args = parser.parse_args(args[1:]) + if platform.system() == 'Linux': + libtool = LinuxLibTool(show_command_only=args.show_command_only) + elif platform.system() == 'Darwin': + libtool = MacLibTool(show_command_only=args.show_command_only) + else: + sys.stderr.write('The platform \'%s\' is not supported.' % platform.system()) + return 1 + usr = USRPath(args.usr_root) + usr.mkdir() + + for binary_file in os.listdir(usr.bin): + try: + change_binary(libtool, usr, os.path.join(usr.bin, binary_file)) + except Exception as e: + my_print(e) + # TODO: Recursive call + for binary_file in os.listdir(usr.lib64): + try: + change_binary(libtool, usr, os.path.join(usr.lib64, binary_file)) + except Exception as e: + my_print(e) + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/tool/build-utils/upload.sh b/tool/build-utils/upload.sh new file mode 100644 index 00000000..6130bff1 --- /dev/null +++ b/tool/build-utils/upload.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +function main() { + if [ "$1" = "config" ]; then + config + elif [ "$1" = "upload" ]; then + upload + fi +} + +OSSUTIL_BIN=$HOME/.local/bin/ossutil +OSS_CONFIG_FILE=$HOME/myconfig + +function config() { + mkdir -p $HOME/.local/bin + if [ $OS = "linux" ]; then + URL=https://gosspublic.alicdn.com/ossutil/1.7.3/ossutil64 + elif [ $OS = "osx" ]; then + URL=https://gosspublic.alicdn.com/ossutil/1.7.3/ossutilmac64 + fi + + curl $URL -o $OSSUTIL_BIN + chmod 755 $OSSUTIL_BIN + $OSSUTIL_BIN config -e cn-shanghai-alipay-office.oss-alipay.aliyuncs.com -i ${ACI_VAR_OSS_KEYID} -k ${ACI_VAR_OSS_KEYSECRET} -L CH -c $OSS_CONFIG_FILE +} + +function upload() { + OSS_URL=oss://antsys-sparrow-data/sparrow/public/${OS}-${OSS_TARGET_BASENAME} + OSS_FILENAME=${OSS_TARGET_BASENAME}-${VERSION}.tar.gz + $OSSUTIL_BIN cp -rf ${OUTPUT_FILE} ${OSS_URL}/${OSS_FILENAME} -c $OSS_CONFIG_FILE --jobs 16 + if [ "$VERSION" != "snapshot" ]; then + if test -z "${LATEST}"; then + echo "not set latest tag" + else + echo -e "$VERSION\c" > latest + $OSSUTIL_BIN cp -rf latest ${OSS_URL}/ -c $OSS_CONFIG_FILE --jobs 16 + fi + fi +} + +main "$1" diff --git a/tool/build_rule/pkg_cache.BUILD b/tool/build_rule/pkg_cache.BUILD new file mode 100644 index 00000000..04647e5e --- /dev/null +++ b/tool/build_rule/pkg_cache.BUILD @@ -0,0 +1,33 @@ +package(default_visibility = ["//visibility:public"]) + +"""A local build file for pkg-cache http repository. + pkg-cache is a cached package used to store nodejs executable files, + which is used when building js extractor. + If we don't have this cache file, then when building js extractor, + npm pkg will download nodejs from GitHub; slow download speeds may + result in build failures. + + File layout: + pkg-cache + ├── linux + │   └── v3.4 + │   └── fetched-v18.5.0-linux-x64 + └── macos + └── v3.4 + ├── fetched-v18.5.0-macos-arm64 + └── fetched-v18.5.0-macos-x64 + + ATTENTION: please update pkg-cache file when npm pkg version is updated. +""" + +exports_files(glob(["*"])) + +filegroup( + name = "node-bin", + srcs = select({ + "@bazel_tools//src/conditions:darwin_x86_64": ["pkg-cache/macos/v3.4/fetched-v18.5.0-macos-x64"], + "@bazel_tools//src/conditions:darwin_arm64": ["pkg-cache/macos/v3.4/fetched-v18.5.0-macos-arm64"], + "//conditions:default": glob(["pkg-cache/linux/v3.4/fetched-v18.5.0-linux-x64"]), + }), + visibility = ["//visibility:public"], +) diff --git a/version.txt b/version.txt new file mode 100644 index 00000000..90012116 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +dev \ No newline at end of file diff --git a/visibility.bzl b/visibility.bzl new file mode 100644 index 00000000..8d33a88b --- /dev/null +++ b/visibility.bzl @@ -0,0 +1,11 @@ +# This file exists so that visibility rules can be relaxed for open source +# clients of kythe, but more restrictive for use within google. Targets that are +# allowed to be used by kythe clients should be marked as "//visibility:public", +# but separate aliases are used so they can map to different package groups +# within google. + +PUBLIC_PROTO_VISIBILITY = "//visibility:public" + +PUBLIC_VISIBILITY = "//visibility:public" + +PRIVATE_VISIBILITY = "//visibility:private"