Skip to content

Extendable Perl#3614

Merged
tgamblin merged 12 commits intospack:developfrom
mjwoods:perl-extend
Mar 30, 2017
Merged

Extendable Perl#3614
tgamblin merged 12 commits intospack:developfrom
mjwoods:perl-extend

Conversation

@mjwoods
Copy link
Copy Markdown
Contributor

@mjwoods mjwoods commented Mar 29, 2017

Resolves #1817.

Issue #1817 raises a scenario where installing a package is difficult without making perl extendable. This feature is listed as being up-for-grabs.

I have added support for perl extensions, using R extensions as a guide.

Perl packages use a variety of build methods, some of which are not provided by the core perl distribution. As a test of my perl extension code, I have included an extension that provides one of the common "unofficial" build methods: perl-module-build.

Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! I've been avoiding adding perl as a build dependency to a lot of packages because Spack-built Perl was missing some Perl modules that were present on my system copy. Can you add an XML::Parser package as well? That's the most commonly required one I've been seeing.

Comment thread lib/spack/spack/build_systems/perl.py Outdated
Buildx()
if self.run_tests:
Buildx('test')
Buildx('install')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to split this into multiple phases. It looks like each package has a build and install phase. See basically any package class aside from RPackage to see what I mean.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do ... after lunch!

straightforward way than with MakeMaker. It also does not require a make on
your system - most of the Module::Build code is pure-perl and written in a
very cross-platform way.
"""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should indent this normally like other packages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. But I didn't see a warning about that in the flake8 tests.

@mjwoods
Copy link
Copy Markdown
Contributor Author

mjwoods commented Mar 29, 2017

Hi @adamjstewart - I have an XML::Parser package ready to go, but it depends on the extendable perl feature.

Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjwoods: this is great! Thanks for all the effort putting this together. I have basically the same comments as @adamjstewart but otherwise this LGTM!

Comment thread lib/spack/spack/cmd/create.py Outdated
body = """\
# FIXME: Select appropriate perl build method:
# build_method = 'Makefile.PL' # Default
# build_method = 'Build.PL' # Needed by some packages
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do any packages provide both? And if so, is there any advantage to using one or the other? If not, let's just see which file exists and use that. No need to require the user to specify this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of perl packages, so it is difficult to be sure what works in general. I think auto-detection will work, and we can provide extra overrides if/when we find they are needed.

Comment thread lib/spack/spack/build_systems/perl.py Outdated
makex = inspect.getmodule(self).make
makex()
if self.run_tests:
makex('test')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move the test step to a separate function. See AutotoolsPackage for how this is done. The benefit of this is that packages that don't provide a test target can skip this. Also, if there are any additional/different tests to run, users can override this by adding a test(self) function to their package.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. A separate method is more elegant - I didn't know it was available before.

@mjwoods
Copy link
Copy Markdown
Contributor Author

mjwoods commented Mar 30, 2017

Hi @adamjstewart, I think my recent changes should take care of your requests. I still have some errors from the automated code coverage tests. Are there any tests for the other build systems (e.g. autotools, python) that I could adapt for perl?

@adamjstewart
Copy link
Copy Markdown
Member

Nope, not a lot of tests for specific build systems (yet). The coverage tests don't need to pass for this to be merged, but it is nice.

Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. @alalazo is this missing anything?

@tgamblin tgamblin merged commit 9e43ff8 into spack:develop Mar 30, 2017
@mjwoods mjwoods deleted the perl-extend branch March 31, 2017 03:09
diaena pushed a commit to diaena/spack that referenced this pull request May 26, 2017
* perl: make extendable and add Module::Build package
* perl: allow 'spack create' to identify perl packages from their contents
* perl-module-build: fix indenting of package docstring
* perl: split install() method for extensions into phases
* perl: auto-detect build method (Makefile.PL vs Build.PL) and define a 'check' method
* PerlPackage: use import statements similar to those in AutotoolsPackage
* PerlModule: fix detection of Build.PL
* PerlPackageTemplate: remove extraneous lines to avoid flake8 warnings
* PerlPackageTemplate: split into separate templates for Makefile.PL and Build.PL
* PerlPackage: add cross-references to docstrings
* AutotoolsPackage: fix ambiguous cross-references to avoid errors in doc tests
* PerlbuildPackageTemplate: depend on perl-module-build if Build.PL exists
xavierandrade pushed a commit to xavierandrade/spack that referenced this pull request Jun 16, 2017
* perl: make extendable and add Module::Build package
* perl: allow 'spack create' to identify perl packages from their contents
* perl-module-build: fix indenting of package docstring
* perl: split install() method for extensions into phases
* perl: auto-detect build method (Makefile.PL vs Build.PL) and define a 'check' method
* PerlPackage: use import statements similar to those in AutotoolsPackage
* PerlModule: fix detection of Build.PL
* PerlPackageTemplate: remove extraneous lines to avoid flake8 warnings
* PerlPackageTemplate: split into separate templates for Makefile.PL and Build.PL
* PerlPackage: add cross-references to docstrings
* AutotoolsPackage: fix ambiguous cross-references to avoid errors in doc tests
* PerlbuildPackageTemplate: depend on perl-module-build if Build.PL exists
EmreAtes pushed a commit to EmreAtes/spack that referenced this pull request Jul 10, 2017
* perl: make extendable and add Module::Build package
* perl: allow 'spack create' to identify perl packages from their contents
* perl-module-build: fix indenting of package docstring
* perl: split install() method for extensions into phases
* perl: auto-detect build method (Makefile.PL vs Build.PL) and define a 'check' method
* PerlPackage: use import statements similar to those in AutotoolsPackage
* PerlModule: fix detection of Build.PL
* PerlPackageTemplate: remove extraneous lines to avoid flake8 warnings
* PerlPackageTemplate: split into separate templates for Makefile.PL and Build.PL
* PerlPackage: add cross-references to docstrings
* AutotoolsPackage: fix ambiguous cross-references to avoid errors in doc tests
* PerlbuildPackageTemplate: depend on perl-module-build if Build.PL exists
amklinv pushed a commit that referenced this pull request Jul 17, 2017
* perl: make extendable and add Module::Build package
* perl: allow 'spack create' to identify perl packages from their contents
* perl-module-build: fix indenting of package docstring
* perl: split install() method for extensions into phases
* perl: auto-detect build method (Makefile.PL vs Build.PL) and define a 'check' method
* PerlPackage: use import statements similar to those in AutotoolsPackage
* PerlModule: fix detection of Build.PL
* PerlPackageTemplate: remove extraneous lines to avoid flake8 warnings
* PerlPackageTemplate: split into separate templates for Makefile.PL and Build.PL
* PerlPackage: add cross-references to docstrings
* AutotoolsPackage: fix ambiguous cross-references to avoid errors in doc tests
* PerlbuildPackageTemplate: depend on perl-module-build if Build.PL exists
@scheibelp scheibelp mentioned this pull request Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants