Skip to content

Commit 6faa4f3

Browse files
committed
auto merge of #17129 : epdtry/rust/misc/llvm-root-reconfig, r=brson
Currently `./configure --llvm-root=...` and similar flags will break incremental builds by forcing reconfiguration on every `make`. This happens because `reconfig.mk` incorrectly treats submodules in the `-` (uninitialized) state as requiring reconfiguration, and `./configure` deliberately deinitializes unneeded submodules. The fix is to reconfigure only when submodules are in the `+` state (wrong commit checked out).
2 parents 4049a4d + ba43f7b commit 6faa4f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mk/reconfig.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
1515

1616
ifndef CFG_DISABLE_MANAGE_SUBMODULES
1717
# This is a pretty expensive operation but I don't see any way to avoid it
18-
NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
18+
# NB: This only looks for '+' status (wrong commit checked out), not '-' status
19+
# (nothing checked out at all). `./configure --{llvm,jemalloc,libuv}-root`
20+
# will explicitly deinitialize the corresponding submodules, and we don't
21+
# want to force constant rebuilds in that case.
22+
NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^+')
1923
else
2024
NEED_GIT_RECONFIG=0
2125
endif

0 commit comments

Comments
 (0)