tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d3ac06074575c7452c9c996bc885525652ce8e49
parent 64dbe029b83e6a1571de326c85c65048cbffb5c1
Author: Sandor Molnar <smolnar@mozilla.com>
Date:   Thu, 13 Nov 2025 17:04:36 +0200

Revert "Bug 1498414 - Obsolete (HOST_)?EXTRA_DEPS in favor of automatic generation through create_rc.py r=glandium" for causing build bustages

This reverts commit f25a99a5629f4efb8639fbe1766bfad62b79e3c8.

Diffstat:
Mbrowser/app/Makefile.in | 8++++++++
Mconfig/create_rc.py | 35++++-------------------------------
Mconfig/makefiles/debugmake.mk | 1+
Mconfig/rules.mk | 21++++++++++-----------
Mipc/app/Makefile.in | 6++++++
Amozglue/build/Makefile.in | 15+++++++++++++++
Atoolkit/mozapps/defaultagent/proxy/Makefile.in | 8++++++++
7 files changed, 52 insertions(+), 42 deletions(-)

diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in @@ -18,6 +18,14 @@ CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX)) CXX += -march=pentiumpro endif +ifeq ($(OS_ARCH),WINNT) +# Rebuild firefox.exe if the manifest changes - it's included by splash.rc. +# (this dependency should really be just for firefox.exe, not other targets) +# Note the manifest file exists in the tree, so we use the explicit filename +# here. +EXTRA_DEPS += $(srcdir)/firefox.exe.manifest +endif + PROGRAMS_DEST = $(DIST)/bin objdir = $(topobjdir)/browser/app diff --git a/config/create_rc.py b/config/create_rc.py @@ -4,11 +4,10 @@ import io import os -from argparse import ArgumentParser +import sys from datetime import datetime import buildconfig -from mozbuild.makeutil import Makefile from mozbuild.preprocessor import Preprocessor from variables import get_buildid @@ -226,22 +225,8 @@ def has_manifest(module_rc, manifest_id): return False -def generate_module_rc(): - - parser = ArgumentParser() - parser.add_argument( - "binary", help="Binary for which the resource file is generated" - ) - parser.add_argument("--include", help="Included resources") - parser.add_argument("--dep-file", help="Path to the dependency file") - args = parser.parse_args() - - binary = args.binary - rcinclude = args.rc_include - dep_file = args.dep_file - +def generate_module_rc(binary="", rcinclude=None): deps = set() - extra_deps = set() buildid = get_buildid() milestone = buildconfig.substs["GRE_MILESTONE"] app_version = buildconfig.substs.get("MOZ_APP_VERSION") or milestone @@ -317,22 +302,10 @@ def generate_module_rc(): if os.path.exists(manifest_path): manifest_path = manifest_path.replace("\\", "\\\\") data += f'\n{manifest_id} RT_MANIFEST "{manifest_path}"\n' - extra_deps.add(manifest_path) - target = binary or "module" - with open(f"{target}.rc", "w", encoding="latin1") as fh: + with open("{}.rc".format(binary or "module"), "w", encoding="latin1") as fh: fh.write(data) - if dep_file is not None and extra_deps: - dep_dirname = os.path.dirname(dep_file) - os.makedirs(dep_dirname, exist_ok=True) - - mk = Makefile() - rule = mk.create_rule([target, f"{target}.rc"]) - rule.add_dependencies(sorted(extra_deps)) - with open(dep_file, "w") as dep_fd: - mk.dump(dep_fd) - if __name__ == "__main__": - generate_module_rc() + generate_module_rc(*sys.argv[1:]) diff --git a/config/makefiles/debugmake.mk b/config/makefiles/debugmake.mk @@ -104,6 +104,7 @@ showhost: HOST_LDFLAGS \ HOST_LIBS \ HOST_EXTRA_LIBS \ + HOST_EXTRA_DEPS \ HOST_PROGRAM \ HOST_OBJS \ HOST_PROGOBJS \ diff --git a/config/rules.mk b/config/rules.mk @@ -414,7 +414,7 @@ endef # PROGRAM = Foo # creates OBJS, links with LIBS to create Foo # -$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(call resfile,$(PROGRAM)) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET)) +$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(call resfile,$(PROGRAM)) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET)) $(REPORT_BUILD) $(call BUILDSTATUS,START_Program $(@F)) ifeq (clang-cl_WINNT,$(CC_TYPE)_$(OS_ARCH)) @@ -429,7 +429,7 @@ ifdef ENABLE_STRIP endif $(call BUILDSTATUS,END_Program $(@F)) -$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(GLOBAL_DEPS) $(call mkdir_deps,$(DEPTH)/dist/host/bin) +$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) $(call mkdir_deps,$(DEPTH)/dist/host/bin) $(REPORT_BUILD) $(call BUILDSTATUS,START_Program $(@F)) ifeq (clang-cl_WINNT,$(HOST_CC_TYPE)_$(HOST_OS_ARCH)) @@ -452,7 +452,7 @@ endif # creates Foo.o Bar.o, links with LIBS to create Foo, Bar. # define simple_program_deps -$1: $(1:$(BIN_SUFFIX)=.$(OBJ_SUFFIX)) $(STATIC_LIBS) $(call resfile_for_manifest,$1) $(GLOBAL_DEPS) +$1: $(1:$(BIN_SUFFIX)=.$(OBJ_SUFFIX)) $(STATIC_LIBS) $(EXTRA_DEPS) $(call resfile_for_manifest,$1) $(GLOBAL_DEPS) endef $(foreach p,$(SIMPLE_PROGRAMS),$(eval $(call simple_program_deps,$(p)))) @@ -471,7 +471,7 @@ ifdef ENABLE_STRIP endif $(call BUILDSTATUS,END_Program $(@F)) -$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): $(HOST_LIBS) $(GLOBAL_DEPS) +$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) $(REPORT_BUILD) $(call BUILDSTATUS,START_Program $(@F)) ifeq (WINNT_clang-cl,$(HOST_OS_ARCH)_$(HOST_CC_TYPE)) @@ -485,14 +485,14 @@ endif endif $(call BUILDSTATUS,END_Program $(@F)) -$(LIBRARY): $(OBJS) $(STATIC_LIBS) $(GLOBAL_DEPS) +$(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) $(REPORT_BUILD) $(call BUILDSTATUS,START_StaticLib $@) $(RM) $(REAL_LIBRARY) $(AR) $(AR_FLAGS) $($@_OBJS) $(call BUILDSTATUS,END_StaticLib $@) -$(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(GLOBAL_DEPS) +$(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) $(REPORT_BUILD_VERBOSE) $(call BUILDSTATUS,START_WasmLib $@) $(RM) $(WASM_ARCHIVE) @@ -526,7 +526,7 @@ endif # symlinks back to the originals. The symlinks are a no-op for stabs debugging, # so no need to conditionalize on OS version or debugging format. -$(SHARED_LIBRARY): $(OBJS) $(call resfile,$(SHARED_LIBRARY)) $(STATIC_LIBS) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET)) +$(SHARED_LIBRARY): $(OBJS) $(call resfile,$(SHARED_LIBRARY)) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET)) $(REPORT_BUILD) $(call BUILDSTATUS,START_SharedLib $@) $(RM) $@ @@ -791,7 +791,8 @@ endif endif -%.res: $(or $(RCFILE),%.rc) $(MOZILLA_DIR)/config/create_res.py +# EXTRA_DEPS contains manifests (manually added in Makefile.in ; bug 1498414) +%.res: $(or $(RCFILE),%.rc) $(MOZILLA_DIR)/config/create_res.py $(EXTRA_DEPS) $(REPORT_BUILD) $(call BUILDSTATUS,START_Res $@) $(PYTHON3) $(MOZILLA_DIR)/config/create_res.py $(DEFINES) $(INCLUDES) -o $@ $< @@ -799,11 +800,9 @@ endif $(notdir $(addsuffix .rc,$(PROGRAM) $(SHARED_LIBRARY) $(SIMPLE_PROGRAMS) module)): %.rc: $(RCINCLUDE) $(MOZILLA_DIR)/config/create_rc.py $(call BUILDSTATUS,START_Rc $@) - $(PYTHON3) $(MOZILLA_DIR)/config/create_rc.py '$(if $(filter module,$*),,$*)' --include '$(RCINCLUDE)' --dep-file '$(MDDEPDIR)/$@.d' + $(PYTHON3) $(MOZILLA_DIR)/config/create_rc.py '$(if $(filter module,$*),,$*)' '$(RCINCLUDE)' $(call BUILDSTATUS,END_Rc $@) --include $(addsuffix .rc.d, $(addprefix $(MDDEPDIR)/,$(PROGRAM) $(SHARED_LIBRARY) $(SIMPLE_PROGRAMS) module)) - # Cancel GNU make built-in implicit rules MAKEFLAGS += -r diff --git a/ipc/app/Makefile.in b/ipc/app/Makefile.in @@ -10,6 +10,12 @@ ifneq ($(MOZ_WIDGET_TOOLKIT),android) #LIBS += ../contentproc/$(LIB_PREFIX)plugin-container.$(LIB_SUFFIX) endif +ifeq ($(OS_ARCH),WINNT) #{ +# Note the manifest file exists in the tree, so we use the explicit filename +# here. +EXTRA_DEPS += plugin-container.exe.manifest +endif #} + ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{ libs:: diff --git a/mozglue/build/Makefile.in b/mozglue/build/Makefile.in @@ -0,0 +1,15 @@ +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# For FORCE_SHARED_LIB +include $(topsrcdir)/config/config.mk + +ifeq (WINNT,$(OS_TARGET)) +# Rebuild mozglue.dll if the manifest changes - it's included by mozglue.rc. +# (this dependency should really be just for mozglue.dll, not other targets) +# Note the manifest file exists in the tree, so we use the explicit filename +# here. +EXTRA_DEPS += $(srcdir)/mozglue.dll.manifest +endif diff --git a/toolkit/mozapps/defaultagent/proxy/Makefile.in b/toolkit/mozapps/defaultagent/proxy/Makefile.in @@ -0,0 +1,8 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# Rebuild if the resources or manifest change. +EXTRA_DEPS += $(srcdir)/default-browser-agent.exe.manifest + +include $(topsrcdir)/config/rules.mk