From 461f88756df679cc8e35f92a502cfa678066844f Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 23 Mar 2020 06:19:08 -0700 Subject: [PATCH] [sledge] Name the sledge library `sledge` Summary: If both the library and binary are named `sledge`, then compilation works fine and resolves the names correctly, but merlin gets confused and cannot find the sledge library modules used in the bin sources. So the binary and library need different names. The name of the library gets exposed to clients, while the name of the binary only determines the name of some files in the _build directory, which can be renamed as desired. Therefore, use the `sledge` name for the library module, and rename the binary module to `sledge_cli`, but still have dune install it as `sledge.exe`. Reviewed By: jvillard Differential Revision: D20589431 fbshipit-source-id: 14b65907d --- sledge/Makefile | 4 ++-- sledge/bin/dune | 5 +++-- sledge/bin/{sledge.ml => sledge_cli.ml} | 0 sledge/bin/{sledge.mli => sledge_cli.mli} | 0 sledge/dune | 3 ++- sledge/lib/dune | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) rename sledge/bin/{sledge.ml => sledge_cli.ml} (100%) rename sledge/bin/{sledge.mli => sledge_cli.mli} (100%) diff --git a/sledge/Makefile b/sledge/Makefile index a53b0a994..b755cbe5a 100644 --- a/sledge/Makefile +++ b/sledge/Makefile @@ -6,7 +6,7 @@ .PHONY: default default: exes -EXES = bin/sledge +EXES = bin/sledge_cli INSTALLS = sledge DBG_TARGETS = $(patsubst %,_build/dbg/%.exe,$(EXES)) $(patsubst %,_build/dbg/%.install,$(INSTALLS)) @@ -67,7 +67,7 @@ clean: .PHONY: fmt fmt: - dune build @_build/dbg/fmt --auto-promote 2>/dev/null + -dune build @_build/dbg/fmt --auto-promote 2>/dev/null clang-format -i model/llair_intrinsics.h model/cxxabi.cpp ${MAKE} -C test fmt diff --git a/sledge/bin/dune b/sledge/bin/dune index 993508f6d..8b74c6dea 100644 --- a/sledge/bin/dune +++ b/sledge/bin/dune @@ -4,12 +4,13 @@ ; LICENSE file in the root directory of this source tree. (executable + (name sledge_cli) (public_name sledge) (package sledge) (libraries apron apron.boxMPQ ctypes ctypes.foreign dune-build-info llvm llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo - llvm.linker shexp.process yojson trace import sledgelib model) + llvm.linker shexp.process yojson trace import sledge model) (flags - (:standard -open Import -open Sledgelib -open Model)) + (:standard -open Import -open Sledge -open Model)) (preprocess (pps ppx_sledge))) diff --git a/sledge/bin/sledge.ml b/sledge/bin/sledge_cli.ml similarity index 100% rename from sledge/bin/sledge.ml rename to sledge/bin/sledge_cli.ml diff --git a/sledge/bin/sledge.mli b/sledge/bin/sledge_cli.mli similarity index 100% rename from sledge/bin/sledge.mli rename to sledge/bin/sledge_cli.mli diff --git a/sledge/dune b/sledge/dune index 7a22ea385..868c7cc4a 100644 --- a/sledge/dune +++ b/sledge/dune @@ -30,7 +30,8 @@ (rule (targets sledge-help.txt) - (deps bin/sledge.ml bin/sledge_buck.ml tools/gen_help.sh bin/sledge.exe) + (deps bin/sledge_cli.ml bin/sledge_buck.ml tools/gen_help.sh + bin/sledge_cli.exe) (action (with-stdout-to sledge-help.txt diff --git a/sledge/lib/dune b/sledge/lib/dune index 2f5ef1952..9723fbd88 100644 --- a/sledge/lib/dune +++ b/sledge/lib/dune @@ -4,7 +4,7 @@ ; LICENSE file in the root directory of this source tree. (library - (name sledgelib) + (name sledge) (public_name sledge) (libraries trace import) (flags