Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parallelism on Windows. #6137

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion hphp/hack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ if (OCAMLC_FOUND)

# Allows '#include "hphp/path/to/library/"' paths to start from hphp
# project directory which is consistent with fbmake's include paths.
list(APPEND extra_include_paths ${HPHP_HOME})

IF(HPHP_HOME)
list(APPEND extra_include_paths ${HPHP_HOME})
ELSE()
list(APPEND extra_include_paths ${CMAKE_CURRENT_SOURCE_DIR}/../..)
ENDIF()

foreach(lib ${LIBELF_INCLUDE_DIRS})
list(APPEND extra_include_paths ${lib})
Expand All @@ -32,6 +37,7 @@ if (OCAMLC_FOUND)
list(APPEND extra_cc_flags -DHAVE_DECL___NR_MEMFD_CREATE)
endif()

list(APPEND extra_cc_flags -Iutils)
list(APPEND extra_cc_flags -DOSS_SMALL_HH_TABLE_POWS)
list(APPEND extra_cc_flags -pthread)

Expand Down
1 change: 1 addition & 0 deletions hphp/hack/README.win32
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ NOTE: lz4 is not required to build Hack. If you want to use it, and lz4 is not
`ccopt` variable correctly in the `00_config.ocp` file. For instance:

ccopt = [ "-I/PATH/TO/LZ4/DIRECTORY" ]
cclib = [ "-L/PATH/TO/LZ4/DIRECTORY" ]

Then, execute the `make.bat` script:

Expand Down
1 change: 1 addition & 0 deletions hphp/hack/build.ocp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ begin library "hh-server-base"
"src/server/serverCommand.ml"
"src/server/serverConvert.ml"
"src/server/serverStamp.ml"
"src/server/serverWorker.ml"
]
end

Expand Down
Empty file modified hphp/hack/configure
100644 → 100755
Empty file.
8 changes: 6 additions & 2 deletions hphp/hack/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Variables to override #
################################################################################

EXTRA_INCLUDE_PATHS=
EXTRA_INCLUDE_PATHS=utils
EXTRA_LIB_PATHS=
EXTRA_CC_FLAGS=

Expand Down Expand Up @@ -65,6 +65,9 @@ MODULES=\
$(FSNOTIFY)\
$(INOTIFY)

LOCAL_HEADER_FILES=\
utils/handle.h

NATIVE_OBJECT_FILES=\
heap/hh_shared.o\
hhi/hhi_elf.o\
Expand All @@ -89,6 +92,7 @@ OCAML_LIBRARIES=\

NATIVE_LIBRARIES=\
pthread\
rt\
$(ELF)

TARGETS=_build/hh_server.native _build/hh_client.native \
Expand Down Expand Up @@ -154,7 +158,7 @@ $(TARGETS): $(ALL_SRC_FILES)
touch $(TARGETS)

build-hack-native-deps: build-hack-stubs
ocamlbuild -cflags "-g $(EXTRA_INCLUDE_OPTS) $(EXTRA_CC_OPTS)" $(NATIVE_OBJECT_FILES)
ocamlbuild -cflags "-g $(EXTRA_INCLUDE_OPTS) $(EXTRA_CC_OPTS)" $(LOCAL_HEADER_FILES) $(NATIVE_OBJECT_FILES)

# If you modify this rule, do not forget to edit the file
# `$(ROOT)/scripts/gen_build_id.ml` used on Windows.
Expand Down
4 changes: 3 additions & 1 deletion hphp/hack/src/build.ocp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ if have_lz4 then {
ccopt += [ "-DNO_LZ4" ]
}

ccopt += [ "-Isrc/utils" ]

requires = [ "unix" "str" "threads" ]

begin library "hh-third-party"
Expand Down Expand Up @@ -180,7 +182,7 @@ begin library "hh-find"
end

begin library "hh-heap"
requires += [ "hh-third-party" "hh-utils" "hh-stubs" ]
requires += [ "hh-third-party" "hh-utils" "hh-stubs" "hh-globals" ]

files = [
"heap/prefix.ml"
Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/format/format_diff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ end = struct
let filename = String.sub line 4 (String.length line - 4) in
(* Getting rid of the prefix b/ *)
let filename =
if filename = "/dev/null"
if filename = Path.(to_string null_path)
then None
else if String.length filename >= 2 && String.sub filename 0 2 = "b/"
then Some (String.sub filename 2 (String.length filename - 2))
Expand Down
4 changes: 4 additions & 0 deletions hphp/hack/src/globals/globalConfig.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ let tmp_dir =
with _ ->
Path.to_string @@
Path.concat Path.temp_dir_name "hh_server"

let shm_dir =
try Sys.getenv "HH_SHMDIR"
with _ -> "/dev/shm"
2 changes: 1 addition & 1 deletion hphp/hack/src/h2tp/h2tp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let parse_options () =
let _ =
let (src, dest, options) = parse_options () in
try
SharedMem.(init default_config);
let _handle = SharedMem.init_default () in
Opts.set options;
Engine.go (Sys.chop_dirsymbol src) (Sys.chop_dirsymbol dest);
print_string "The Conversion was successful\n"
Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/h2tp/test/test_unparser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ let try_dump_unparsed ast =
let _ =
try
let (src, dest) = parse_options () in
SharedMem.(init default_config);
let _handle = SharedMem.init_default () in
let {Parser_hack.ast; _} =
Parser_hack.parse_or_die Relative_path.(create Dummy src) in
if !debug then try_dump_unparsed ast;
Expand Down
Loading