NetBSD-Bugs archive

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

bin/40115: make(1) behaviour is inconsistent across parallel and ordinary builds



>Number:         40115
>Category:       bin
>Synopsis:       make(1) behaviour is inconsistent across parallel and ordinary 
>builds
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 05 23:20:00 +0000 2008
>Originator:     Aleksej Saushev <asau%inbox.ru@localhost>
>Release:        NetBSD 5.0_BETA
>Organization:
>Environment:
System: NetBSD asau.local 5.0_BETA NetBSD 5.0_BETA (KERN) #0: Fri Nov 28 
23:33:42 MSK 2008 
asau%asau.local@localhost:/mnt/heap/asau/obj/sys/arch/i386/compile/KERN i386
Architecture: i386
Machine: i386
>Description:
        When running parallel build, change of working directory affects
        consequent command associated to the same target.
        This behaviour is inconsistent with ordinary build, where
        working directory is restored for all consequent commands.

        Create two subdirectories "this" and "that" and the following Makefile:

        all: .PHONY
                pwd && cd ${.CURDIR}/this && echo this
                pwd && cd ${.CURDIR}/that && echo that

        Now run "make" and "make -j2":

        $ make
        pwd && cd /tmp/mk/this && echo this
        /tmp/mk
        this
        pwd && cd /tmp/mk/that && echo that
        /tmp/mk
        that
        $ make -j2
        --- all ---
        pwd && cd /tmp/mk/this && echo this
        /tmp/mk
        this
        pwd && cd /tmp/mk/that && echo that
        /tmp/mk/this
        that

        Notice, that in the second ("-j2") case the working directory of
        the second ("that") command differs from respective of the first
        case: "/tmp/mk/this" vs. "/tmp/mk".

        make(1) exhibit the same behaviour for "-j1":

        $ make -j1
        pwd && cd /tmp/mk/this && echo this
        /tmp/mk
        this
        pwd && cd /tmp/mk/that && echo that
        /tmp/mk/this
        that
>How-To-Repeat:
        mkdir this that
        cat > Makefile << EOF
        all: .PHONY
                pwd && cd ${.CURDIR}/this && echo this
                pwd && cd ${.CURDIR}/that && echo that
        EOF
        make
        make -j1
>Fix:



Home | Main Index | Thread Index | Old Index