forked from facebook/hhvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition between hack and hack_ffi targets
Summary: We use `hphp/hack/dev_env.sh` to set up various environment variables for OCaml and Rust compilation; this ends with `eval $(opam env)`. It turns out that if you try to run `opam env` while another instance of `opam` is running, the output is: ``` Another process has locked /Users/fredemmott/code/hhvm/build/hphp/hack/opam/hack-switch/.opam-switch/lock, waiting (C-c to abort)... lock acquired. OPAM_SWITCH_PREFIX=...... normal output here ``` ... which can't be evaled. This happens when doing a parallel build as both the `hack` (typechecker) and `hack_ffi` (rust stuff, both for the typechecker and hackc embedded in HHVM) targets use dev_env.sh Fix this by splitting out a `dev_env_common.sh.in` and a `dev_env_rust_only.sh.in`, and making the `hack_ffi` target use the `dev_env_rust_only.sh` CMake generates the `.sh` from the `.sh.in` Reviewed By: kavoor Differential Revision: D30583055 fbshipit-source-id: 0770bfc6528db15dd455398567f3d31beaed37c3
- Loading branch information
1 parent
0377505
commit 6e60915
Showing
4 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# Copyright (c) 2019, Facebook, Inc. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the "hack" directory of this source tree. | ||
|
||
# Do not use this file directly - either use dev_env.sh or dev_env_rust_only.sh | ||
|
||
export CMAKE_SOURCE_DIR="@CMAKE_SOURCE_DIR@" | ||
export CMAKE_INSTALL_FULL_SYSCONFDIR="@CMAKE_INSTALL_FULL_SYSCONFDIR@" | ||
export CMAKE_INSTALL_FULL_BINDIR="@CMAKE_INSTALL_FULL_BINDIR@" | ||
|
||
export HACK_NO_CARGO_VENDOR=true | ||
export OPAMROOT="@OPAMROOT@" | ||
export PYTHONPATH="@HPHP_HOME@" # needed for verify.py for `hack_dune_test` | ||
export CARGO_HOME="@CMAKE_CURRENT_BINARY_DIR@/cargo_home" | ||
export RUSTC="@RUSTC_BIN_DIR@/rustc" | ||
export DUNE_BUILD_DIR="@DUNE_BUILD_DIR@" | ||
export HACK_SOURCE_ROOT="@CMAKE_CURRENT_SOURCE_DIR@" | ||
export HACK_BUILD_ROOT="@HACK_BUILD_ROOT@" | ||
export HACK_BIN_DIR="@CMAKE_BINARY_DIR@/hphp/hack/bin" | ||
export PATH="@RUSTC_BIN_DIR@:@CARGO_BIN_DIR@:$(dirname "@OPAM_EXECUTABLE@"):$PATH" | ||
|
||
export HACK_EXTRA_INCLUDE_PATHS="@extra_include_paths@" | ||
export HACK_EXTRA_LINK_OPTS="@extra_link_opts@" | ||
export HACK_EXTRA_LIB_PATHS="@extra_lib_paths@" | ||
export HACK_EXTRA_NATIVE_LIBRARIES="@extra_native_libraries@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) 2019, Facebook, Inc. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the "hack" directory of this source tree. | ||
|
||
# This file is processed by cmake; the produced file is intended for both | ||
# internal usage by the build system, and for direct usage by people working on | ||
# Hack itself from CMake builds: | ||
# | ||
# . $BUILD_DIR/hphp/hack/dev_env_rust_only.sh | ||
|
||
. "@CMAKE_CURRENT_BINARY_DIR@/dev_env_common.sh" | ||
# Nothing else to do for rust :) |