Skip to content

lalten/rules_perl

 
 

Repository files navigation

Build status

Perl Rules

The Perl Toolchain utilizes the relocatable perl project.

Getting Started

To import rules_perl in your project, you first need to add it to your WORKSPACE file:

git_repository(
    name = "rules_perl",
    remote = "https://github.com/bazelbuild/rules_perl.git",
    branch = "main",
)

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

perl_rules_dependencies()
perl_register_toolchains()

Once you've imported the rule set into your WORKSPACE, you can then load the perl rules in your BUILD files with:

load("@rules_perl//perl:perl.bzl", "perl_binary")

perl_binary(
    name = "hello_world",
    srcs = ["hello_world.pl"]
)

Please see example folder for more examples of how to include Perl scripts.

Mac Support

Currently, simple perl programs and Pure Perl modules work.

Modules that require compiling are not yet supported.

Windows Support

This repository provides a hermetic Strawberry Perl bazel toolchain for Windows. Usage of the toolchain in perl_ rules is not yet supported.

Using Perl Modules

This is the first