Skip to content

Commit

Permalink
[build] Use plain dune files instead of make-generated JBuilder/OCaml…
Browse files Browse the repository at this point in the history
… ones

Summary:
With the introduction of environments and profiles we no longer need
to generate most dune files in libraries via make. Also, those dune
builds don't need to be in OCaml.

In addition to converting build files to plain sexp definitions, this
patch also:
- Adjusts copyrightCheck to work correctly with sexp-based dune files.
- Adds auto-formatting for sexp-based dune files.

Reviewed By: jvillard

Differential Revision: D20250208

fbshipit-source-id: 495aeaa99
  • Loading branch information
artempyanykh authored and facebook-github-bot committed Mar 11, 2020
1 parent fc5b092 commit 9fc048b
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 112 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@ infer/src/.project
/infer/src/_build
/infer/src/dune.common
/infer/src/dune
/infer/src/atd/dune
/infer/src/base/dune
/infer/src/IR/dune
/infer/src/istd/dune
/infer/src/scripts/dune
/infer/src/dune-workspace
.merlin

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ fb-setup:
fmt:
parallel $(OCAMLFORMAT_EXE) -i ::: $$(git diff --name-only --diff-filter=ACMRU $$(git merge-base origin/master HEAD) | grep "\.mli\?$$")

DUNE_ML:=$(shell find * -name 'dune*.in' | grep -v workspace)
DUNE_ML:=$(shell find * -name 'dune*.in' | grep -v workspace | grep -v infer-source)

.PHONY: fmt_dune
fmt_dune:
Expand Down
18 changes: 18 additions & 0 deletions infer/src/IR/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.

(library
(name InferIR)
(public_name InferIR)
(flags
(:standard -open Core -open InferStdlib -open IStd -open InferGenerated
-open InferBase))
(libraries core zarith InferStdlib InferGenerated InferBase)
(preprocess
(pps ppx_compare)))

(documentation
(package InferIR)
(mld_files index))
27 changes: 0 additions & 27 deletions infer/src/IR/dune.in

This file was deleted.

7 changes: 1 addition & 6 deletions infer/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ all: infer

GENERATED_FROM_AUTOCONF = dune.common dune-workspace base/Version.ml

GENERATED_DUNES += dune atd/dune base/dune IR/dune istd/dune scripts/dune
GENERATED_DUNES += dune

SRC_BUILD_COMMON = $(GENERATED_FROM_AUTOCONF) $(GENERATED_DUNES) $(OCAML_SOURCES)
ifeq ($(BUILD_C_ANALYZERS),yes)
Expand Down Expand Up @@ -307,12 +307,7 @@ $(GENERATED_DUNES): dune.common
$(QUIET)cat $+ > $@

dune: dune.in
atd/dune: atd/dune.in
base/dune: base/dune.in
deadcode/dune: deadcode/dune.in
IR/dune: IR/dune.in
istd/dune: istd/dune.in
scripts/dune: scripts/dune.in

.PHONY: clean
clean:
Expand Down
17 changes: 17 additions & 0 deletions infer/src/atd/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.

(library
(name InferGenerated)
(public_name InferGenerated)
(flags
(:standard -w -27-32-34-35-39))
(libraries atdgen core)
(preprocess
(pps ppx_compare)))

(documentation
(package InferGenerated)
(mld_files index))
26 changes: 0 additions & 26 deletions infer/src/atd/dune.in

This file was deleted.

18 changes: 18 additions & 0 deletions infer/src/base/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.

(library
(name InferBase)
(public_name InferBase)
(flags
(:standard -open Core -open InferStdlib -open IStd -open InferGenerated))
(libraries cmdliner core mtime.clock.os parmap re sqlite3 zip InferGenerated
InferStdlib)
(preprocess
(pps ppx_compare ppx_enumerate)))

(documentation
(package InferBase)
(mld_files index))
5 changes: 5 additions & 0 deletions infer/src/dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
(lang dune 2.0)
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.

(using menhir 1.0)
17 changes: 17 additions & 0 deletions infer/src/istd/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.

(library
(name InferStdlib)
(public_name InferStdlib)
(flags
(:standard -open Core))
(libraries ANSITerminal core str yojson)
(preprocess
(pps ppx_compare)))

(documentation
(package InferStdlib)
(mld_files index))
27 changes: 0 additions & 27 deletions infer/src/istd/dune.in

This file was deleted.

12 changes: 12 additions & 0 deletions infer/src/scripts/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.

(executable
(name checkCopyright)
(modes byte exe)
(flags (:standard))
(libraries core str)
(preprocess
(pps ppx_compare)))
20 changes: 0 additions & 20 deletions infer/src/scripts/dune.in

This file was deleted.

0 comments on commit 9fc048b

Please sign in to comment.