Skip to content

Commit 2f1a67f

Browse files
committed
Use separate build directories for Rust libraries in dune
Currently these all use default/target, which seems to cause difficult-to-debug race conditions in OSS CI. Strangely, (locks /cargo) is supposed to prevent this given that locks with an absolute path is documented by dune to be a global lock, but it doesn't seem to work as intended.
1 parent 55c6e39 commit 2f1a67f

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

hphp/hack/Makefile.dune

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,13 @@ clean:
3232
define build_hack
3333
$(eval ext := $(if $(filter $(2),-debug),".bc",""))
3434
build-hack$(2):
35-
rm -rf "$(DUNE_BUILD_DIR)/default/target/release"
36-
dune build src/hh_server.$(1)
37-
rm -rf "$(DUNE_BUILD_DIR)/default/target/release"
38-
dune build src/hh_client.$(1)
39-
rm -rf "$(DUNE_BUILD_DIR)/default/target/release"
40-
dune build src/hh_single_type_check.$(1)
41-
rm -rf "$(DUNE_BUILD_DIR)/default/target/release"
42-
dune build src/hackfmt.$(1)
43-
rm -rf "$(DUNE_BUILD_DIR)/default/target/release"
44-
dune build src/hh_parse.$(1)
45-
rm -rf "$(DUNE_BUILD_DIR)/default/target/release"
46-
dune build src/generate_full_fidelity.$(1)
35+
dune build \
36+
src/hh_server.$(1) \
37+
src/hh_client.$(1) \
38+
src/hh_single_type_check.$(1) \
39+
src/hackfmt.$(1) \
40+
src/hh_parse.$(1) \
41+
src/generate_full_fidelity.$(1)
4742

4843
copy-hack$(2)-files: build-hack$(2)
4944
mkdir -p "$(HACK_BIN_DIR)"

hphp/hack/scripts/invoke_cargo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if [ -z "${HACK_NO_CARGO_VENDOR}" ]; then
4040
fi
4141

4242
if [ -z "${TARGET_DIR}" ]; then
43-
TARGET_DIR="${HACK_BUILD_ROOT}/target"
43+
TARGET_DIR="${HACK_BUILD_ROOT}/target/$pkg"
4444
fi
4545

4646
if [ -z ${HACKDEBUG+1} ]; then

0 commit comments

Comments
 (0)