From owner-freebsd-bugs@freebsd.org Fri Aug 10 01:39:45 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62AA91054889 for ; Fri, 10 Aug 2018 01:39:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id F0970718BB for ; Fri, 10 Aug 2018 01:39:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id B521E1054886; Fri, 10 Aug 2018 01:39:44 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9322D1054885 for ; Fri, 10 Aug 2018 01:39:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17DC5718B9 for ; Fri, 10 Aug 2018 01:39:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 65A671F46F for ; Fri, 10 Aug 2018 01:39:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A1dh0P072300 for ; Fri, 10 Aug 2018 01:39:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w7A1dhnC072299 for bugs@FreeBSD.org; Fri, 10 Aug 2018 01:39:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 230492] make: -C options doesn't work as explained in man page about value of ${.CURDIR} when logical and physical directory are different. Date: Fri, 10 Aug 2018 01:39:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: yasu@utahime.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 01:39:45 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230492 Bug ID: 230492 Summary: make: -C options doesn't work as explained in man page about value of ${.CURDIR} when logical and physical directory are different. Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: yasu@utahime.org In the man page of make(1) '-C' options is explained as following. ---------------------------------------------------------------------- -C directory Change to directory before reading the makefiles or doing anything else. If multiple -C options are specified, each is interpreted relative to the previous one: -C / -C etc is equivalent to -C /etc. ---------------------------------------------------------------------- This means 'make -C /foo/bar/baz' works same as 'cd /foo/bar/baz; make'. But there is an case that make doesn't behaves so. As explained in summary = it is about value of ${.CURDIR} and happens when logical and physical directory are different. Let me explain it by providing an example. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd1[2018]% pwd /home/yasu/tmp yasu@rolling-vm-freebsd1[2019]% ls -l total 1 lrwxr-xr-x 1 yasu user 3 8=E6=9C=88 10 08:21 bar@ -> foo drwxr-xr-x 2 yasu user 3 8=E6=9C=88 10 08:20 foo/ ---------------------------------------------------------------------- /home/yasu/tmp/foo is real directory and /home/yasu/tmp/bar is symbolic lin= k to it. So logical and physical expression of /home/yasu/tmp/bar is different. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd1[2020]% cd /home/yasu/tmp/bar yasu@rolling-vm-freebsd1[2021]% /bin/pwd -L /home/yasu/tmp/bar yasu@rolling-vm-freebsd1[2022]% /bin/pwd -P /home/yasu/tmp/foo ---------------------------------------------------------------------- And there is following Makefile under /home/yasu/tmp/bar. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd1[2023]% cat Makefile=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ~/tmp/bar all: @echo ${.CURDIR} ---------------------------------------------------------------------- It simply displays value of ${.CURDIR}. Now let's execute make without any arguments. It causes following result. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd1[2024]% make=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 ~/tmp/bar /home/yasu/tmp/foo ---------------------------------------------------------------------- Physical expression of current working directory is displayed. Next, let's execute make with -C options and logical expression of current working directory. In this case it result as following. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd1[2025]% make -C /home/yasu/tmp/bar=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ~/tmp/bar /home/yasu/tmp/bar ---------------------------------------------------------------------- If '-C' options works exactly as explained in man page, same value as previ= ous execution, that is, physical expression of current working directory should= be displayed. Actually, however, what is displayed is logical expression of current working directory. This means '-C' option doesn't work as explained= in man page. I confirmed it happens on both 11.2-RELEASE and 12.0-CURRENT (r337160). --=20 You are receiving this mail because: You are the assignee for the bug.=