Skip to content
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
File renamed without changes.
6 changes: 3 additions & 3 deletions WORKSPACE → WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace(name = "rules_perl")

load("@rules_perl//perl:deps.bzl", "perl_register_toolchains", "perl_rules_dependencies", "perl_rules_dev_dependencies")
load("//:platforms.bzl", "platforms")
load("//perl:platforms.bzl", "PLATFORMS")

perl_rules_dependencies()

Expand All @@ -14,12 +14,12 @@ perl_register_toolchains()
# other than rules_perl.
[
register_toolchains(
"@rules_perl//:perl_{os}_{cpu}_toolchain".format(
"@rules_perl//perl:perl_{os}_{cpu}_toolchain".format(
cpu = platform.cpu,
os = platform.os,
),
)
for platform in platforms
for platform in PLATFORMS
]

# Testing only, do not add to your WORKSPACE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions perl/BUILD → perl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//:platforms.bzl", "platforms")
load(":platforms.bzl", "PLATFORMS")
load(":toolchain.bzl", "current_perl_toolchain", "perl_toolchain")

alias(
Expand Down Expand Up @@ -49,7 +49,7 @@ toolchain_type(
visibility = ["//visibility:public"],
),
)
for platform in platforms
for platform in PLATFORMS
]

# This rule exists so that the current perl toolchain can be used in the `toolchains` attribute of
Expand Down
10 changes: 5 additions & 5 deletions perl/deps.bzl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"""Perl rules dependencies"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//:platforms.bzl", "platforms")
load("//perl:repo.bzl", _perl_download = "perl_download")
load(":platforms.bzl", "PLATFORMS")

perl_download = _perl_download

# buildifier: disable=unnamed-macro
def perl_repos():
for platform in platforms:
for platform in PLATFORMS:
perl_download(
name = "perl_%s_%s" % (platform.os, platform.cpu),
strip_prefix = platform.strip_prefix,
Expand All @@ -21,7 +21,7 @@ def perl_register_toolchains():
"""Register the relocatable perl toolchains."""
perl_repos()

for platform in platforms:
for platform in PLATFORMS:
native.register_toolchains(
"@rules_perl//perl:perl_{os}_{cpu}_toolchain".format(
os = platform.os,
Expand Down Expand Up @@ -69,7 +69,7 @@ def perl_rules_dev_dependencies():
_maybe(
http_archive,
name = "fcgi",
build_file = "//:examples/cpan_remote/fcgi.BUILD",
build_file = "//:examples/cpan_remote/BUILD.fcgi.bazel",
sha256 = "8cfa4e1b14fb8d5acaa22ced672c6af68c0a8e25dc2a9697a0ed7f4a4efb34e4",
strip_prefix = "FCGI-0.79",
url = "https://cpan.metacpan.org/authors/id/E/ET/ETHER/FCGI-0.79.tar.gz",
Expand All @@ -81,7 +81,7 @@ def perl_rules_dev_dependencies():
_maybe(
http_archive,
name = "genhtml",
build_file = "//:examples/genhtml/genhtml.BUILD",
build_file = "//:examples/genhtml/BUILD.genhtml.bazel",
sha256 = "d88b0718f59815862785ac379aed56974b9edd8037567347ae70081cd4a3542a",
strip_prefix = "lcov-1.15/bin",
url = "https://github.com/linux-test-project/lcov/archive/refs/tags/v1.15.tar.gz",
Expand Down
65 changes: 65 additions & 0 deletions perl/platforms.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"""platforms.bzl defines metadata about the different relocatable-perl versions
"""

UNIX_VERSION = "5.40.1.0"

PLATFORMS = [
struct(
os = "darwin",
cpu = "arm64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-darwin-arm64.tar.xz".format(UNIX_VERSION)],
sha256 = "e58b98338bc52f352dc95310363ab6c725897557512b90b593c70ea357f1b2ab",
strip_prefix = "perl-darwin-arm64",
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:aarch64",
],
),
struct(
os = "darwin",
cpu = "amd64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-darwin-amd64.tar.xz".format(UNIX_VERSION)],
sha256 = "6e16d12f6a765cbb708ebcb6fe9c74f0d71e1d648bff0ff7b8d88134e54b736a",
strip_prefix = "perl-darwin-amd64",
exec_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
),
struct(
os = "linux",
cpu = "amd64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-linux-amd64.tar.xz".format(UNIX_VERSION)],
sha256 = "cd3216bd72fa4fe3b76fc7f4e2f1004d75e42495d515c09b53d79cba3700dd7b",
strip_prefix = "perl-linux-amd64",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
),
struct(
os = "linux",
cpu = "arm64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-linux-arm64.tar.xz".format(UNIX_VERSION)],
sha256 = "01b3beb5e5f806a5447e42246b440e54a96c314284a68be89ff2b980ba4a4ec1",
strip_prefix = "perl-linux-arm64",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:arm64",
],
),
struct(
os = "windows",
cpu = "x86_64",
urls = [
"https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit-portable.zip",
"https://mirror.bazel.build/github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit-portable.zip",
],
sha256 = "754f3e2a8e473dc68d1540c7802fb166a025f35ef18960c4564a31f8b5933907",
strip_prefix = "",
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
),
]
File renamed without changes.
71 changes: 9 additions & 62 deletions platforms.bzl
Original file line number Diff line number Diff line change
@@ -1,65 +1,12 @@
"""platforms.bzl defines metadata about the different relocatable-perl versions
"""DEPRECATED: use `@rules_perl//perl:platforms.bzl`
"""

unix_version = "5.40.1.0"
load(
"//perl:platforms.bzl",
"PLATFORMS",
"UNIX_VERSION",
)

platforms = [
struct(
os = "darwin",
cpu = "arm64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-darwin-arm64.tar.xz".format(unix_version)],
sha256 = "e58b98338bc52f352dc95310363ab6c725897557512b90b593c70ea357f1b2ab",
strip_prefix = "perl-darwin-arm64",
exec_compatible_with = [
"@platforms//os:osx",
"@platforms//cpu:aarch64",
],
),
struct(
os = "darwin",
cpu = "amd64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-darwin-amd64.tar.xz".format(unix_version)],
sha256 = "6e16d12f6a765cbb708ebcb6fe9c74f0d71e1d648bff0ff7b8d88134e54b736a",
strip_prefix = "perl-darwin-amd64",
exec_compatible_with = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
),
struct(
os = "linux",
cpu = "amd64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-linux-amd64.tar.xz".format(unix_version)],
sha256 = "cd3216bd72fa4fe3b76fc7f4e2f1004d75e42495d515c09b53d79cba3700dd7b",
strip_prefix = "perl-linux-amd64",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
),
struct(
os = "linux",
cpu = "arm64",
urls = ["https://github.com/skaji/relocatable-perl/releases/download/{}/perl-linux-arm64.tar.xz".format(unix_version)],
sha256 = "01b3beb5e5f806a5447e42246b440e54a96c314284a68be89ff2b980ba4a4ec1",
strip_prefix = "perl-linux-arm64",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:arm64",
],
),
struct(
os = "windows",
cpu = "x86_64",
urls = [
"https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit-portable.zip",
"https://mirror.bazel.build/github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit-portable.zip",
],
sha256 = "754f3e2a8e473dc68d1540c7802fb166a025f35ef18960c4564a31f8b5933907",
strip_prefix = "",
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
),
]
unix_version = UNIX_VERSION

platforms = PLATFORMS
File renamed without changes.
6 changes: 0 additions & 6 deletions test/data_dep/BUILD → test/data_dep/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,3 @@ echo '#!/bin/sh' >$@
echo 'exec env --ignore-environment test/data_dep/program_bin' >>$@
""",
)

# sh_test(
# name = "program_test",
# srcs = ["program_test.sh"],
# data = [":program_bin"],
# )