On 3/6/17 3:02 PM, Simon J. Gerraty wrote:
> Author: sjg
> Date: Mon Mar  6 23:02:33 2017
> New Revision: 314808
> URL: https://svnweb.freebsd.org/changeset/base/314808
> 
> Log:
>   Merge bmake-20170301
> 
> Modified:
>   head/contrib/bmake/ChangeLog
>   head/contrib/bmake/Makefile
>   head/contrib/bmake/PSD.doc/tutorial.ms
>   head/contrib/bmake/bmake.1
>   head/contrib/bmake/bmake.cat1
>   head/contrib/bmake/dir.c
>   head/contrib/bmake/main.c
>   head/contrib/bmake/make.1
>   head/contrib/bmake/meta.c
>   head/contrib/bmake/mk/ChangeLog
>   head/contrib/bmake/mk/dirdeps.mk
>   head/contrib/bmake/mk/dpadd.mk
>   head/contrib/bmake/mk/install-mk
>   head/contrib/bmake/mk/meta.stage.mk
>   head/contrib/bmake/mk/meta2deps.py
>   head/contrib/bmake/mk/prog.mk
>   head/contrib/bmake/mk/subdir.mk
>   head/contrib/bmake/mk/sys.mk
>   head/contrib/bmake/mk/sys.vars.mk
>   head/contrib/bmake/os.sh
>   head/contrib/bmake/parse.c
>   head/contrib/bmake/unit-tests/varmisc.exp
>   head/contrib/bmake/unit-tests/varmisc.mk
>   head/contrib/bmake/var.c
>   head/usr.bin/bmake/Makefile
> Directory Properties:
>   head/contrib/bmake/   (props changed)
> 
> Modified: head/contrib/bmake/ChangeLog
> ==============================================================================
> --- head/contrib/bmake/ChangeLog      Mon Mar  6 22:46:49 2017        
> (r314807)
> +++ head/contrib/bmake/ChangeLog      Mon Mar  6 23:02:33 2017        
> (r314808)
> @@ -1,3 +1,32 @@
> +2017-03-01  Simon J. Gerraty  <s...@bad.crufty.net>
> +
> +     * Makefile (_MAKE_VERSION): 20170301
> +       Merge with NetBSD make, pick up
> +       o main.c: use -C arg as is rather than getcwd()
> +         if they identify the same directory.
> +

This change is broken for relative paths specified to -C.  I had just
convinced someone that -C was flawless last week and now it's actually
broken!

> ~/git/freebsd/lib/libthr # make -C ../libnetbsd obj
> /usr/obj../libnetbsd created for ../libnetbsd
> ~/git/freebsd/lib/libthr # rm -rf /usr/obj../libnetbsd
> ~/git/freebsd/lib/libthr # make -C ../libthr -V .OBJDIR
> make: "../libthr/../libthr/Makefile" line 14: Could not find src.opts.mk
> make: "../libthr/../libthr/Makefile" line 55: Malformed conditional 
> (${MK_INSTALLLIB} != "no")
> make: "../libthr/../libthr/Makefile" line 61: Malformed conditional 
> (${MK_PROFILE} != "no")
> make: "../libthr/../libthr/Makefile" line 65: Malformed conditional 
> (${MK_TESTS} != "no")
> make: Fatal errors encountered -- cannot continue
> make: stopped in ../libthr
> ~/git/freebsd/lib/libthr # make -C ../libnetbsd  -V .OBJDIR
> make: "/usr/share/mk/bsd.obj.mk" line 1: here
> ../libnetbsd/../libnetbsd
> ~/git/freebsd/lib/libthr # make -m .../share/mk -C ../libnetbsd  -V .OBJDIR
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 45: OBJDIR: 
> ../libnetbsd/../libnetbsd
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 46: CURDIR: ../libnetbsd
> ../libnetbsd/../libnetbsd

2 problems:
1. .OBJDIR is somehow duplicate ${.CURDIR}${.CURDIR}
2. The default MAKESYSPATH of .../share/mk doesn't work with -C .., it
ends up reaching out to /usr/share/mk.  An explicit -m works though.

Reverting it:

> ~/git/freebsd/lib/libthr # make -C ../libnetbsd  -V .OBJDIR
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 45: OBJDIR: 
> /root/git/freebsd/lib/libnetbsd
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 46: CURDIR: 
> /root/git/freebsd/lib/libnetbsd
> /root/git/freebsd/lib/libnetbsd


Can this piece please be reverted for now while relative paths get more
testing?

> diff --git contrib/bmake/main.c contrib/bmake/main.c
> index 087438927355..870eefd6e591 100644
> --- contrib/bmake/main.c
> +++ contrib/bmake/main.c
> @@ -389,6 +389,7 @@ MainParseArgs(int argc, char **argv)
>         int arginc;
>         char *argvalue;
>         const char *getopt_def;
> +       struct stat sa, sb;
>         char *optscan;
>         Boolean inOption, dashDash = FALSE;
>         char found_path[MAXPATHLEN + 1];        /* for searching for sys.mk */
> @@ -457,6 +458,11 @@ rearg:
>                                 (void)fprintf(stderr, "%s: %s.\n", progname, 
> strerror(errno));
>                                 exit(2);
>                         }
> +                       if (stat(argvalue, &sa) != -1 &&
> +                           stat(curdir, &sb) != -1 &&
> +                           sa.st_ino == sb.st_ino &&
> +                           sa.st_dev == sb.st_dev)
> +                               strncpy(curdir, argvalue, MAXPATHLEN);
>                         ignorePWD = TRUE;
>                         break;
>                 case 'D':



-- 
Regards,
Bryan Drewery

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to