You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Namely, switched in many places to using GNU make provided functions
for directory listing and text processing, rather than spawning a
shell process to do that work.
In the process of the revision, learned about Target-specific
variables, which were very applicable to INSTALL_LIB (which, on a
per-recipe basis, was always receiving the same actual arguments for
its first two formal parameters in every invocation).
http://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html
(We might be able to make use of those in future refactorings.)
----
Also adds a cleanup pass to get-snapshot.py as well, since the same
problem arises when we unpack libraries from the snapshot archive into
a build directory with a prior snapshot's artifacts. (I put this step
into the python script rather than the makefile because I wanted to
delay the cleanup pass until after we have at least successfully
downloaded the tarball. That way, if the download fails, you should
not destroy the previous unarchived snapshot libraries and build
products.)
----
Also reverted whitespace changes to minimize diff.
I plan to put them back in in a dedicated commit elsewhere.
Copy file name to clipboardExpand all lines: Makefile.in
+12-6
Original file line number
Diff line number
Diff line change
@@ -239,19 +239,25 @@ endef
239
239
# $(2) is the glob to use in the match
240
240
# $(3) is filename (usually the target being created) to filter out from match
241
241
# (i.e. filename is not out-of-date artifact from prior Rust version/build)
242
-
# The glob denoted by $(2) often is constructed with a space character prefix,
243
-
# which is why we cannot just do `ls` on $(1)/$(2).
242
+
#
243
+
# Note that a common bug is to accidentally construct the glob denoted
244
+
# by $(2) with a space character prefix, which invalidates the
245
+
# construction $(1)$(2).
244
246
defineCHECK_FOR_OLD_GLOB_MATCHES_EXCEPT
245
-
$(Q)( cd $(1) && ( ls $(2) 2>/dev/null || true ) | grep -v $(3) > /dev/null && echo "Warning: there are previous" '$(2)' "libraries:" || true )
246
-
$(Q)( cd $(1) && ( ls $(2) 2>/dev/null || true ) | grep -v $(3) || true )
247
+
$(Q)MATCHES="$(filter-out%$(3),$(wildcard$(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: there are previous" \'$(2)\' "libraries:" $$MATCHES; fi
247
248
endef
248
249
249
250
# Same interface as above, but deletes rather than just listing the files.
0 commit comments