Bug 1420119 - avoid issues with make's timestamp caching; r=nalexander

When an idl file is updated, files like HandlerData.h are generated as
part of the midl target (eg: midl_done). However, Make may have already
stat'd HandlerData.h and cached its timestamp. Although there is a
dependency from HandlerData.h on midl_done, there is no recipe. As such,
Make assumes that HandlerData.h hasn't actually changed, and uses the
cached value of the timestamp when determining if it should install the
file into dist/include. If the cached value is older, make may not
trigger the install rule, leaving the old header in place and breaking
the build.

MozReview-Commit-ID: 9rdtXIt8mXC

--HG--
extra : rebase_source : 8b22f1d6656d0dbc2c3b5dc53ea2b936fdd637bd
This commit is contained in:
Mike Shal 2018-02-13 16:04:31 -05:00
parent 45fa41101e
commit 15573ecba5
5 changed files with 15 additions and 5 deletions

View File

@ -12,7 +12,9 @@ MIDL_GENERATED_FILES = \
IGeckoCustom.tlb \
$(NULL)
$(MIDL_GENERATED_FILES): done_gen
# Bug 1420119: We need the trailing semicolon here to generate a recipe for the
# midl targets to avoid timestamp caching issues.
$(MIDL_GENERATED_FILES): done_gen ;
done_gen: IGeckoCustom.idl
$(MIDL) $(MIDL_FLAGS) -I $(srcdir) -Oicf $(srcdir)/IGeckoCustom.idl

View File

@ -82,7 +82,9 @@ missing:=$(strip $(foreach onefile,$(strip $(patsubst %.tlb,,$(subst dlldata.c,,
missing_base:=$(sort $(basename $(subst _p.c,,$(subst _i.c,,$(missing)))))
$(MIDL_GENERATED_FILES) : midl_done typelib_done
# Bug 1420119: We need the trailing semicolon here to generate a recipe for the
# midl targets to avoid timestamp caching issues.
$(MIDL_GENERATED_FILES) : midl_done typelib_done ;
ifneq ("$(missing)","")
midl_done : FORCE

View File

@ -12,7 +12,9 @@ MIDL_GENERATED_FILES = \
ISimpleDOM.tlb \
$(NULL)
$(MIDL_GENERATED_FILES): done_gen
# Bug 1420119: We need the trailing semicolon here to generate a recipe for the
# midl targets to avoid timestamp caching issues.
$(MIDL_GENERATED_FILES): done_gen ;
done_gen: ISimpleDOM.idl \
ISimpleDOMNode.idl \

View File

@ -17,7 +17,9 @@ MIDL_GENERATED_FILES = \
export:: $(MIDL_GENERATED_FILES)
$(MIDL_GENERATED_FILES): midl_done
# Bug 1420119: We need the trailing semicolon here to generate a recipe for the
# midl targets to avoid timestamp caching issues.
$(MIDL_GENERATED_FILES): midl_done ;
midl_done: HandlerData.acf HandlerData.idl
$(MIDL) $(MIDL_FLAGS) $(DEFINES) -I $(topobjdir) -I $(DIST)/include -I $(IA2DIR) -I $(MSAADIR) -Oicf -acf $(srcdir)/HandlerData.acf $(srcdir)/HandlerData.idl

View File

@ -11,7 +11,9 @@ MIDL_GENERATED_FILES = \
Accessible.tlb \
$(NULL)
$(MIDL_GENERATED_FILES): done_gen
# Bug 1420119: We need the trailing semicolon here to generate a recipe for the
# midl targets to avoid timestamp caching issues.
$(MIDL_GENERATED_FILES): done_gen ;
done_gen: Accessible.idl
$(MIDL) $(MIDL_FLAGS) -Oicf $(srcdir)/Accessible.idl