Bug 220605 - [exp-run] stage-qa target for USES=gem runtime dependencies
Summary: [exp-run] stage-qa target for USES=gem runtime dependencies
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D11491
Depends on: 220628 220629 220630 220631 220636 220637 220638 220639 220641 220643 220650 220651 220652 220658 220675 220676 220680 220682 220683 220684 220685 220686 220687 220688 220778 221051 221052 221307 221308 221309
  Show dependency treegraph
Reported: 2017-07-10 15:21 UTC by Nikolai Lifanov
Modified: 2017-11-21 14:14 UTC (History)
3 users (show)

See Also:
lifanov: exp-run?

add new stage-qa step: gemdeps (1.30 KB, patch)
2017-07-10 15:21 UTC, Nikolai Lifanov
no flags Details | Diff
add new stage-qa step: gemdeps (1.40 KB, patch)
2017-07-26 14:26 UTC, Nikolai Lifanov
no flags Details | Diff
add new stage-qa: gemdeps (1.88 KB, patch)
2017-08-05 17:01 UTC, Nikolai Lifanov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Lifanov freebsd_committer 2017-07-10 15:21:15 UTC
Created attachment 184235 [details]
add new stage-qa step: gemdeps

Please perform an exp-run with this patch.

This is intended to make runtime errors evident at build time,
so I expect several ports to fail.
Comment 1 Torsten Zuehlsdorff freebsd_committer 2017-07-10 15:39:25 UTC
I really like this patch and was never able to write it by myself.

One question: does it support the pessimistic operator of the Gem-definition?
Comment 2 Nikolai Lifanov freebsd_committer 2017-07-10 15:54:46 UTC
It uses Gem class to do the actual match:

 bad=$(${LOCALBASE}/bin/ruby -e "puts 'BAD' if not Gem::Dependency.new('$name','$v').match?('$name','$(${LOCALBASE}/bin/gem list -e "$name" | sed "s|.*(\(.*\))|\1|")')")

It works with all operators like ~=, <, etc.
Comment 4 Nikolai Lifanov freebsd_committer 2017-07-11 13:30:58 UTC
Thank you!
Comment 5 Nikolai Lifanov freebsd_committer 2017-07-11 13:33:28 UTC
I'm surprised about failures in rubygem-passenger and libfastcommon.
Comment 6 Po-Chuan Hsieh freebsd_committer 2017-07-11 15:31:53 UTC
FYI, I'm working on the failure of ruby@ ports and mine.
libfastcommon has plist issue.
Comment 7 Nikolai Lifanov freebsd_committer 2017-07-11 17:09:44 UTC
Ohh, cool, thanks!

Would you like me to keep opening new bugs or not?
Comment 8 Nikolai Lifanov freebsd_committer 2017-07-12 17:14:07 UTC
sunpoet: I saw that you fixed devel/rubygem-health_check.
Does this also fix devel/rubygem-health_check22?
Comment 9 Nikolai Lifanov freebsd_committer 2017-07-12 17:31:21 UTC
I think I filed the bugs for the rest of the fallout.
Once the bulk of these is fixed and the new version of the patch is reviewed,
we could run another exp-run.
Comment 10 Nikolai Lifanov freebsd_committer 2017-07-26 14:26:46 UTC
Created attachment 184729 [details]
add new stage-qa step: gemdeps

refresh patch from Phabricator
Comment 11 Nikolai Lifanov freebsd_committer 2017-07-26 14:27:38 UTC
May I have another exp-run with the updated patch please? This one fixes some false-positives and is also significantly changed following feedback.
Comment 13 Nikolai Lifanov freebsd_committer 2017-07-27 16:21:50 UTC
rubygem-cogbot has already been fixed
Comment 14 Nikolai Lifanov freebsd_committer 2017-07-27 16:28:35 UTC
I filed bugs for two new uncovered issues.
Comment 15 Torsten Zuehlsdorff freebsd_committer 2017-08-02 15:56:58 UTC
Question: do i read the patch correct, if i assume that it only checks *.gemspec files?

I explicitly ask for Gemfile based ports like www/redmine or www/gitlab. It would be very very helpful to have this qa for them too, if possible! :)
Comment 16 Nikolai Lifanov freebsd_committer 2017-08-03 14:17:57 UTC
This is an awesome idea, but I'd like to get at least this in first.
Currently it only checks one gemspec file (portname-*.gemspec), but
I would like to later check more gemspec files or Gemfile as well.
Comment 17 Torsten Zuehlsdorff freebsd_committer 2017-08-03 14:50:38 UTC
(In reply to Nikolai Lifanov from comment #16)

> This is an awesome idea, but I'd like to get at least this in first.

Fair enough. Sadly me understanding of the QA script is not enough to just copy your patch. But by trying it i learned something more. 

Some please come back to me, if you have some time for the new QA. It would really help me with all the ports depending on Gems.
Comment 18 Nikolai Lifanov freebsd_committer 2017-08-03 15:06:15 UTC
Absolutely! I can work on a similar thing for non-gem ports once this lands.
Comment 19 Nikolai Lifanov freebsd_committer 2017-08-05 17:01:26 UTC
Created attachment 185047 [details]
add new stage-qa: gemdeps
Comment 20 Nikolai Lifanov freebsd_committer 2017-08-05 17:02:07 UTC
Most issues have been fixed and I attached the patch with latest updates from Phabricator. May I have another exp-run please?
Comment 22 Nikolai Lifanov freebsd_committer 2017-08-07 13:28:43 UTC
Thank you! There were only 3 new failures. I created dependent bugs.
Comment 23 commit-hook freebsd_committer 2017-08-07 19:10:36 UTC
A commit references this bug:

Author: lifanov
Date: Mon Aug  7 19:09:42 UTC 2017
New revision: 447515
URL: https://svnweb.freebsd.org/changeset/ports/447515

  add new stage-qa target: gemdeps

  This checks whether rubygem ports have all of their dependencies
  in gemspec satisfied by what's currently installed. Sample output:

  ====> Running Q/A tests (stage-qa)
  Error: RubyGem dependency archive-tar-minitar = 0.5.2 is not satisfied.
  *** Error code 1

  make: stopped in /usr/home/lifanov/src/svn/freebsd/ports/head/archivers/rubygem-fpm

  These ports would be broken at runtime.

  Big thanks to:
    swills - discussion
    mat - reviews
    antoine - exp runs
    sunpoet - fixing several dozens of ports :)

  PR:		220605
  Reviewed by:	mat, sunpoet
  Approved by:	portmgr (mat)
  Differential Revision:	https://reviews.freebsd.org/D11841

Comment 24 Nikolai Lifanov freebsd_committer 2017-11-21 14:14:15 UTC
Thank you for exp-runs!
I forgot to close this bug.