github.com/prysmaticlabs/prysm@v1.4.4/shared/bls/blst/BUILD.bazel (about) 1 load("@io_bazel_rules_go//go:def.bzl", "go_test") 2 load("@bazel_skylib//lib:selects.bzl", "selects") 3 load("@prysm//tools/go:def.bzl", "go_library") 4 5 # Build with --define=blst_disabled=true to exclude blst library. 6 config_setting( 7 name = "linux_amd64", 8 constraint_values = [ 9 "@platforms//os:linux", 10 "@platforms//cpu:x86_64", 11 ], 12 values = { 13 "define": "blst_disabled=false", 14 }, 15 ) 16 17 config_setting( 18 name = "darwin_amd64", 19 constraint_values = [ 20 "@platforms//os:osx", 21 "@platforms//cpu:x86_64", 22 ], 23 values = { 24 "define": "blst_disabled=false", 25 }, 26 ) 27 28 config_setting( 29 name = "windows_amd64", 30 constraint_values = [ 31 "@platforms//os:windows", 32 "@platforms//cpu:x86_64", 33 ], 34 values = { 35 "define": "blst_disabled=false", 36 }, 37 ) 38 39 config_setting( 40 name = "linux_arm64", 41 constraint_values = [ 42 "@platforms//os:linux", 43 "@platforms//cpu:aarch64", 44 ], 45 values = { 46 "define": "blst_disabled=false", 47 }, 48 ) 49 50 config_setting( 51 name = "android_amd64", 52 constraint_values = [ 53 "@platforms//os:android", 54 "@platforms//cpu:x86_64", 55 ], 56 values = { 57 "define": "blst_disabled=false", 58 }, 59 ) 60 61 config_setting( 62 name = "android_arm64", 63 constraint_values = [ 64 "@platforms//os:android", 65 "@platforms//cpu:aarch64", 66 ], 67 values = { 68 "define": "blst_disabled=false", 69 }, 70 ) 71 72 # gazelle:resolve go github.com/supranational/blst/bindings/go @com_github_supranational_blst//:go_default_library 73 74 go_library( 75 name = "go_default_library", 76 srcs = 77 selects.with_or({ 78 ( 79 ":linux_amd64", 80 ":linux_arm64", 81 ":darwin_amd64", 82 ":windows_amd64", 83 ":android_amd64", 84 ":android_arm64", 85 ): [ 86 "aliases.go", 87 "doc.go", 88 "init.go", 89 "public_key.go", 90 "secret_key.go", 91 "signature.go", 92 ], 93 "//conditions:default": [ 94 "stub.go", 95 ], 96 }), 97 importpath = "github.com/prysmaticlabs/prysm/shared/bls/blst", 98 visibility = [ 99 "//shared/bls:__pkg__", 100 ], 101 deps = selects.with_or({ 102 ( 103 ":linux_amd64", 104 ":linux_arm64", 105 ":darwin_amd64", 106 ":windows_amd64", 107 ":android_amd64", 108 ":android_arm64", 109 ): [ 110 "//shared/bls/common:go_default_library", 111 "//shared/featureconfig:go_default_library", 112 "//shared/params:go_default_library", 113 "//shared/rand:go_default_library", 114 "@com_github_dgraph_io_ristretto//:go_default_library", 115 "@com_github_pkg_errors//:go_default_library", 116 "@com_github_supranational_blst//:go_default_library", 117 ], 118 "//conditions:default": ["//shared/bls/common:go_default_library"], 119 }), 120 ) 121 122 # gazelle:ignore 123 go_test( 124 name = "go_default_test", 125 srcs = selects.with_or({ 126 ( 127 ":linux_amd64", 128 ":linux_arm64", 129 ":darwin_amd64", 130 ":windows_amd64", 131 ":android_amd64", 132 ":android_arm64", 133 ): [ 134 "public_key_test.go", 135 "secret_key_test.go", 136 ], 137 "//conditions:default": [], 138 }), 139 deps = selects.with_or({ 140 ( 141 ":linux_amd64", 142 ":linux_arm64", 143 ":darwin_amd64", 144 ":windows_amd64", 145 ":android_amd64", 146 ":android_arm64", 147 ): [ 148 "//shared/bls/blst:go_default_library", 149 "//shared/bls/common:go_default_library", 150 "//shared/bytesutil:go_default_library", 151 "//shared/testutil/assert:go_default_library", 152 "//shared/testutil/require:go_default_library", 153 ], 154 "//conditions:default": [], 155 }), 156 ) 157 158 # gazelle:ignore 159 go_test( 160 name = "go_signature_test", 161 srcs = selects.with_or({ 162 ( 163 ":linux_amd64", 164 ":linux_arm64", 165 ":darwin_amd64", 166 ":windows_amd64", 167 ":android_amd64", 168 ":android_arm64", 169 ): [ 170 "signature_test.go", 171 ], 172 "//conditions:default": [], 173 }), 174 embed = [":go_default_library"], 175 deps = selects.with_or({ 176 ( 177 ":linux_amd64", 178 ":linux_arm64", 179 ":darwin_amd64", 180 ":windows_amd64", 181 ":android_amd64", 182 ":android_arm64", 183 ): [ 184 "//shared/bls/common:go_default_library", 185 "//shared/bytesutil:go_default_library", 186 "//shared/testutil/assert:go_default_library", 187 "//shared/testutil/require:go_default_library", 188 ], 189 "//conditions:default": [], 190 }), 191 ) 192 193 # gazelle:exclude bls_benchmark_test.go 194 go_test( 195 name = "go_benchmark_test", 196 size = "small", 197 srcs = ["bls_benchmark_test.go"], 198 args = [ 199 "-test.bench=.", 200 "-test.benchmem", 201 "-test.v", 202 ], 203 local = True, 204 tags = [ 205 "benchmark", 206 "manual", 207 "no-cache", 208 ], 209 deps = [ 210 ":go_default_library", 211 "//shared/bls/common:go_default_library", 212 "//shared/bytesutil:go_default_library", 213 "//shared/hashutil:go_default_library", 214 ], 215 )