Bug 143830 - [patch] atmconfig(8): Fix conditional inclusion for sbin/atm/atmconfig
Summary: [patch] atmconfig(8): Fix conditional inclusion for sbin/atm/atmconfig
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-12 03:10 UTC by Enji Cooper
Modified: 2015-07-08 17:37 UTC (History)
0 users

See Also:


Attachments
file.diff (686 bytes, patch)
2010-02-12 03:10 UTC, Enji Cooper
no flags Details | Diff
add-missing-WITHOUT_BSNMP-logic.patch (3.00 KB, patch)
2011-10-13 00:15 UTC, Enji Cooper
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2010-02-12 03:10:01 UTC
bsnmp is a requirement for atmconfig even though it's not spelled out as such in bsd.own.mk, so make release (or make -C sbin/atm) fails if WITHOUT_BSNMP=yes is specified, like the following:

===> sbin/atm/atmconfig (depend)
cat /usr/src/sbin/atm/atmconfig/../../../contrib/ngatm/snmp_atm/atm_tree.def	 /usr/src/sbin/atm/atmconfig/../../../usr.sbin/bsnmpd/modules/snmp_atm/atm_freebsd.def | gensnmptree -e `tail -n +2 /usr/src/sbin/atm/atmconfig/atm_oid.list`  > /usr/obj/usr/src/sbin/atm/atmconfig/oid.h
gensnmptree: not found

I could not properly determine how to remove the subdirectory from the make operation as I'm just getting used to the Makefile infrastructure.

Fix: Invoke with `WITHOUT_ATM=no WITHOUT_BSNMP=no' or `WITH_ATM=yes WITH_BSNMP=yes'.

Patch attached with submission follows:
How-To-Repeat: (cd release; make release WITHOUT_BSNMP=yes)
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2010-02-12 19:44:06 UTC
This doesn't appear to be the magic silver bullet that solves the
problem because crud still gets hung up on this error with make
release.

Trying again with a clean tree...

-Garrett
Comment 2 Alexander Best freebsd_committer freebsd_triage 2010-12-31 15:36:53 UTC
any update on this issue? just ran into it and had to install gensnmptree
manually in order for target buildworld to succeed.

cheers.
alex

-- 
a13x
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2011-10-12 22:52:01 UTC
Funny... hit the same problem again almost a year later in a different
portion of the tree:

gensnmptree -e snmpMIB begemotSnmpdModuleTable begemotSnmpd
begemotTrapSinkTable  sysUpTime snmpTrapOID coldStart
authenticationFailure  begemotSnmpdTransUdp begemotSnmpdTransLsock
begemotSnmpdLocalPortTable  freeBSDVersion <
/build/home/gcooper/ix-projects/freenas/ix/FreeBSD/src/usr.sbin/bsnmpd/bsnmpd/../../../contrib/bsnmp/snmpd/tree.def
> oid.h
gensnmptree: not found
gensnmptree: not found
*** Error code 127
*** Error code 127
2 errors
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2

No, I hadn't made any progress on this.

The issue has unrooted itself on a freshly installed system without
bsnmpd support installed (the build image needs bsnmp support though),
so I think that it's safe to say that the problem really lies in the
fact that gensnmptree isn't treated properly like a tool and needs to
be shoved down into src/Makefile.inc1 .

I'll work on whipping up a patch for this sometime this weekend.
Thanks,
-Garrett
Comment 4 Enji Cooper freebsd_committer freebsd_triage 2011-10-13 00:15:30 UTC
On Wed, 12 Oct 2011, Garrett Cooper wrote:

> Funny... hit the same problem again almost a year later in a different
> portion of the tree:
>
> gensnmptree -e snmpMIB begemotSnmpdModuleTable begemotSnmpd
> begemotTrapSinkTable  sysUpTime snmpTrapOID coldStart
> authenticationFailure  begemotSnmpdTransUdp begemotSnmpdTransLsock
> begemotSnmpdLocalPortTable  freeBSDVersion <
> /build/home/gcooper/ix-projects/freenas/ix/FreeBSD/src/usr.sbin/bsnmpd/bsnmpd/../../../contrib/bsnmp/snmpd/tree.def
>> oid.h
> gensnmptree: not found
> gensnmptree: not found
> *** Error code 127
> *** Error code 127
> 2 errors
> *** Error code 2
> 1 error
> *** Error code 2
> 1 error
> *** Error code 2
>
> No, I hadn't made any progress on this.
>
> The issue has unrooted itself on a freshly installed system without
> bsnmpd support installed (the build image needs bsnmp support though),
> so I think that it's safe to say that the problem really lies in the
> fact that gensnmptree isn't treated properly like a tool and needs to
> be shoved down into src/Makefile.inc1 .
>
> I'll work on whipping up a patch for this sometime this weekend.

This should actually do it.
-Garrett
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-08-15 21:23:41 UTC
A commit references this bug:

Author: ngie
Date: Fri Aug 15 21:22:50 UTC 2014
New revision: 270027
URL: http://svnweb.freebsd.org/changeset/base/270027

Log:
  Fix atmconfig compilation when MK_ATM == yes and MK_BSNMP == no

  Makefile.inc1:
  Always compile gensnmptree with bootstrap-tools when MK_BSNMP != no
  instead of depending on a potentially stale tool installed on the build host

  sbin/atm/atmconfig/Makefile:
  - Always remove oid.h to avoid cluttering up the build/src tree.
  - Consolidate all of the RESCUE/MK_BSNMP != no logic under one
  conditional to improve readability
  - Remove unnecessary ${.OBJDIR} prefixing for oid.h and use ${.TARGET} instead
    of spelling out oid.h
  - Add a missing DPADD for ${LIBCRYPTO} when compiled MK_BSNMP == yes and
    MK_OPENSSL == yes and not compiling for /rescue/rescue

  sbin/atm/atmconfig/main.c:
  Change #ifndef RESCUE to #ifdef WITH_BSNMP in main.c to make it
  clear that we're compiling bsnmp support into atmconfig

  Approved by: jmmv (mentor)
  Phabric: D579
  PR: 143830
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Changes:
  head/Makefile.inc1
  head/sbin/atm/atmconfig/Makefile
  head/sbin/atm/atmconfig/main.c
Comment 6 Glen Barber freebsd_committer freebsd_triage 2015-07-08 17:37:20 UTC
Close PRs that have a corresponding commit to resolve the issue.