forked from hswaw/hscloud
Serge Bazanski
3e2a5a5957
You can test this using: bazel run '@io_filippo_age//cmd/age' The same target can now be used in data dependencies for secretstore (you'll need to hardcode the runfile path, or use some Bazel-runfile-resolving library for Python). This required adding a few dependencies to third_party/go/repositories.bzl, but also moving golang.org/x/crypto from that file into WORKSPACE, before gazelle_deps gets loaded (as the version requested by gazelle_deps is too old). We also moved shlex that shouldn't have been in WORKSPACE into third_party/go/repositories.bzl. Otherwise, this was just a few small deps - bumped golang.org/x/crypto, new golang.org/x/term, new filippo.io/edwards25519. Hooray low dependency code. Change-Id: I0e684d88efffde13a3b4e253860aabcb35a3c94d Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1158 Reviewed-by: patryk <patryk@hackerspace.pl>
329 lines
11 KiB
Python
329 lines
11 KiB
Python
workspace(
|
|
name = "hscloud",
|
|
)
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
|
|
|
|
# Protobuf deps (shared between many rules).
|
|
# Load this as early as possible, to avoid a different version being pulled in by deps of something else
|
|
http_archive(
|
|
name = "com_google_protobuf",
|
|
sha256 = "c6003e1d2e7fefa78a3039f19f383b4f3a61e81be8c19356f85b6461998ad3db",
|
|
strip_prefix = "protobuf-3.17.3",
|
|
urls = ["https://github.com/google/protobuf/archive/v3.17.3.tar.gz"],
|
|
)
|
|
|
|
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
|
|
|
|
protobuf_deps()
|
|
|
|
# Force rules_python at a bleeding edge version (for setuptools >44).
|
|
rules_python_version = "929d5a13d4eb1b930086d9353fc6f2d6ad306e43"
|
|
|
|
http_archive(
|
|
name = "rules_python",
|
|
sha256 = "b590e4fc07ec842b8cc8a39a4ca0336f44d7d5f96753229d240884cd016dc1e3",
|
|
strip_prefix = "rules_python-{}".format(rules_python_version),
|
|
url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version),
|
|
)
|
|
|
|
# Download Go/Gazelle rules
|
|
http_archive(
|
|
name = "io_bazel_rules_go",
|
|
sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
|
|
"https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
|
|
],
|
|
)
|
|
|
|
http_archive(
|
|
name = "bazel_gazelle",
|
|
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
|
|
urls = [
|
|
"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",
|
|
],
|
|
)
|
|
|
|
# Python rules
|
|
# Important: rules_python must be loaded before protobuf (and grpc) because they load an older version otherwise
|
|
load("@rules_python//python:pip.bzl", "pip_parse")
|
|
|
|
pip_parse(
|
|
name = "pydeps",
|
|
requirements_lock = "//third_party/py:requirements.txt",
|
|
)
|
|
|
|
load("@pydeps//:requirements.bzl", "install_deps")
|
|
|
|
install_deps()
|
|
|
|
# Setup Go toolchain.
|
|
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
|
|
|
|
go_register_toolchains(version = "1.17")
|
|
|
|
# IMPORTANT: match protobuf version above with the one loaded by grpc
|
|
http_archive(
|
|
name = "com_github_grpc_grpc",
|
|
sha256 = "419dba362eaf8f1d36849ceee17c3e2ff8ff12ac666b42d3ff02a164ebe090e9",
|
|
strip_prefix = "grpc-1.30.0",
|
|
urls = ["https://github.com/grpc/grpc/archive/v1.30.0.tar.gz"],
|
|
)
|
|
|
|
# Load grpc deps after Go, to prevent overriding Go toolchains/SDK.
|
|
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
|
|
|
|
grpc_deps()
|
|
|
|
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
|
|
|
|
grpc_extra_deps()
|
|
|
|
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
|
|
|
|
go_rules_dependencies()
|
|
|
|
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
|
|
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
|
|
|
|
# Force newer version of golang.org/x/crypto that gazelle_dependencies would
|
|
# usually get.
|
|
go_repository(
|
|
name = "org_golang_x_crypto",
|
|
build_naming_convention = "go_default_library",
|
|
importpath = "golang.org/x/crypto",
|
|
sum = "h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=",
|
|
version = "v0.0.0-20210921155107-089bfa567519",
|
|
)
|
|
|
|
gazelle_dependencies()
|
|
|
|
# Load Go third-party packages.
|
|
load("//third_party/go:repositories.bzl", "go_repositories")
|
|
|
|
go_repositories()
|
|
|
|
# Docker rules
|
|
|
|
http_archive(
|
|
name = "io_bazel_rules_docker",
|
|
sha256 = "59d5b42ac315e7eadffa944e86e90c2990110a1c8075f1cd145f487e999d22b3",
|
|
strip_prefix = "rules_docker-0.17.0",
|
|
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.17.0/rules_docker-v0.17.0.tar.gz"],
|
|
)
|
|
|
|
load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure")
|
|
|
|
# This forces the use of Docker $HOME/.docker configuration.
|
|
docker_toolchain_configure(
|
|
name = "docker_config",
|
|
client_config = "",
|
|
docker_path = "/usr/bin/docker",
|
|
)
|
|
|
|
load(
|
|
"@io_bazel_rules_docker//repositories:repositories.bzl",
|
|
container_repositories = "repositories",
|
|
)
|
|
|
|
container_repositories()
|
|
|
|
# Docker base images
|
|
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
|
|
|
|
container_pull(
|
|
name = "prodimage-bionic",
|
|
digest = "sha256:1cd1f84169b8e1414a5d511b42909f2d540831c67b6799ae9af8cd6a80d75b5f",
|
|
registry = "registry.k0.hswaw.net",
|
|
repository = "q3k/prodimage",
|
|
tag = "20190822-1227",
|
|
)
|
|
|
|
container_pull(
|
|
name = "gerrit-3.3.2",
|
|
digest = "sha256:f7fc8b749706f38475f94191117091973914a8f084e69518deff7dbc9c2c557d",
|
|
registry = "index.docker.io",
|
|
repository = "gerritcodereview/gerrit",
|
|
tag = "3.3.2-ubuntu20",
|
|
)
|
|
|
|
# third_party/factorio
|
|
load("//third_party/factorio:factorio.bzl", "factorio_repositories")
|
|
|
|
factorio_repositories()
|
|
|
|
# For devtools/gerrit/gerrit-oauth-provider and gerrit OWNERS plugin
|
|
|
|
git_repository(
|
|
name = "com_googlesource_gerrit_bazlets",
|
|
commit = "a511f3c90129d7de7ae67c0637001162980c08d5",
|
|
remote = "https://gerrit.googlesource.com/bazlets",
|
|
shallow_since = "1606931369 -0600",
|
|
)
|
|
|
|
load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api")
|
|
|
|
gerrit_api()
|
|
|
|
load("//devtools/gerrit/gerrit-oauth-provider:external_plugin_deps.bzl", gerrit_oauth_deps = "external_plugin_deps")
|
|
|
|
gerrit_oauth_deps(omit_commons_codec = False)
|
|
|
|
# Gerrit 3.3.2 built by q3k, backported with fix for 'empty reviewers column' bug.
|
|
# See: https://bugs.chromium.org/p/gerrit/issues/detail?id=13899
|
|
# Override can be removed once we update to > 3.3.2, as the fix for this is
|
|
# pending for the 3.3 branch.
|
|
#
|
|
# Built from v3.3.2 tag at df0507df5917fd78af01aee2495b2663530d52d1
|
|
# Cherry-picked fix from 8731af3ae785efe9ecff7f3d04302b6b01c4fc0b
|
|
# Resulted in commit 5949bfb86e62a32a95293e339ed86bfe52a283e9
|
|
# Built against Java 8:
|
|
# bazel build --java_toolchain //tools:error_prone_warnings_toolchain :release
|
|
#
|
|
http_file(
|
|
name = "org_q3k_gerrit_3_3_2_backport",
|
|
downloaded_file_path = "gerrit.war",
|
|
sha256 = "d1839d691a8534f4ccb27bed9a98281e45972fbebec50d004cecd4d5da2b15a6",
|
|
urls = [
|
|
"https://object.ceph-waw3.hswaw.net/q3k-personal/d1839d691a8534f4ccb27bed9a98281e45972fbebec50d004cecd4d5da2b15a6.war",
|
|
],
|
|
)
|
|
|
|
# minecraft spigot/bukkit deps
|
|
# this uses rules_jvm_external vs gerrit's maven_jar because we need SNAPSHOT support
|
|
|
|
http_archive(
|
|
name = "io_grpc_grpc_java",
|
|
sha256 = "446ad7a2e85bbd05406dbf95232c7c49ed90de83b3b60cb2048b0c4c9f254d29",
|
|
strip_prefix = "grpc-java-1.29.0",
|
|
url = "https://github.com/grpc/grpc-java/archive/v1.29.0.zip",
|
|
)
|
|
|
|
RULES_JVM_EXTERNAL_TAG = "3.0"
|
|
|
|
RULES_JVM_EXTERNAL_SHA = "62133c125bf4109dfd9d2af64830208356ce4ef8b165a6ef15bbff7460b35c3a"
|
|
|
|
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,
|
|
)
|
|
|
|
load("@rules_jvm_external//:defs.bzl", "maven_install")
|
|
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS")
|
|
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS")
|
|
|
|
maven_install(
|
|
artifacts = [
|
|
"org.spigotmc:spigot-api:1.15.2-R0.1-20200624.001023-124",
|
|
"io.grpc:grpc-netty-shaded:1.29.0",
|
|
"io.grpc:grpc-services:1.29.0",
|
|
] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
|
|
generate_compat_repositories = True,
|
|
maven_install_json = "//third_party/java:maven_install.json",
|
|
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
|
|
repositories = [
|
|
"https://hub.spigotmc.org/nexus/content/repositories/snapshots",
|
|
"https://oss.sonatype.org/content/repositories/snapshots",
|
|
"https://repo1.maven.org/maven2/",
|
|
],
|
|
)
|
|
|
|
load("@maven//:defs.bzl", "pinned_maven_install")
|
|
|
|
pinned_maven_install()
|
|
|
|
load("@maven//:compat.bzl", "compat_repositories")
|
|
|
|
compat_repositories()
|
|
|
|
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
|
|
|
|
grpc_java_repositories()
|
|
|
|
# Gerrit OWNERS plugins external repositories
|
|
|
|
git_repository(
|
|
name = "com_googlesource_gerrit_plugin_owners",
|
|
commit = "17817c9e319073c03513f9d5177b6142b8fd567b",
|
|
remote = "https://gerrit.googlesource.com/plugins/owners/",
|
|
shallow_since = "1593642470 +0200",
|
|
)
|
|
|
|
load("@com_googlesource_gerrit_plugin_owners//:external_plugin_deps_standalone.bzl", gerrit_owners_deps = "external_plugin_deps_standalone")
|
|
|
|
gerrit_owners_deps()
|
|
|
|
# Go image repos for Docker
|
|
|
|
load("@io_bazel_rules_docker//go:image.bzl", go_image_repositories = "repositories")
|
|
|
|
go_image_repositories()
|
|
|
|
# oniguruma, with build from //third_party/oniguruma
|
|
|
|
http_archive(
|
|
name = "com_github_kkos_oniguruma",
|
|
build_file = "@hscloud//third_party/oniguruma:BUILD.external",
|
|
sha256 = "d33c849d1672af227944878cefe0a8fcf26fc62bedba32aa517f2f63c314a99e",
|
|
strip_prefix = "onig-6.9.5",
|
|
urls = ["https://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5_rev1.tar.gz"],
|
|
)
|
|
|
|
# jq, with build from //third_party/jq
|
|
|
|
http_archive(
|
|
name = "com_github_stedolan_jq",
|
|
build_file = "@hscloud//third_party/jq:BUILD.external",
|
|
sha256 = "5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72",
|
|
strip_prefix = "jq-1.6",
|
|
urls = ["https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz"],
|
|
)
|
|
|
|
# leaflet.js from NPM, used by //hswaw/site.
|
|
http_archive(
|
|
name = "com_npmjs_leaflet",
|
|
build_file_content = """
|
|
filegroup(
|
|
name = "distfiles",
|
|
srcs = [
|
|
"package/dist/leaflet.js",
|
|
"package/dist/leaflet.css",
|
|
"package/dist/images/layers-2x.png",
|
|
"package/dist/images/layers.png",
|
|
"package/dist/images/marker-icon-2x.png",
|
|
"package/dist/images/marker-icon.png",
|
|
"package/dist/images/marker-shadow.png",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
""",
|
|
sha256 = "43aca726165904ff73a34571c263b561cec94e6b9992a4414a600f3e984d1b03",
|
|
urls = ["https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz"],
|
|
)
|
|
|
|
# noVNC, used by //dc/drackvm.
|
|
http_archive(
|
|
name = "com_github_novnc_novnc",
|
|
build_file_content = """
|
|
filegroup(
|
|
name = "distfiles",
|
|
srcs = [
|
|
"vnc.html",
|
|
] + glob([
|
|
"app/**",
|
|
"core/**",
|
|
"vendor/**",
|
|
]),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
""",
|
|
sha256 = "2c972cca34376dfd2a54939e7e571e466511bf592d03e838440b3c8868441eaf",
|
|
strip_prefix = "noVNC-1.3.0-beta",
|
|
urls = ["https://github.com/novnc/noVNC/archive/refs/tags/v1.3.0-beta.tar.gz"],
|
|
)
|