diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 5df5cc7..c1d66c4 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -153,12 +153,15 @@ go_repository( version = "v1.1.0", ) -http_archive( +#http_archive( +# name = "io_bazel_rules_prometheus", +# sha256 = "f389ea769e8192a185c8f6216f8535a7eef3d64b619abcc61d56800f39ac62a3", +# urls = ["https://github.com/zacker330/rules_prometheus/releases/download/v0.0.2/rules_prometheus.tar.gz"], +#) +local_repository( name = "io_bazel_rules_prometheus", - sha256 = "f389ea769e8192a185c8f6216f8535a7eef3d64b619abcc61d56800f39ac62a3", - urls = ["https://github.com/zacker330/rules_prometheus/releases/download/v0.0.2/rules_prometheus.tar.gz"], + path = "../", ) - load("@io_bazel_rules_prometheus//:deps.bzl", "rules_prometheus_dependencies", "prometheus_register_toolchains", "alertmanager_register_toolchains") rules_prometheus_dependencies() prometheus_register_toolchains(version = "2.43.1") diff --git a/internal/alertmanager/repos.bzl b/internal/alertmanager/repos.bzl index 6c680b9..2d8aea3 100644 --- a/internal/alertmanager/repos.bzl +++ b/internal/alertmanager/repos.bzl @@ -57,7 +57,8 @@ def _format_url(version, platform, url): return whole_url def _alertmanager_download_rule_impl(ctx): - os, arch = ctx.attr.os, ctx.attr.arch + os, arch = detect_host_platform(ctx) +# os, arch = ctx.attr.os, ctx.attr.arch platform = os + "-" + arch version = ctx.attr.version diff --git a/internal/prometheus/repos.bzl b/internal/prometheus/repos.bzl index e43dff6..b449ee4 100644 --- a/internal/prometheus/repos.bzl +++ b/internal/prometheus/repos.bzl @@ -6,7 +6,6 @@ load("@io_bazel_rules_prometheus//internal:platforms.bzl", "BAZEL_OS_CONSTRAINTS def _prometheus_build_file(ctx, platform, version): os, _, arch = platform.partition("-") - constraints = [BAZEL_OS_CONSTRAINTS[os], BAZEL_ARCH_CONSTRAINTS[arch]] constraint_str = ",\n ".join(['"%s"' % c for c in constraints]) @@ -60,14 +59,15 @@ def _format_url(version, platform, url): return whole_url def _prometheus_download_rule_impl(ctx): - if not ctx.attr.os and not ctx.attr.arch: - os, arch = detect_host_platform(ctx) - else: - if not ctx.attr.os: - fail("arch set but os not set") - if not ctx.attr.arch: - fail("os set but arch not set") - # os, arch = ctx.attr.os, ctx.attr.arch + os, arch = detect_host_platform(ctx) +# if not ctx.attr.os and not ctx.attr.arch: +# os, arch = detect_host_platform(ctx) +# else: +# if not ctx.attr.os: +# fail("arch set but os not set") +# if not ctx.attr.arch: +# fail("os set but arch not set") +# os, arch = ctx.attr.os, ctx.attr.arch platform = os + "-" + arch version = ctx.attr.version