use rules_perl toolchain for Windows build of OpenSSL (#846)

* use rules_perl toolchain for Windows build of OpenSSL

* Update repositories.bzl

* Update openssl_repositories.bzl

* Update openssl_repositories.bzl

Co-authored-by: UebelAndre <github@uebelandre.com>
This commit is contained in:
jheaff1 2021-12-30 17:07:10 +00:00 committed by GitHub
parent aa61b9ad8b
commit 7f8183f205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 28 deletions

View File

@ -29,16 +29,6 @@ def autotools_repositories():
sha256 = "431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c",
)
maybe(
http_archive,
name = "rules_perl",
sha256 = "55fbe071971772758ad669615fc9aac9b126db6ae45909f0f36de499f6201dd3",
strip_prefix = "rules_perl-2f4f36f454375e678e81e5ca465d4d497c5c02da",
urls = [
"https://github.com/bazelbuild/rules_perl/archive/2f4f36f454375e678e81e5ca465d4d497c5c02da.tar.gz",
],
)
maybe(
http_archive,
name = "automake",

View File

@ -1,5 +1,8 @@
"""An openssl build file based on a snippet found in the github issue:
https://github.com/bazelbuild/rules_foreign_cc/issues/337
Note that the $(PERL) "make variable" (https://docs.bazel.build/versions/main/be/make-variables.html)
is populated by the perl toolchain provided by rules_perl.
"""
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make", "configure_make_variant")
@ -49,7 +52,6 @@ configure_make_variant(
name = "openssl_msvc",
build_data = [
"@nasm//:nasm",
"@perl//:perl",
],
configure_command = "Configure",
configure_in_place = True,
@ -64,7 +66,7 @@ configure_make_variant(
# The Zi flag must be set otherwise OpenSSL fails to build due to missing .pdb files
"CFLAGS": "-Zi",
"PATH": "$$(dirname $(execpath @nasm//:nasm)):$$PATH",
"PERL": "$(execpath @perl//:perl)",
"PERL": "$$EXT_BUILD_ROOT$$/$(PERL)",
},
lib_name = LIB_NAME,
lib_source = ":all_srcs",
@ -74,6 +76,7 @@ configure_make_variant(
],
targets = MAKE_TARGETS,
toolchain = "@rules_foreign_cc//toolchains:preinstalled_nmake_toolchain",
toolchains = ["@rules_perl//:current_toolchain"],
)
configure_make(

View File

@ -28,25 +28,13 @@ def openssl_repositories():
"https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-win64.zip",
],
)
maybe(
http_archive,
name = "rules_perl",
sha256 = "55fbe071971772758ad669615fc9aac9b126db6ae45909f0f36de499f6201dd3",
strip_prefix = "rules_perl-2f4f36f454375e678e81e5ca465d4d497c5c02da",
sha256 = "765e6a282cc38b197a6408c625bd3fc28f3f2d44353fb4615490a6eb0b8f420c",
strip_prefix = "rules_perl-e3ed0f1727d15db6c5ff84f64454b9a4926cc591",
urls = [
"https://github.com/bazelbuild/rules_perl/archive/2f4f36f454375e678e81e5ca465d4d497c5c02da.tar.gz",
],
)
# rules_perl doesn't currently support Windows, so we need to bring along our own Perl.
# https://github.com/bazelbuild/rules_perl/issues/30
maybe(
http_archive,
name = "perl",
build_file = Label("//openssl:BUILD.perl.bazel"),
sha256 = "aeb973da474f14210d3e1a1f942dcf779e2ae7e71e4c535e6c53ebabe632cc98",
urls = [
"https://mirror.bazel.build/strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.zip",
"https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.zip",
"https://github.com/bazelbuild/rules_perl/archive/e3ed0f1727d15db6c5ff84f64454b9a4926cc591.tar.gz",
],
)