Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows Builds For Blst #7803

Merged
merged 6 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions shared/bls/blst/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ config_setting(
},
)

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

config_setting(
name = "blst_enabled_linux_arm64",
constraint_values = [
Expand Down Expand Up @@ -68,6 +79,7 @@ go_library(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_windows_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -91,6 +103,7 @@ go_library(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_windows_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -114,6 +127,7 @@ go_test(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_windows_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -127,6 +141,7 @@ go_test(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_windows_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -148,6 +163,7 @@ go_test(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_windows_amd64",
":blst_enabled_android_amd64",
":blst_enabled_android_arm64",
): [
Expand All @@ -161,6 +177,7 @@ go_test(
":blst_enabled_linux_amd64",
":blst_enabled_linux_arm64",
":blst_enabled_darwin_amd64",
":blst_enabled_windows_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 darwin,amd64
// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/bls_benchmark_test.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 windows,amd64
// +build blst_enabled

package blst_test
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 darwin,amd64
// +build linux,amd64 linux,arm64 darwin,amd64 windows,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 darwin,amd64
// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/public_key_test.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 windows,amd64
// +build blst_enabled

package blst_test
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 darwin,amd64
// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/secret_key_test.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 windows,amd64
// +build blst_enabled

package blst_test
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 darwin,amd64
// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64
// +build blst_enabled

package blst
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/blst/signature_test.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 windows,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 windows !blst_enabled
// +build !blst_enabled

package blst

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

// 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"
// This stub file exists until build issues can be resolved for libfuzz.
const err = "blst is only supported on linux,darwin,windows with blst_enabled gotag"

// SecretKey -- stub
type SecretKey struct{}
Expand Down
4 changes: 2 additions & 2 deletions tools/cross-toolchain/cc_toolchain.BUILD.bazel.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ cc_toolchain(
name = "cc-mingw-amd64",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
Expand Down
6 changes: 5 additions & 1 deletion tools/cross-toolchain/cc_toolchain_config_windows.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _impl(ctx):
action_configs = []

install = "/usr/x86_64-w64-mingw32/"
gcc_libpath = "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/"
bin_prefix = "/usr/bin/x86_64-w64-mingw32-"


Expand Down Expand Up @@ -158,7 +159,10 @@ def _impl(ctx):
]

cxx_builtin_include_directories = [
install +"include"
install +"include",
gcc_libpath +"include",
gcc_libpath +"include-fixed",
"/usr/share/mingw-w64/include/"
]

artifact_name_patterns = [
Expand Down