bugmake - Bugs: bug #38827, Make tool does not work for...

 
 

bug #38827: Make tool does not work for pre-build steps with parallel build option

Submitter:  Sluvy <python12>
Submitted:  Thu 25 Apr 2013 02:23:24 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.82 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 27 Apr 2013 04:39:14 PM UTC, comment #1: 

This is not a bug.  By declaring dummyfolder to be a prerequisite of my-main-rule, make must either build it or it must already exist.  It doesn't exist, and there's no rule to build it (make has no way to know that the pre-build rule will create the dummyfolder target).

Further, although my-main-rule will not start until after pre-build and dummyfolder are both built, there is nothing at all here that says that dummyfolder can't start as soon as possible, before pre-build is complete.  So make tries to build dummyfolder and fails.

In general it's best if you never try to have rules do tricky things like build targets which are not specifically declared in makefiles.  However, the bug tracker is not the best place for these kinds of discussions.  Please request assistance on the -email is unavailable- mailing list.

Paul D. Smith <psmith>
Group administrator
Thu 25 Apr 2013 02:23:24 PM UTC, original submission:  

Here is a simple makefile to reproduce the bug:


# invoke this makefile with parallel jobs:
# make -j8 all
# 1. the my-main-rule rule has a dependency on the dummyfolder
# 2. the dummyfolder is created during pre-build step
# 3. pre-build rule is a prerequisite for the my-main-rule which means
# my-main-rule executes only if pre-build step finished
#
# It fails to execute make -j8 all:
# mingw32-make: * No rule to make target `dummyfolder', needed by `my-main-rule'.  Stop.
# mingw32-make: * Waiting for unfinished jobs....
# '     Before executing PRE BUILD step '
# mkdir dummyfolder
# '     After executing PRE BUILD step '

all: main-build

main-build: pre-build my-main-rule

# Tool invocations
my-main-rule: dummyfolder | pre-build
@echo 'Building target'

pre-build:
-@echo '     Before executing PRE BUILD step '
-mkdir dummyfolder
-@echo '     After executing PRE BUILD step '


Sluvy <python12>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #27938:  makefile added by python12 (880B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by python12 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-27 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed
    2013-04-25 python12 Attached File- Added makefile, #27938

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code