bazel-contrib / rules_perl

Perl rules for Bazel
Apache License 2.0
26 stars 37 forks source link

WIP: Introduce the idea of toolchains and add `perl_xs` rule #13

Closed GregBowyer closed 4 years ago

GregBowyer commented 4 years ago

This is a WIP that introduces the idea of toolchains to the rules, and uses this to download a toolchain for perl.

A downloadable toolchain is provided via the deps.bzl file to allow for a hermetic in tree toolchain of perl. This toolchain is a redistributable perl from skaji although it could probably be reproduced under a different banner for practical reasons of toolchain compliance.

Using the download toolchain is as follows:

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

perl_rules_dependencies()
perl_register_toolchains()

As part of these changes the perl launcher script was replaced with a simpler shell script that covers launching perl_binary and perl_test targets which is aware of the given bazel toolchain.

Along with these changes the perl_xs rule is introduced that allows for perl extension modules to be crudely compiled. This was needed by us at $DAYJOB to get a bunch of cpan modules to be built that use various C extensions (the test of these changes was IO-Tty).

PiotrSikora commented 4 years ago

@GregBowyer thanks for the contribution, let me see if we have someone who can actually review this. @qiwzhang could you take a pass?

@philwo I think we need a proper owners for this repo. I'm definitely not in a position to review this PR, neither on Bazel integration nor Perl side. Do we have anyone from the Bazel team that could own this?

qiwzhang commented 4 years ago

Sorry, I don't have time to maintain this repo. I like to release my ownership to someone else. @philwo could you find someone from bazel tool team to own this?

googlebot commented 4 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

skeletonkey commented 4 years ago

@googlebot I fixed it.

laurentlb commented 4 years ago

@GregBowyer We don't have any maintainer for rules_perl now. If you're using the rules, would you be interested in maintaining the repository?

skeletonkey commented 4 years ago

Greg did the heavy lifting on this, however, I'm the Perl nut so I'll be happy to be the maintainer. I'm sure I'll be asking him many questions getting this up and running properly. I will be grateful for any tips/guidance that you guys may have for me!

skeletonkey commented 4 years ago

@googlebot I fixed it.

skeletonkey commented 4 years ago

@googlebot I fixed it.

skeletonkey commented 4 years ago

I was having some issue with getting a toolchain work for OSX, however, the big reveal was that Mac's use a .bundle or .bd instead of .so. The plan has become to get this out the door for linux and then start working on expanding.

An alternative is to get the toolchain for OSX working and set up the build/test targets to exclude the 'complex_deps'. That way basic perl is available for OXS.

skeletonkey commented 4 years ago

Got the Mac toolchain working. It can't do compiled Perl modules, but it supports all functionality that the current rules_perl version does for Mac. Hopefully, that should follow soon.

Trying this one more time - since I have signed the CLA: @googlebot I fixed it.

PiotrSikora commented 4 years ago

@skeletonkey you've used 3 different addresses in this PR, and neither ...@ticketmaster.com, nor ...@jundy.com signed the CLA.

googlebot commented 4 years ago

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

skeletonkey commented 4 years ago

I think I have it this time ... else I'll just go the consent route.

@googlebot I fixed it.