Bug 213959 - textproc/rubygem-nokogiri fails to build via portmaster, succeeds using CLI make package
Summary: textproc/rubygem-nokogiri fails to build via portmaster, succeeds using CLI m...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ruby (Nobody)
Depends on:
Reported: 2016-10-31 22:17 UTC by dewayne
Modified: 2016-12-05 20:12 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2016-10-31 22:17:30 UTC
While building security/metasploit on FreeBSD10.3S, I experience consistent build failures with the textproc/rubygem-nokogiri dependency.  It is not easy to reproduce!

I build a large number of ports by passing to portmaster the main ports of interest, rubygem-nokogiri fails to "package".  However if I build directly on the command line with "make package", the port completes.  Examining the two log files provides a clue:

With portmaster - and failure
===>  Building for rubygem-nokogiri-1.6.8
  Successfully built RubyGem
  Name: nokogiri
  Version: 1.6.8
  File: nokogiri-1.6.8.gem
===>  Staging for rubygem-nokogiri-1.6.8
===>   Generating temporary packing list
(cd /var/ports/usr/ports/textproc/rubygem-nokogiri/work/nokogiri-1.6.8; /usr/bin/env RB_USER_INSTALL=yes LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_CTYPE=UTF-8 /usr/local/bin/gem22 install -l --no-update-sources --install-dir /var/ports/usr/ports/textproc/rubygem-nokogiri/work/stage/usr/local/lib/ruby/gems/2.2 --ignore-dependencies --bindir=/var/ports/usr/ports/textproc/rubygem-nokogiri/work/stage/usr/local/bin --no-rdoc --no-ri nokogiri-1.6.8.gem -- --build-args --use-system-libraries)
Building native extensions with: '--build-args --use-system-libraries'
This could take a while...
ERROR:  Error installing nokogiri-1.6.8.gem:
        ERROR: Failed to build gem native extension.

With make - and success
===>  Building for rubygem-pkg-config-1.1.7_1
  Successfully built RubyGem
  Name: pkg-config
  Version: 1.1.7
  File: pkg-config-1.1.7.gem
===>  Staging for rubygem-pkg-config-1.1.7_1
===>   rubygem-pkg-config-1.1.7_1 depends on file: /usr/local/bin/ruby22 - found
===>   rubygem-pkg-config-1.1.7_1 depends on file: /usr/local/bin/gem22 - found
===>   Generating temporary packing list
(cd /var/ports/usr/ports/devel/rubygem-pkg-config/work/pkg-config-1.1.7; /usr/bin/env RB_USER_INSTALL=yes LANG=en_U
Successfully installed pkg-config-1.1.7
1 gem installed

I haven't determined where the problem lies, but the "fix" is to 
--- /usr/ports/textproc/rubygem-nokogiri/Makefile       (revision 424946)
+++ /usr/ports/textproc/rubygem-nokogiri/Makefile       (working copy)
@@ -10,6 +10,7 @@


+BUILD_DEPENDS= rubygem-pkg-config>=1.1.7:devel/rubygem-pkg-config
 RUN_DEPENDS=   rubygem-pkg-config>=1.1.7:devel/rubygem-pkg-config

 USE_RUBY=      yes

and metasploit completes packaging :)
Comment 1 commit-hook freebsd_committer 2016-12-05 20:04:48 UTC
A commit references this bug:

Author: swills
Date: Mon Dec  5 20:04:34 UTC 2016
New revision: 427918
URL: https://svnweb.freebsd.org/changeset/ports/427918

  textproc/rubygem-nokogiri: fails to build

  PR:		213959
  Submitted by:	dewayne@heuristicsystems.com.au

Comment 2 Steve Wills freebsd_committer 2016-12-05 20:12:09 UTC
I think that is the right solution, so I went ahead and committed that. The RUN_DEPENDS may even not be needed, but no harm leaving it for now, I think. So, change committed, thanks!