Bug 147474

Summary: Can't install devel/gettext whenever the linux.ko module is loaded
Product: Ports & Packages Reporter: Kirk Strauser <kirk>
Component: Individual Port(s)Assignee: autotools
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Kirk Strauser 2010-06-04 16:40:01 UTC
Whenever I try to build devel/gettext with Linux compatibility enabled, it fails during the installation step:

Making install in intl-java
/compat/linux/bin/mkdir -p /usr/local/share/gettext
/compat/linux/bin/mkdir -p /usr/local/share/doc/gettext/javadoc2
/compat/linux/bin/mkdir -p /usr/local/share/doc/gettext/javadoc2/gnu/gettext
install  -o root -g wheel -m 444 ./javadoc2/index.html /usr/local/share/doc/gettext/javadoc2/index.html
install: /usr/local/share/doc/gettext/javadoc2/index.html: No such file or directory
*** Error code 71

Stop in /var/tmp/usr/ports/devel/gettext/work/gettext-0.18/gettext-runtime/intl-java.
*** Error code 1

Stop in /var/tmp/usr/ports/devel/gettext/work/gettext-0.18/gettext-runtime/intl-java.
*** Error code

Running the build and install process inside "script" and diffing the output shows that the port tries to use /compat/linux/bin/mkdir (from emulators/linux_base-f10) instead of /bin/mkdir:

--- /tmp/gettext-withoutlinux   2010-06-04 09:59:11.486925826 -0500
+++ /tmp/gettext-withlinux      2010-06-04 10:02:41.365989642 -0500
@@ -13,8 +13,7 @@
 ===>  Configuring for gettext-0.18_1
 checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
 checking whether build environment is sane... yes
-checking for a thread-safe mkdir -p... ELF binary type "3" not known.
-build-aux/install-sh -c -d
+checking for a thread-safe mkdir -p... /compat/linux/bin/mkdir -p
 checking for gawk... gawk
 checking whether make sets $(MAKE)... yes

Using the Linux mkdir causes the directories to be created in /compat/linux instead of / and the rest of the install script is understandably unhappy about that. I can easily repeat this on my system. If you need any further information or experimentation, I'll be happy to provide it.

Fix: 

# kldunload linux; cd /usr/ports/devel/gettext; make clean; make install
How-To-Repeat: # kldload linux; cd /usr/ports/devel/gettext; make clean; make install
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-06-04 16:41:56 UTC
Responsible Changed
From-To: freebsd-ports-bugs->autotools

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Ade Lovett freebsd_committer freebsd_triage 2010-06-04 23:08:49 UTC
State Changed
From-To: open->feedback

Merely loading the linux module will do nothing to affect devel/gettext in 
any way at all, so the subject line is misleading. 

With a populated /compat/linux, I am also unable to reproduce this problem. 

It would seem that, for whatever reason, you have /compat/linux/bin in your 
$PATH ahead of everything else, hence the wrong mkdir is being picked up, 
with the resultant fun and games. 

Please verify that /compat/linux/bin is _not_ in your $PATH, and try again.
Comment 3 Ade Lovett freebsd_committer freebsd_triage 2010-06-05 01:40:16 UTC
State Changed
From-To: feedback->closed

Submitter has /compat/linux/bin in their path.  This is non-standard, and 
not required.  Removing this from $PATH causes the port to build as expected 
just like on thousands of other machines. 

It's also nothing to do with the linux.ko kernel module.
Comment 4 Kirk Strauser 2010-06-05 01:49:31 UTC
This is a new change, and the only port that requires me to modify my  
$PATH. It also does not address why devel/gettext is suddenly *not*  
using FreeBSD's /bin/mkdir. Please consider reopening because the bug  
still exists.
Comment 5 Kirk Strauser 2010-06-05 02:12:03 UTC
I have do have /compat/linux/bin in my $PATH, but at the very end  
(where's it's been since at least 2004, according to "svn log"), and  
it's not the one that my shell ordinarily uses:

# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/ 
bin:/home/kirk/bin:/compat/linux/bin:/compat/linux/sbin:/compat/linux/ 
usr/bin:/compat/linux/usr/sbin
# type mkdir
mkdir is /bin/mkdir

However, the port isn't using FreeBSD's mkdir either in that case.  
 From the output of configure:

checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for a thread-safe mkdir -p... ../build-aux/install-sh -c -d

Removing /compat/linux/bin causes the port to build correctly, so this  
is also an effective temporary workaround.  I still stand by my  
subject, though, as the presence of linux.ko triggers allows the port  
to use the (wrong) Linux mkdir even though FreeBSD's mkdir comes first  
in my $PATH.