Add `build_element` support to the ModuleBuild plugin. #121

Closed
wants to merge 1 commit into
from

Projects

None yet

6 participants

@theory
Contributor
theory commented Sep 5, 2012

This is so that, if you have non-Perl files in lib (.js, .sql, .jpg, or whatever), you can tell Module::Build to install them.

I did a bit of testing with MakeMaker, and it looks as if it installs whatever is in lib without having to be told.

@theory
Contributor
theory commented Sep 6, 2012

To be fair, users can also work around this issue by creating a subclass that makes the necessary calls in its constructor, and just specify it in mb_class. This is a little more convenient, though.

@dolmen
Contributor
dolmen commented Sep 7, 2012

Why not put thoses files in share/ and use [ShareDir] ?

@theory
Contributor
theory commented Sep 7, 2012

Because the cod that ends up looking for it may not always find it. For example, Locale::TextDomain looks for files in each directory in @INC. It does not (yet) know to look in the File::ShareDir directory. So I end up having to write instructions like this.

@rjbs
Owner
rjbs commented Jul 25, 2015

I apologize for this patch languishing. I will apply it post haste if rebased. (I had a quick go at it, but it was not trivial.)

@rjbs rjbs added the Needs Rebase label Jul 25, 2015
@karenetheridge
Contributor

I don't think it's a good idea for us to be supporting putting non-perl files into PERL5LIB. That's what a sharedir is for.

@jberger
jberger commented Jul 25, 2015

Share dir does do this but at additional cognitive overhead.

@theory
Contributor
theory commented Jul 30, 2015

Rebased.

@karenetheridge
Contributor

but at additional cognitive overhead.

@jberger what do you mean by this?

@theory
Contributor
theory commented Jul 31, 2015

@karenetheridge This is a feature of Module::Build. You may not want to encourage it, which I get, but then that should go into the Module::Build docs as a recommendation or something (and the EU::MM docs). Ideally, Dist::Zilla would pass through whatever the installer modules support.

@karenetheridge
Contributor

@leont what do you think? Should we try to discourage this feature of Module::Build, or live with it?

@jberger
jberger commented Jul 31, 2015

ShareDir still has the problem of the files being in a different place when you are in a git checkout or after installation. To use it people have to dream up heuristics to decide which scenario they are in. Allowing to install non perl files directly is useful in that you don't need these heuristics.

@karenetheridge
Contributor

ShareDir still has the problem of the files being in a different place when you are in a git checkout or after installation.

Test::File::ShareDir works pretty well (although its guts need a lot of love.. different topic..)

@Leont
Contributor
Leont commented Aug 1, 2015

build_element doesn't map one-on-one with sharedir, really; it's more that its default action kind can be used to a similar effect, but typically that's not a particularly interesting thing to do with it. Discouraging it is silly, encouraging sharedirs when they make sense is sensible, there two are not particularly related in my mind.

@rjbs
Owner
rjbs commented Aug 7, 2015

Thanks, applied!

@rjbs rjbs closed this Aug 7, 2015
@karenetheridge
Contributor

Oops, there's no documentation for this new option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment