From 97fdc994188379a6b7df21c9074eaeaba15c1925 Mon Sep 17 00:00:00 2001 From: Vassil Mladenov Date: Tue, 8 May 2018 11:57:39 -0700 Subject: [PATCH] Add core_kernel dependency, fix missing variable, remove OCAML_LIBRARIES in favor of ocamlfind and _tags Summary: Closes https://github.com/facebook/hhvm/pull/8183 Reviewed By: gregory-nisbet Differential Revision: D7905428 Pulled By: vassilmladenov fbshipit-source-id: 53175216f57b3df343d938592f4623e2236e3f51 --- hphp/hack/CMakeLists.txt | 4 ++-- hphp/hack/opam_setup.sh | 2 +- hphp/hack/src/Makefile | 8 +------- hphp/hack/src/_tags | 3 ++- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/hphp/hack/CMakeLists.txt b/hphp/hack/CMakeLists.txt index ffcf5220a8f..04544d47b2b 100644 --- a/hphp/hack/CMakeLists.txt +++ b/hphp/hack/CMakeLists.txt @@ -112,7 +112,7 @@ add_custom_target( export OPAMROOT=${CMAKE_CURRENT_SOURCE_DIR}/src/_build/.opam && export OCAMLFIND_COMMANDS="-ocamlc=${OCAMLC_EXECUTABLE} -ocamlopt=${OCAMLOPT_EXECUTABLE}" && PATH=${TP_BUILD_DIR}/ocaml/build/bin:$(PATH) - ${OPAM_EXECUTABLE} config exec -- + opam config exec -- $(MAKE) EXTRA_INCLUDE_PATHS="${extra_include_paths}" EXTRA_LIB_PATHS="${extra_lib_paths}" EXTRA_LINK_OPTS="${extra_link_opts}" @@ -132,7 +132,7 @@ add_custom_target( export OPAMROOT=${CMAKE_CURRENT_SOURCE_DIR}/src/_build/.opam && export OCAMLFIND_COMMANDS="-ocamlc=${OCAMLC_EXECUTABLE} -ocamlopt=${OCAMLOPT_EXECUTABLE}" && PATH=${TP_BUILD_DIR}/ocaml/build/bin:$(PATH) - ${OPAM_EXECUTABLE} config exec -- + opam config exec -- $(MAKE) test EXTRA_INCLUDE_PATHS="${extra_include_paths}" EXTRA_LIB_PATHS="${extra_lib_paths}" EXTRA_LINK_OPTS="${extra_link_opts}" diff --git a/hphp/hack/opam_setup.sh b/hphp/hack/opam_setup.sh index 6f81820ab0b..6492f512e8f 100755 --- a/hphp/hack/opam_setup.sh +++ b/hphp/hack/opam_setup.sh @@ -19,4 +19,4 @@ else fi eval "$(opam config env)" -opam install ppx_deriving.4.2 visitors.20170828 +opam install ppx_deriving.4.2 visitors.20170828 core.v0.9.1 diff --git a/hphp/hack/src/Makefile b/hphp/hack/src/Makefile index 089d7f83ec6..d215b639294 100644 --- a/hphp/hack/src/Makefile +++ b/hphp/hack/src/Makefile @@ -115,11 +115,6 @@ NATIVE_C_FILES=\ utils/parent/stubparentimpl.c\ $(INOTIFY)/$(notdir $(INOTIFY))_stubs.c -OCAML_LIBRARIES=\ - str\ - unix\ - bigarray - NATIVE_LIBRARIES=\ pthread\ $(RT) @@ -148,7 +143,6 @@ ALL_SRC_FILES=$(call rwildcard,$(patsubst _build,,$(wildcard *)),*.*) OBJECT_FILES_TO_BUILD=$(patsubst %.c,%.o,$(NATIVE_C_FILES)) NATIVE_OBJECT_FILES=$(OBJECT_FILES_TO_BUILD) utils/get_build_id.gen.o utils/get_build_id.o utils/compiler_id_impl.o INCLUDE_OPTS=$(foreach dir,$(MODULES),-I $(dir)) -LIB_OPTS=$(foreach lib,$(OCAML_LIBRARIES),-lib $(lib)) NATIVE_LIB_OPTS=$(foreach lib, $(NATIVE_LIBRARIES),-cclib -l$(lib)) EXTRA_NATIVE_LIB_OPTS=$(foreach lib, $(EXTRA_NATIVE_LIBRARIES),-cclib -l$(lib)) EXTRA_INCLUDE_OPTS=$(foreach dir, $(EXTRA_INCLUDE_PATHS),-ccopt -I$(dir)) @@ -210,7 +204,7 @@ _build/hack.stamp: $(ALL_SRC_FILES) copy-hhis _build/ppx/ppx_gen_hhi # - means it will never relink just for C changes # - doesn't really help that much as it needs to do the bulk of the work anyway rm -f $(TARGETS) - $(OCAMLBUILD) $(CC_DEFINES) -tag-line '<**/*.ml*>: package(ppx_deriving.std)' -use-ocamlfind -no-links -cflag -g $(INCLUDE_OPTS) $(LIB_OPTS) \ + $(OCAMLBUILD) $(CC_DEFINES) -tag-line '<**/*.ml*>: package(ppx_deriving.std)' -use-ocamlfind -no-links -cflag -g $(INCLUDE_OPTS) \ -lflags "-g $(LINKER_FLAGS)" -tag custom \ $(patsubst _build/%,%,$(TARGETS)) touch _build/hack.stamp diff --git a/hphp/hack/src/_tags b/hphp/hack/src/_tags index b4b75b47edd..88bd73fa48a 100644 --- a/hphp/hack/src/_tags +++ b/hphp/hack/src/_tags @@ -1,3 +1,4 @@ +true: package(unix),package(str),package(bigarray) <**/*.ml*>: ocaml, warn_A, warn(-3-4-6-29-35-44-48-50-52) <*.ml*>: warn(-27) : ppx(ppx/ppx_gen_hhi hhi) @@ -14,4 +15,4 @@ : warn(-27) : warn(-32-41) : warn(-27) -not <{dfind,find,globals,heap,injection,procs,search,socket,third-party,utils,fsevents,fsnotify_darwin,fsnotify_linux,fsnotify_win,stubs}/**/*>: package(ppx_deriving.std), package(visitors.ppx), package(visitors.runtime) +not <{dfind,find,globals,heap,injection,procs,search,socket,third-party,utils,fsevents,fsnotify_darwin,fsnotify_linux,fsnotify_win,stubs}/**/*>: package(core_kernel), package(ppx_deriving.std), package(visitors.ppx), package(visitors.runtime) -- 2.11.4.GIT