module( name = "avalanchego", version = "0.0.0", ) bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go") bazel_dep(name = "gazelle", version = "0.51.3", repo_name = "bazel_gazelle") bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "buildifier_prebuilt", version = "8.5.1.2") # Go SDK - reads version from go.mod (ensured consistent with all go.mod files) go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") go_sdk.from_file(go_mod = "//:go.mod") # Go dependencies from go.work (aggregates all go.mod files) go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_work = "//:go.work") # Go-based repo tools used via Bazel fallback in CI. tool_go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps", isolate = True) tool_go_deps.from_file(go_mod = "//tools/external:go.mod") # Patches for external dependencies that need custom BUILD files or fixes. # See docs/bazel.md "Patched Dependencies" for details on each override. GO_OVERRIDES = { "github.com/supranational/blst": { "build_gen": "off", "patches": ["//.bazel/patches:com_github_supranational_blst.patch"], }, "github.com/ava-labs/firewood-go-ethhash/ffi": { "build_gen": "off", "patches": ["//.bazel/patches:com_github_ava_labs_firewood_go_ethhash_ffi.patch"], }, "github.com/consensys/gnark-crypto": { "patches": ["//.bazel/patches:com_github_consensys_gnark_crypto_asm_includes.patch"], }, "github.com/ava-labs/libevm": { "patches": ["//.bazel/patches:com_github_ava_labs_libevm.patch"], "gazelle_directives": ["gazelle:exclude crypto/secp256k1/**"], }, } [go_deps.module_override( patch_strip = 1, patches = o.get("patches", []), path = path, ) for path, o in GO_OVERRIDES.items()] [go_deps.gazelle_override( build_file_generation = o.get("build_gen", "on"), directives = o.get("gazelle_directives", []), path = path, ) for path, o in GO_OVERRIDES.items()] # Workspace modules (avalanchego, graft/*) are built from the local source # tree, so they do not need use_repo bindings here. Omitting those generated # local-path repos also keeps `bazel fetch //...` from traversing personal # workspace state like .agents/ and broken local symlinks while fetching all # imported external repos. use_repo( go_deps, "com_connectrpc_connect", "com_connectrpc_grpcreflect", "com_github_antithesishq_antithesis_sdk_go", "com_github_arr4n_shed", "com_github_ava_labs_firewood_go_ethhash_ffi", "com_github_ava_labs_libevm", "com_github_ava_labs_simplex", "com_github_btcsuite_btcd_btcutil", "com_github_cespare_xxhash_v2", "com_github_cockroachdb_pebble", "com_github_compose_spec_compose_go", "com_github_datadog_zstd", "com_github_davecgh_go_spew", "com_github_deckarep_golang_set_v2", "com_github_decred_dcrd_dcrec_secp256k1_v4", "com_github_fjl_gencodec", "com_github_go_cmd_cmd", "com_github_google_btree", "com_github_google_go_cmp", "com_github_google_renameio_v2", "com_github_google_uuid", "com_github_gorilla_mux", "com_github_gorilla_rpc", "com_github_gorilla_websocket", "com_github_grpc_ecosystem_go_grpc_prometheus", "com_github_hashicorp_go_bexpr", "com_github_hashicorp_golang_lru", "com_github_holiman_billy", "com_github_holiman_bloomfilter_v2", "com_github_holiman_uint256", "com_github_huin_goupnp", "com_github_jackpal_gateway", "com_github_jackpal_go_nat_pmp", "com_github_leanovate_gopter", "com_github_mattn_go_colorable", "com_github_mattn_go_isatty", "com_github_mitchellh_mapstructure", "com_github_mr_tron_base58", "com_github_nbutton23_zxcvbn_go", "com_github_onsi_ginkgo_v2", "com_github_pires_go_proxyproto", "com_github_prometheus_client_golang", "com_github_prometheus_client_model", "com_github_prometheus_common", "com_github_rs_cors", "com_github_shirou_gopsutil", "com_github_spf13_cast", "com_github_spf13_cobra", "com_github_spf13_pflag", "com_github_spf13_viper", "com_github_stephenbuttolph_canoto", "com_github_stretchr_testify", "com_github_supranational_blst", "com_github_syndtr_goleveldb", "com_github_thepudds_fzgen", "com_github_tyler_smith_go_bip39", "com_github_urfave_cli_v2", "com_github_victoriametrics_fastcache", "in_gopkg_natefinch_lumberjack_v2", "in_gopkg_yaml_v3", "io_k8s_api", "io_k8s_apimachinery", "io_k8s_client_go", "io_k8s_utils", "io_opentelemetry_go_otel", "io_opentelemetry_go_otel_exporters_otlp_otlptrace", "io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracegrpc", "io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracehttp", "io_opentelemetry_go_otel_sdk", "io_opentelemetry_go_otel_trace", "org_golang_google_genproto", "org_golang_google_genproto_googleapis_rpc", "org_golang_google_grpc", "org_golang_google_protobuf", "org_golang_x_crypto", "org_golang_x_exp", "org_golang_x_net", "org_golang_x_sync", "org_golang_x_term", "org_golang_x_time", "org_golang_x_tools", "org_gonum_v1_gonum", "org_uber_go_goleak", "org_uber_go_mock", "org_uber_go_zap", ) use_repo( tool_go_deps, "com_github_go_task_task_v3", tool_com_github_fjl_gencodec = "com_github_fjl_gencodec", tool_com_github_golangci_golangci_lint_v2 = "com_github_golangci_golangci_lint_v2", tool_com_github_palantir_go_license = "com_github_palantir_go_license", tool_com_github_rhysd_actionlint = "com_github_rhysd_actionlint", )