Skip to content

Commit

Permalink
Fix Blst Build For OSX (#7760)
Browse files Browse the repository at this point in the history
* blst build

* Update stub.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 10, 2020
1 parent 0fb465b commit 8638e2c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
17 changes: 17 additions & 0 deletions shared/bls/blst/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ config_setting(
},
)

config_setting(
name = "blst_enabled_darwin_amd64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
values = {
"define": "blst_enabled=true",
},
)

config_setting(
name = "blst_enabled_linux_arm64",
constraint_values = [
Expand Down Expand Up @@ -56,6 +67,7 @@ go_library(
(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -78,6 +90,7 @@ go_library(
(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -100,6 +113,7 @@ go_test(
(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -112,6 +126,7 @@ go_test(
(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -132,6 +147,7 @@ go_test(
(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -144,6 +160,7 @@ go_test(
(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/aliases.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,amd64 linux,arm64
// +build linux,amd64 linux,arm64 darwin,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/init.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,amd64 linux,arm64
// +build linux,amd64 linux,arm64 darwin,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/public_key.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,amd64 linux,arm64
// +build linux,amd64 linux,arm64 darwin,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/secret_key.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,amd64 linux,arm64
// +build linux,amd64 linux,arm64 darwin,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/signature.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,amd64 linux,arm64
// +build linux,amd64 linux,arm64 darwin,amd64
// +build blst_enabled

package blst
Expand Down
6 changes: 3 additions & 3 deletions shared/bls/blst/stub.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// +build darwin windows !blst_enabled
// +build windows !blst_enabled

package blst

import (
"github.com/prysmaticlabs/prysm/shared/bls/common"
)

// This stub file exists until build issues can be resolved for darwin and windows.
const err = "blst is only supported on linux with blst_enabled gotag"
// This stub file exists until build issues can be resolved for windows.
const err = "blst is only supported on linux,darwin with blst_enabled gotag"

// SecretKey -- stub
type SecretKey struct{}
Expand Down

0 comments on commit 8638e2c

Please sign in to comment.