Skip to content
This repository

DAGOLDEN unified mega patch -- prepare/make, fix prereqs, recommends/suggests, default mirror #38

Merged
merged 45 commits into from about 1 year ago

3 participants

David Golden andk shadowcat-mst
David Golden

This patch includes all my work since Paris last year:

  • prepare/make split (mst's work)
  • fixing various prereq bugs
  • refactor get/prepare/make/test/install shorcut logic
  • recommends/suggests policies and support
  • www.cpan.org as default mirror

I suggest it be merged to master so further work can build on it and if there any remaining bugs, we'll squash them as we go.

shadowcat-mst and others added some commits
shadowcat-mst shadowcat-mst factor prepare() out of make() in CPAN::Distribution (first cut) 7f21891
shadowcat-mst shadowcat-mst factor prereq_for_slot out of unsat_prereq 34b0159
shadowcat-mst shadowcat-mst make MM versus MB choice during prepare, not get 587b914
David Golden dagolden Report no reanimation even when build_dir empty
This fixes failing t/30shell.t with Expect introduced in
commit 27252dd.
ce1c545
David Golden dagolden make t/30shell.t tests less sensitive to output line order c0590b7
shadowcat-mst shadowcat-mst make prepare skip already-written correctly d1b4bbf
David Golden dagolden Shortcut prereq_pm if no Makefile/Build exists
If configuration aborts with "exit 0", no Makefile and
no Build file will exist.  In such a case, we shouldn't
continue checking for prerequisites.

This avoids a late, confusing warning warning about being unable to read
META if a distribution has no META.  The warning was being triggered at
the end of queue processing, when color_cmd_tmps is called to reset
everything and calls prereq_pm.
e55b963
David Golden dagolden xdg XXX notes aefb1ed
David Golden dagolden factor out get() shortcut logic 8f943ed
David Golden dagolden clean up shortcut_get code
This cleanup preserves the logic, but simplifies the code through
a a more consistent parallel structure

I added additional comments where error handling seemed unclear
or potentially incorrect
47cce06
David Golden dagolden have get() return true on success 4d0facb
David Golden dagolden factor out prepare() shortcut logic 2a17fbb
David Golden dagolden allow customizing t/30shell.t timeout with CPAN_EXPECT_TIMEOUT 9c546d7
David Golden dagolden rearranging get/prepare shortcut logic 4d2689d
David Golden dagolden move get's goto check into shortcut_get method 4dc1f81
David Golden dagolden refactor disabled checks 94d60a1
David Golden dagolden xdg question on isa_perl handling 7fe518d
David Golden dagolden cleanup prepare() shortcut logic
Also moves when/how some related checks happen in make().
414bca1
David Golden dagolden refactor make shortcut logic c6b9c1b
David Golden dagolden refactor test shortcut logic f41a54f
David Golden dagolden refactor install shortcut logic e3b6eb8
David Golden dagolden disabled checks can be delegated down to get() e36534e
David Golden dagolden make goto stanzas consistent
They now are at the start of install/test/make/prepare/get and all
have debug statements attached
74d1134
David Golden dagolden make shorcut_* more consistent
Adds success/goodbye helpers to shortcut_get.

Adds debug statments shorcut_* stanzas if they didn't have them.
bb6e16d
David Golden dagolden fix indent level of shortcut_prepare 6852965
David Golden dagolden Fix bugs in shortcut logic 1270d02
David Golden dagolden improve configuration status message dc22709
David Golden dagolden only complain about missing YAML once 4037039
David Golden dagolden eliminate extra newline in missing YAML message c999f72
David Golden dagolden format success() messages like goodbye() messages 98ed77d
David Golden dagolden fix prereq handling logic
This unbreaks configure_requires, which was broken somewhere in
refactoring.

The change makes satisfy_configure_requires and satisfy_requires
have similar return logic.

It changes how queuerunner deals with return values so that
regardless of the success/failure of the method, the item processed
gets removed from the queue.

If there are prereqs that need to be satisfied first, the item was
requeued anyway.
bb0152f
David Golden dagolden add diagnostics to delete_first 659aa40
David Golden dagolden Ensure items are deleted from queue on success.
If an object is queued multiple times, it can be purged from
the queue once it completes successfully.

Now that various functions return false when prereqs are not
satisfied, this now appears safe to do.
616373e
David Golden dagolden fix return value of test() based on test results e65b878
David Golden dagolden fix install/test/make/prepare/get return logic 59580fc
David Golden dagolden add recommends/suggests_policy options 116ffa5
David Golden dagolden add interesting modules to Makefile.PL b3e14ea
David Golden dagolden fix bug merging requires and build_requires
Also adds CPAN::Meta::Requirements as prereq
8babdc7
David Golden dagolden First cut implementation of recommends/suggests support 75d95e0
David Golden dagolden don't flag missing optional prereqs 3564e15
David Golden dagolden note optional modules in the failure report
When failures are reported, any optional prerequisites
have "(optional)" prepended to the line to clearly
indicate the nature of the failing distribution
a5a9e34
David Golden dagolden xdg annotation 2bb6788
David Golden dagolden store persistent state if prepare() is successful e3613dc
David Golden dagolden make www.cpan.org the default CPAN mirror e3e878b
David Golden dagolden Update Changes for dagolden-unified branch 2b57787
David Golden dagolden referenced this pull request
Closed

split prepare/make stuff #26

Tatsuhiko Miyagawa miyagawa referenced this pull request in miyagawa/cpanminus
Closed

Never install recommended modules by default #252

David Golden

Nudge. Now that 5.18 is shipped, could you please consider this for merging? Thanks!

andk andk merged commit 2b57787 into from
andk andk closed this
David Golden

Thank you!

andk
Owner
andk commented

This jumbo patch contains a bit too much to be practical to deal with. Please bear with me in the future and hack pull requests smaller. I decided to merge it in because it is still the beginning of a perl release cycle and we have a bit of time.

I checked the result out on my smoker and tried only one command:

force test CPAN::Test::Dummy::Perl5::Build::Fails

I got a lot of noise back:

Use of uninitialized value $prereqs{"opt_build_requires"} in concatenation (.) or string at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 1462.
Use of uninitialized value $prereqs{"requires"} in concatenation (.) or string at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 1462.
Use of uninitialized value $prereqs{"opt_requires"} in concatenation (.) or string at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 1462.
Use of uninitialized value $need_length in numeric gt (>) at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 975.
Use of uninitialized value $need_length in numeric gt (>) at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 975.
Use of uninitialized value $need_length in numeric gt (>) at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 975.
Use of uninitialized value $need in sprintf at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 996.
Use of uninitialized value $need in sprintf at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 996.
Use of uninitialized value $need in sprintf at /home/src/perl/repoperls/installed-perls/perl/v5.19.0-546-gf378d7a/127e/lib/site_perl/5.19.1/CPAN/Reporter.pm line 996.

Can you spot what needs to be done?

andk
Owner
andk commented

Oh, and it said

CPAN::Reporter: test results were not valid, Prerequisite missing:
requires:

  Module             Need            Have
  ------------------ --------------- ----
! build_requires     HASH(0xd8f6da0) n/a 
! opt_build_requires                 n/a 
! opt_requires                       n/a 
! requires                           n/a 

What's that?

andk
Owner
andk commented

Also watch what my make test says:

Test Summary Report
-------------------
t/30shell.t          (Wstat: 65280 Tests: 200 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 223 tests but ran 200.
t/44cpanmeta.t       (Wstat: 2048 Tests: 55 Failed: 8)
  Failed tests:  20, 25, 30, 35, 40, 45, 50, 55
  Non-zero exit status: 8
Files=21, Tests=533, 256 wallclock secs ( 0.51 usr  0.04 sys + 11.12 cusr  1.46 csys = 13.13 CPU)
Result: FAIL
Failed 2/21 test programs. 8/533 subtests failed.
David Golden

Sorry about the size of it. It was originally a merge of work I did with work that mst did, with subsequent work that would have clashed with both if done separately. I wish I could have chunked it up more. Sort of the story of whoever said "I apologize for the length of this letter; I didn't have time to write a shorter one".

I'll look into the issues and see what we can do.

andk
Owner
andk commented

I have reverted four of the ~60 commits and all tests pass again. Suggests* and Recommends* are now incomplete or rather only rudimentary features.

andk
Owner
andk commented

I got a confirmation from github that the issue tracker for a pullrequest is automatically closed when a merge happens and cannot be reopened. Please direct any further discussion on this to new tickets.

David Golden dagolden deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 45 unique commits by 2 authors.

Apr 13, 2013
shadowcat-mst shadowcat-mst factor prepare() out of make() in CPAN::Distribution (first cut) 7f21891
shadowcat-mst shadowcat-mst factor prereq_for_slot out of unsat_prereq 34b0159
shadowcat-mst shadowcat-mst make MM versus MB choice during prepare, not get 587b914
David Golden dagolden Report no reanimation even when build_dir empty
This fixes failing t/30shell.t with Expect introduced in
commit 27252dd.
ce1c545
David Golden dagolden make t/30shell.t tests less sensitive to output line order c0590b7
shadowcat-mst shadowcat-mst make prepare skip already-written correctly d1b4bbf
David Golden dagolden Shortcut prereq_pm if no Makefile/Build exists
If configuration aborts with "exit 0", no Makefile and
no Build file will exist.  In such a case, we shouldn't
continue checking for prerequisites.

This avoids a late, confusing warning warning about being unable to read
META if a distribution has no META.  The warning was being triggered at
the end of queue processing, when color_cmd_tmps is called to reset
everything and calls prereq_pm.
e55b963
David Golden dagolden xdg XXX notes aefb1ed
David Golden dagolden factor out get() shortcut logic 8f943ed
David Golden dagolden clean up shortcut_get code
This cleanup preserves the logic, but simplifies the code through
a a more consistent parallel structure

I added additional comments where error handling seemed unclear
or potentially incorrect
47cce06
David Golden dagolden have get() return true on success 4d0facb
David Golden dagolden factor out prepare() shortcut logic 2a17fbb
David Golden dagolden allow customizing t/30shell.t timeout with CPAN_EXPECT_TIMEOUT 9c546d7
David Golden dagolden rearranging get/prepare shortcut logic 4d2689d
David Golden dagolden move get's goto check into shortcut_get method 4dc1f81
David Golden dagolden refactor disabled checks 94d60a1
David Golden dagolden xdg question on isa_perl handling 7fe518d
David Golden dagolden cleanup prepare() shortcut logic
Also moves when/how some related checks happen in make().
414bca1
David Golden dagolden refactor make shortcut logic c6b9c1b
David Golden dagolden refactor test shortcut logic f41a54f
David Golden dagolden refactor install shortcut logic e3b6eb8
David Golden dagolden disabled checks can be delegated down to get() e36534e
David Golden dagolden make goto stanzas consistent
They now are at the start of install/test/make/prepare/get and all
have debug statements attached
74d1134
David Golden dagolden make shorcut_* more consistent
Adds success/goodbye helpers to shortcut_get.

Adds debug statments shorcut_* stanzas if they didn't have them.
bb6e16d
David Golden dagolden fix indent level of shortcut_prepare 6852965
David Golden dagolden Fix bugs in shortcut logic 1270d02
David Golden dagolden improve configuration status message dc22709
David Golden dagolden only complain about missing YAML once 4037039
David Golden dagolden eliminate extra newline in missing YAML message c999f72
David Golden dagolden format success() messages like goodbye() messages 98ed77d
David Golden dagolden fix prereq handling logic
This unbreaks configure_requires, which was broken somewhere in
refactoring.

The change makes satisfy_configure_requires and satisfy_requires
have similar return logic.

It changes how queuerunner deals with return values so that
regardless of the success/failure of the method, the item processed
gets removed from the queue.

If there are prereqs that need to be satisfied first, the item was
requeued anyway.
bb0152f
David Golden dagolden add diagnostics to delete_first 659aa40
David Golden dagolden Ensure items are deleted from queue on success.
If an object is queued multiple times, it can be purged from
the queue once it completes successfully.

Now that various functions return false when prereqs are not
satisfied, this now appears safe to do.
616373e
David Golden dagolden fix return value of test() based on test results e65b878
David Golden dagolden fix install/test/make/prepare/get return logic 59580fc
David Golden dagolden add recommends/suggests_policy options 116ffa5
David Golden dagolden add interesting modules to Makefile.PL b3e14ea
David Golden dagolden fix bug merging requires and build_requires
Also adds CPAN::Meta::Requirements as prereq
8babdc7
David Golden dagolden First cut implementation of recommends/suggests support 75d95e0
David Golden dagolden don't flag missing optional prereqs 3564e15
David Golden dagolden note optional modules in the failure report
When failures are reported, any optional prerequisites
have "(optional)" prepended to the line to clearly
indicate the nature of the failing distribution
a5a9e34
David Golden dagolden xdg annotation 2bb6788
David Golden dagolden store persistent state if prepare() is successful e3613dc
David Golden dagolden make www.cpan.org the default CPAN mirror e3e878b
David Golden dagolden Update Changes for dagolden-unified branch 2b57787
Something went wrong with that request. Please try again.