Skip to content

Commit

Permalink
Some janitorial work
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky committed Aug 25, 2024
1 parent 8ab79ae commit 15bcbc7
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 50 deletions.
2 changes: 2 additions & 0 deletions cmd/svcinit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ func main() {
must(err)

// TODO(zbarsky): what is the right behavior here when services are crashing in ibazel mode?
for range servicesErrCh {
} // Drain the channel
criticalPath, err = r.UpdateSpecsAndRestart(serviceSpecs, servicesErrCh, []byte(ibazelCmd))
must(err)
}
Expand Down
1 change: 1 addition & 0 deletions examples/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ common --tool_java_runtime_version=remotejdk_17
# Don't depend on a JAVA_HOME pointing at a system JDK
# see https://github.com/bazelbuild/rules_jvm_external/issues/445
common --repo_env=JAVA_HOME=../bazel_tools/jdk
common --@rules_go//go/config:pure
52 changes: 51 additions & 1 deletion examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ local_path_override(

bazel_dep(name = "aspect_bazel_lib", version = "2.4.2")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "gazelle", version = "0.37.0")
bazel_dep(name = "platforms", version = "0.0.10")

bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.0")
toolchains = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")
use_repo(toolchains, "zig_sdk")

register_toolchains(
"@zig_sdk//toolchain:darwin_amd64",
"@zig_sdk//toolchain:darwin_arm64",
)

bazel_dep(name = "gazelle", version = "0.37.0")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
Expand All @@ -17,6 +27,13 @@ use_repo(
)

bazel_dep(name = "rules_go", version = "0.49.0")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
name = "go_sdk",
version = "1.22.3",
)
use_repo(go_sdk, "go_sdk")

bazel_dep(name = "rules_jvm_external", version = "6.2")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
Expand All @@ -36,3 +53,36 @@ maven.install(
lock_file = "//:maven_install.json",
)
use_repo(maven, "maven", "unpinned_maven")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "com_github_redis_redis",
build_file = "//redis:BUILD.redis",
integrity = "sha256-I65GNgUUsl+llqwrMUDMuTKCwqFv5fbYpNPoM2ENZqw=",
strip_prefix = "redis-6.2.14",
urls = ["https://github.com/redis/redis/archive/refs/tags/6.2.14.tar.gz"],
)

http_archive(
name = "sqlite4java",
build_file = "//third_party:BUILD.sqlite4java",
integrity = "sha256-zsZtCvre6it1fzl30RBHO15j2a5fbIKCZSKS7YPgPnw=",
strip_prefix = "sqlite4java-7b55b3eab6901a0e49d6e1129431fa92c4206c0b",
url = "https://github.com/ganadist/sqlite4java/archive/7b55b3eab6901a0e49d6e1129431fa92c4206c0b.tar.gz",
)

[
http_archive(
name = "mysql_8_4_0_" + arch,
build_file = "//mysql:BUILD.mysql",
urls = ["https://cdn.mysql.com/archives/mysql-8.4/mysql-8.4.0-" + arch + ".tar." + ext],
integrity = integrity,
strip_prefix = "mysql-8.4.0-" + arch,
) for (arch, integrity, ext) in [
("macos14-arm64", "sha256-tK10p4qkN43wDhFkyZed1mDqCb9H4F9u+DJPTqFBhhg=", "gz"),
("macos14-x86_64", "sha256-rbuLfiYVR3aKVI2Xk4pfG2bPhdruCdsorEu2V6p9QZI=", "gz"),
("linux-glibc2.28-aarch64", "sha256-9NkYaSm7JgRqO9GjuLdL0jXn7GkxjwmtchjPzABwk5s=", "xz"),
("linux-glibc2.28-x86_64", "sha256-N3Zm2BuB79JRDB4SeUoIiphBLt5KAfC5QRD6FUlzSuM=", "xz"),
]
]
21 changes: 0 additions & 21 deletions examples/WORKSPACE

This file was deleted.

17 changes: 8 additions & 9 deletions examples/mysql/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
load("@aspect_bazel_lib//lib:copy_file.bzl", "copy_file")
load("@rules_itest//:itest.bzl", "itest_service")
load(":bootstrap.bzl", "mysql_impl")

alias(
name = "mysql_cli",
actual = select({
"@bazel_tools//src/conditions:darwin_arm64": "@mysql_8_0_34_macos13-arm64//:mysql_cli",
"@bazel_tools//src/conditions:darwin_x86_64": "@mysql_8_0_34_macos13-x86_64//:mysql_cli",
"@bazel_tools//src/conditions:linux_aarch64": "@mysql_8_0_34_linux-glibc2.28-aarch64//:mysql_cli",
"@bazel_tools//src/conditions:linux_x86_64": "@mysql_8_0_34_linux-glibc2.28-x86_64//:mysql_cli",
"@bazel_tools//src/conditions:darwin_arm64": "@mysql_8_4_0_macos14-arm64//:mysql_cli",
"@bazel_tools//src/conditions:darwin_x86_64": "@mysql_8_4_0_macos14-x86_64//:mysql_cli",
"@bazel_tools//src/conditions:linux_aarch64": "@mysql_8_4_0_linux-glibc2.28-aarch64//:mysql_cli",
"@bazel_tools//src/conditions:linux_x86_64": "@mysql_8_4_0_linux-glibc2.28-x86_64//:mysql_cli",
}),
)

alias(
name = "mysqld",
actual = select({
"@bazel_tools//src/conditions:darwin_arm64": "@mysql_8_0_34_macos13-arm64//:mysqld",
"@bazel_tools//src/conditions:darwin_x86_64": "@mysql_8_0_34_macos13-x86_64//:mysqld",
"@bazel_tools//src/conditions:linux_aarch64": "@mysql_8_0_34_linux-glibc2.28-aarch64//:mysqld",
"@bazel_tools//src/conditions:linux_x86_64": "@mysql_8_0_34_linux-glibc2.28-x86_64//:mysqld",
"@bazel_tools//src/conditions:darwin_arm64": "@mysql_8_4_0_macos14-arm64//:mysqld",
"@bazel_tools//src/conditions:darwin_x86_64": "@mysql_8_4_0_macos14-x86_64//:mysqld",
"@bazel_tools//src/conditions:linux_aarch64": "@mysql_8_4_0_linux-glibc2.28-aarch64//:mysqld",
"@bazel_tools//src/conditions:linux_x86_64": "@mysql_8_4_0_linux-glibc2.28-x86_64//:mysqld",
}),
)

Expand Down
16 changes: 0 additions & 16 deletions examples/mysql/repositories.bzl

This file was deleted.

4 changes: 2 additions & 2 deletions private/itest.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ forward the ibazel hot-reload notification over stdin instead of restarting the
# Service control
The svcinit also exposes a HTTP server on `http://127.0.0.1:{SVCCTL_PORT}`. It is useful for tests
that need to start / stop services in the midst of the test run. There are currently 4 API endpoint
The serice manager exposes a HTTP server on `http://127.0.0.1:{SVCCTL_PORT}`. It can be used to
start / stop services during a test run. There are currently 4 API endpoint
available. All of them are GET requests:
1. `/v0/healthcheck?service={label}`: Returns 200 if the service is healthy, 503 otherwise.
Expand Down
1 change: 0 additions & 1 deletion svcctl/svcctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func handleHealthCheck(ctx context.Context, r *runner.Runner, _ chan error, w ht
}

func handleStart(ctx context.Context, r *runner.Runner, serviceErrCh chan error, w http.ResponseWriter, req *http.Request) {

s, status, err := getService(r, req)
if err != nil {
http.Error(w, err.Error(), status)
Expand Down

0 comments on commit 15bcbc7

Please sign in to comment.