prysm-pulse/crypto/bls/blst/BUILD.bazel
terence tsao b38b0186b8
Use signature length from fieldparams (#10019)
* Use bls sig length from fieldparams

* fmt

* fix tests

* fix tests

* fix tests

* Update tags_test.go

* fix tests

* Update BUILD.bazel
2021-12-15 15:14:30 -05:00

217 lines
5.3 KiB
Python

load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@prysm//tools/go:def.bzl", "go_library")
# Build with --define=blst_disabled=true to exclude blst library.
config_setting(
name = "linux_amd64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
values = {
"define": "blst_disabled=false",
},
)
config_setting(
name = "darwin_amd64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
values = {
"define": "blst_disabled=false",
},
)
config_setting(
name = "windows_amd64",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
values = {
"define": "blst_disabled=false",
},
)
config_setting(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
values = {
"define": "blst_disabled=false",
},
)
config_setting(
name = "android_amd64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:x86_64",
],
values = {
"define": "blst_disabled=false",
},
)
config_setting(
name = "android_arm64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:aarch64",
],
values = {
"define": "blst_disabled=false",
},
)
# gazelle:resolve go github.com/supranational/blst/bindings/go @com_github_supranational_blst//:go_default_library
go_library(
name = "go_default_library",
srcs =
selects.with_or({
(
":linux_amd64",
":linux_arm64",
":darwin_amd64",
":windows_amd64",
":android_amd64",
":android_arm64",
): [
"aliases.go",
"doc.go",
"init.go",
"public_key.go",
"secret_key.go",
"signature.go",
],
"//conditions:default": [
"stub.go",
],
}),
importpath = "github.com/prysmaticlabs/prysm/crypto/bls/blst",
visibility = [
"//crypto/bls:__pkg__",
],
deps = selects.with_or({
(
":linux_amd64",
":linux_arm64",
":darwin_amd64",
":windows_amd64",
":android_amd64",
":android_arm64",
): [
"//crypto/bls/common:go_default_library",
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//crypto/rand:go_default_library",
"@com_github_dgraph_io_ristretto//:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_supranational_blst//:go_default_library",
],
"//conditions:default": ["//crypto/bls/common:go_default_library"],
}),
)
# gazelle:ignore
go_test(
name = "go_default_test",
srcs = selects.with_or({
(
":linux_amd64",
":linux_arm64",
":darwin_amd64",
":windows_amd64",
":android_amd64",
":android_arm64",
): [
"public_key_test.go",
"secret_key_test.go",
],
"//conditions:default": [],
}),
deps = selects.with_or({
(
":linux_amd64",
":linux_arm64",
":darwin_amd64",
":windows_amd64",
":android_amd64",
":android_arm64",
): [
"//crypto/bls/blst:go_default_library",
"//crypto/bls/common:go_default_library",
"//encoding/bytesutil:go_default_library",
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
],
"//conditions:default": [],
}),
)
# gazelle:ignore
go_test(
name = "go_signature_test",
srcs = selects.with_or({
(
":linux_amd64",
":linux_arm64",
":darwin_amd64",
":windows_amd64",
":android_amd64",
":android_arm64",
): [
"signature_test.go",
],
"//conditions:default": [],
}),
embed = [":go_default_library"],
deps = selects.with_or({
(
":linux_amd64",
":linux_arm64",
":darwin_amd64",
":windows_amd64",
":android_amd64",
":android_arm64",
): [
"//crypto/bls/common:go_default_library",
"//encoding/bytesutil:go_default_library",
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
],
"//conditions:default": [],
}),
)
# gazelle:exclude bls_benchmark_test.go
go_test(
name = "go_benchmark_test",
size = "small",
srcs = ["bls_benchmark_test.go"],
args = [
"-test.bench=.",
"-test.benchmem",
"-test.v",
],
local = True,
tags = [
"benchmark",
"manual",
"no-cache",
],
deps = [
":go_default_library",
"//crypto/bls/common:go_default_library",
"//encoding/bytesutil:go_default_library",
"//crypto/hash:go_default_library",
],
)