pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: odd -J complaint from make on netbsd-11



Roland Illig <roland.illig%gmx.de@localhost> writes:

> Am 28.01.2026 um 00:54 schrieb Greg Troxel:
>> I am testing an rc of ups-nut 2.8.5 (wip/ups-nut), and while it's mostly
>> ok, building on NetBSD 11 under pkgrsrc gets me:
>>
>>   make[2]: warning: Invalid internal option "-J" in "/tmp/work/wip/ups-nut/work/nut-2.8.4.1239/tools"; see the manual page
>>
>> upstream doesn't think -J is in the sources.
>>
>> If I build MAKE_JOBS=1 (instead of 4 which my mk.conf defaults to), I
>> don't get the error.
>>
>> If I build -j4 in a subdir -- that provoked the warning from top level,
>> then I don't get a warning.
>>
>> Building on 9 or 10 does not get this error.
>>
>> Has anybody seen this?
>
> As the warning says, "see the manual page". In the diagnostics section,
> there is an extensive explanation of the warning, including a detailed
> approach to track down where exactly this warning comes from.

I tried to read the man page before writing and didn't find it, but now
I do, in netbsd-11.

I find this hard to follow:

  It says "-J private" but there are no hints about how to watch that
  when debugging.   Probably it's a unix-domain socket.

  The warning is about a directory, but now I believe that it's really
  about a sub-make invocation within a rule that is not labeled .MAKE,
  and the location for the warning is the dir in which a make invocation
  was troubled.  But it doesn't give the makefile.

  Turning on MAKE_STACK_TRACE gave me two copies of the stack, in a way
  which did not make sense.

  The diagnostic section talks about this option "becoming valid" but
  I'm confused about whether it's the parent or the child make that is
  objecting, and how that works if you have to mark the target in the
  parent.

  The .MAKE special target is documented to be about -n.  But it's also
  about -J, which happens if you ask for -j, without knowing about -J.



I think I understand what's going on.   The targets that call sub-makes
look like:

  ### Delivers: nut_version.h
  all-libs-local/include:
          +@NUT_VERSION_H_GENERATED=false; export NUT_VERSION_H_GENERATED; \
            $(SUBDIR_TGT_RULE)

where

  SUBDIR_TGT_RULE = ( \
          [ x"$${TGT-}" != x ] || TGT="`echo '$@' | awk -F/ '{print $$1}'`" ; \
          [ x"$${DIR-}" != x ] || DIR="`echo '$@' | sed 's,^[^/]*/,,'`" ; \
          if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
                  echo "  SUBDIR-MAKE     STARTING $@: 'make $${SUBDIR_TGT_MAKEFLAGS-} $$TGT' in $$DIR ..." ; \
          fi ; \
          cd "$(abs_builddir)/$${DIR}" && \
          $(MAKE) $(AM_MAKEFLAGS) $${SUBDIR_TGT_MAKEFLAGS-} "$${TGT}" || { RES=$$?; echo "  SUBDIR-MAKE   FAILURE: 'make $$TGT' in $$DIR" >&2 ; exit $$RES ; } ; \
          if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
                  echo "  SUBDIR-MAKE     SUCCESS  $@: 'make $${SUBDIR_TGT_MAKEFLAGS-} $$TGT' in $$DIR" ; \
          fi ; \
          )


and this I think causes the "rule contains make" not to fire.


I wonder if -J is a concept in other BSD makes.

I wonder if the warning is new in 11, or if the behavior that can warn
is new.

I wonder if you think not noticing the incorporated-by-reference $(MAKE)
is a bug/misfeature?


Home | Main Index | Thread Index | Old Index