Bug 153049

Summary: [build] PORTS_MODULES= seriously broken if port depends on an executable
Product: Base System Reporter: Pascal Stumpf <Pascal.Stumpf>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Pascal Stumpf 2010-12-12 16:50:04 UTC
The PORTS_MODULES= variable in /etc/make.conf is supposed to automate
building and installing kernel modules from ports. However, it seems
there is a bug in the build system that breaks the build of any port
that depends on an executable (libraries are completely fine though).

cd ${PORTSDIR:-/usr/ports}/net/bwn-firmware-kmod; SYSDIR=/usr/src/sys make -B deinstall deinstall reinstall
===>  Deinstalling for net/bwn-firmware-kmod
===>   Deinstalling bwn-firmware-kmod-0.1.0
===>   bwn-firmware-kmod-0.1.0 depends on executable: b43-fwcutter - not found
===>    Verifying reinstall for b43-fwcutter in /usr/ports/sysutils/b43-fwcutter
===>  Installing for b43-fwcutter-012
===>   Generating temporary packing list
===>  Checking if sysutils/b43-fwcutter already installed
===>   b43-fwcutter-012 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of sysutils/b43-fwcutter
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/sysutils/b43-fwcutter.
*** Error code 1

Stop in /usr/ports/sysutils/b43-fwcutter.
*** Error code 1

Stop in /usr/ports/net/bwn-firmware-kmod.
*** Error code 1

Stop in /usr/ports/net/bwn-firmware-kmod.
*** Error code 1

Stop in /usr/obj/usr/src/sys/CUSTOM.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
/usr/src # which b43-fwcutter
/usr/src # 

Note how it fails to detect that b43-fwcutter even though it's present
on the system. This results in an attempted reinstall of
sysutils/b43-fwcutter, which fails because it is already installed.
Therefore, rebuilding net/bwn-firmware-kmod also fails.


I'm not an expert in the build system of /usr/src, but to me it seems
that $PATH ist not picked up from the environment (which it should be
when building ports).
Comment 1 Garrett Cooper 2012-06-09 20:24:08 UTC
Seems like a dupe of ports/161452 ; dougb has another patch out to
improve this as well:
. What should be committed is an intersection of the two patches.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:12 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped