Skip to content

Commit 42d2dbf

Browse files
mrochMarshall Roch
authored andcommitted
fix flow-parser-bin's make dist on OS X
Summary: OS X's `cp` doesn't support the `-u` flag, so do it in bash manually. also realized that `make download` redownloads the release tarballs every time, which updates their mtimes, which causes everything downstream to be redone. since the release tarballs are immutable, we don't need to redownload them if they exist. this will also allow Circle to use its local copies, rather than uploading them to github in one step and then downloading them from github in the next. Reviewed By: gabelevi Differential Revision: D7518852 fbshipit-source-id: c8d94d2a3e73aa4d770a39460e2ab8b561d3f7da
1 parent 5d7a069 commit 42d2dbf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/flow-parser-bin/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ clean:
4343
# `make download` hasn't been run.
4444
$(addsuffix .dl,$(RELEASE_ZIPS)):
4545
@mkdir -p "$(@D)"
46-
curl --max-time 300 \
46+
[ -e "$(subst .dl,,$@)" ] || curl --max-time 300 \
4747
-L "$(patsubst dist/release/%.zip.dl,$(HOST)/%-v$(FLOW_VERSION).zip,$@)" \
4848
-o "$(subst .dl,,$@)" || rm "$(subst .dl,,$@)"
4949

@@ -53,7 +53,8 @@ $(addsuffix .dl,$(RELEASE_ZIPS)):
5353
dist/local/libflowparser-$(PLATFORM).zip:
5454
@mkdir -p "$(@D)"
5555
$(MAKE) -C ../../src/parser dist/libflowparser.zip
56-
cp -u ../../src/parser/dist/libflowparser.zip "$@"
56+
[ ! -e "$@" -o "../../src/parser/dist/libflowparser.zip" -nt "$@" ] && \
57+
cp ../../src/parser/dist/libflowparser.zip "$@"
5758

5859
# The following two "pattern" rules (because of the %) choose between using
5960
# the downloaded release builds or building from source, depending on whether
@@ -64,10 +65,10 @@ dist/local/libflowparser-$(PLATFORM).zip:
6465
# kicks off the local build.
6566
dist/libflowparser-%.zip: dist/release/libflowparser-%.zip
6667
@mkdir -p "$(@D)"
67-
cp -u "$<" "$@"
68+
cp "$<" "$@"
6869
dist/libflowparser-%.zip: dist/local/libflowparser-%.zip
6970
@mkdir -p "$(@D)"
70-
cp -u "$<" "$@"
71+
cp "$<" "$@"
7172

7273
$(LIBS): lib/%/libflowparser.a: dist/libflowparser-%.zip
7374
DIR="$(basename $<)"; \

0 commit comments

Comments
 (0)