unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] Makefile.PL: drop generated lib/PublicInbox.pm in blib/
@ 2021-10-19 11:13 Ævar Arnfjörð Bjarmason
  2021-10-19 11:53 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-10-19 11:13 UTC (permalink / raw)
  To: meta; +Cc: Ævar Arnfjörð Bjarmason

Running "make test" on this project doesn't pass unless you've got an
existing PublicInbox.pm in your @INC, presumably nobody's set this up
on a fresh machine in a while.

This Makefile.PL trickery seems to do it, I've validated this with
this ad-hoc test of committing blib/ and Makefile to the repository:

    git clean -dxf; perl Makefile.PL && make -j8 all && git add -f blib Makefile.PL Makefile && git commit -m"now"

Running that in interactive rebase before/after shows that only the
PublicInbox.pm file was added to blib/lib/. We use $(INST_LIB) instead
of a hardcoded 'blib/lib' now, but it's what ExtUtils::MakeMaker
recommends, so it's probably for the better.

As far as I can tell this broke with 1fae720d (build: generate
PublicInbox.pm with $VERSION, 2021-04-01), but I have not tested
that. See also 1fae720d (build: generate PublicInbox.pm with $VERSION,
2021-04-01) which made the PublicInbox.pm a generated file.
---
 Makefile.PL | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Makefile.PL b/Makefile.PL
index 348a343d..b3ac59be 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -190,6 +190,16 @@ WriteMakefile(
 		FILES => 't/home*/setup* t/home*/t* t/home*/.public-inbox '.
 			't/data-gen/*'
 	},
+	PM => {
+		map {
+			s[^lib/][]s;
+			+('lib/' . $_ => '$(INST_LIB)/' . $_);
+		} grep {
+			# Will include *.pod and an *.h file, but so
+			# would ExtUtils::MakeMaker.
+			m[^lib/];
+		} @manifest
+	},
 );
 
 sub MY::postamble {
-- 
2.33.1.1338.g20da966911a


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Makefile.PL: drop generated lib/PublicInbox.pm in blib/
  2021-10-19 11:13 [PATCH] Makefile.PL: drop generated lib/PublicInbox.pm in blib/ Ævar Arnfjörð Bjarmason
@ 2021-10-19 11:53 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2021-10-19 11:53 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: meta

Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> Running "make test" on this project doesn't pass unless you've got an
> existing PublicInbox.pm in your @INC, presumably nobody's set this up
> on a fresh machine in a while.
> 
> This Makefile.PL trickery seems to do it, I've validated this with
> this ad-hoc test of committing blib/ and Makefile to the repository:
> 
>     git clean -dxf; perl Makefile.PL && make -j8 all && git add -f blib Makefile.PL Makefile && git commit -m"now"
> 
> Running that in interactive rebase before/after shows that only the
> PublicInbox.pm file was added to blib/lib/. We use $(INST_LIB) instead
> of a hardcoded 'blib/lib' now, but it's what ExtUtils::MakeMaker
> recommends, so it's probably for the better.

That works for me.

> As far as I can tell this broke with 1fae720d (build: generate
> PublicInbox.pm with $VERSION, 2021-04-01), but I have not tested
> that. See also 1fae720d (build: generate PublicInbox.pm with $VERSION,
> 2021-04-01) which made the PublicInbox.pm a generated file.

Thanks, applied and pushed as 8377d44046ade5becb21f71e4d1d68dd6ae2bbf0

Fwiw, "make check" or "make check-run" can be way faster on SMP
systems; so I don't think anybody's run the EU::MM "make test"
in ages.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-19 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 11:13 [PATCH] Makefile.PL: drop generated lib/PublicInbox.pm in blib/ Ævar Arnfjörð Bjarmason
2021-10-19 11:53 ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).