NetBSD Problem Report #53213

From www@NetBSD.org  Wed Apr 25 19:02:37 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3D4337A16A
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 25 Apr 2018 19:02:37 +0000 (UTC)
Message-Id: <20180425190236.0EA777A220@mollari.NetBSD.org>
Date: Wed, 25 Apr 2018 19:02:36 +0000 (UTC)
From: steffen@sdaoden.eu
Reply-To: steffen@sdaoden.eu
To: gnats-bugs@NetBSD.org
Subject: make: inference rules: not all paths represented by "internal macros" gain realpath massage
X-Send-Pr-Version: www-1.0

>Number:         53213
>Category:       bin
>Synopsis:       make: inference rules: not all paths represented by "internal macros" gain realpath massage
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 25 19:05:00 +0000 2018
>Last-Modified:  Wed Apr 25 19:20:00 +0000 2018
>Originator:     Steffen
>Release:        8.0 (+ portable bmake)
>Organization:
>Environment:
hunky dory
>Description:
bmake is the only make i know which fails to do the following.
Imagine configuration creates obj/ dir but continues to work from top level.
In the call

   if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
            CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
            XLIBS="${LIBS} ${libs}" ${tmp} &&

we have

  make=bmake makefile=obj/___tmp.mk tmp=obj/___tmp14286

___tmp.mk is

  ${cat} > ${makefile} << \!
  .SUFFIXES: .o .c .x .y
  .c.o:
     $(CC) -I./ $(XINCS) $(CFLAGS) -o $(@) -c $(<)
  .c.x:
     $(CC) -I./ $(XINCS) -E $(<) > $(@)
  .c:
     $(CC) -I./ $(XINCS) $(CFLAGS) $(LDFLAGS) -o $(@) $(<) $(XLIBS)
  !

We end up with (stripped)

  ***  . OS error mapping table generated ... 
  *** tests results
  *** make=bmake makefile=obj/___tmp.mk tmp=obj/___tmp14286
  tcc -I..... -o obj/___tmp14286 /home/steffen/src/nail.git/obj/___tmp14286.c -L....
  tcc: error: could not write 'obj/___tmp14286'
  *** Error code 1

The problem seems to be that bmake selfishly enters obj/ even though it has not been asked to do so, and whereas it creates an absolute version of/for $(<) it does not actually do the same for $(@), so the call fails because there is not obj/obj.




>How-To-Repeat:
If you want to you can clone my MUA, check out the [next] branch and also see

  #?2[steffen@essex nail.git]$ bmake devel
  sh: can't open 'make-config.sh': No such file or directory
  *** Error code 1

  Stop.

happening after the above error occurred, i do not yet know why.
>Fix:

>Audit-Trail:
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/53213: make: inference rules: not all paths represented
 by "internal macros" gain realpath massage
Date: Wed, 25 Apr 2018 21:15:19 +0200

 gnats-admin@netbsd.org wrote:
  |Thank you very much for your problem report.
  |It has the internal identification `bin/53213'.
  |The individual assigned to look at your
  |report is: bin-bug-people. 
  |
  |>Category:       bin
  |>Responsible:    bin-bug-people
  |>Synopsis:       make: inference rules: not all paths represented by \
  |>"internal macros" gain realpath massage
  |>Arrival-Date:   Wed Apr 25 19:05:00 +0000 2018

 Hey!  bmake _automatically_ dives into any directory called obj/
 if there is one!!  Changed that to .obj!!!
 Nonetheless, to me the path absolutification stuff seems incomplete.

 --steffen
 |
 |Der Kragenbaer,                The moon bear,
 |der holt sich munter           he cheerfully and one by one
 |einen nach dem anderen runter  wa.ks himself off
 |(By Robert Gernhardt)

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.