Revert "Rename _build to _jbuild (#13)"

This reverts commit 89c15ca2c5.

Keep _build as the build directory until we get a better consensus.
This commit is contained in:
Jeremie Dimino 2017-03-01 16:09:02 +00:00
parent c16fac59ed
commit 3aef1d6f3c
13 changed files with 21 additions and 22 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
_jbuild _build
*.install *.install
boot.exe boot.exe
.merlin .merlin

View File

@ -1,6 +1,6 @@
* 1.0 * 1.0
- Generate a log in =_jbuild/log= - Generate a log in =_build/log=
- Improve the output of jbuilder, in particular don't mangle the - Improve the output of jbuilder, in particular don't mangle the
output of commands when using =-j N= with =N > 1= output of commands when using =-j N= with =N > 1=

View File

@ -1,5 +1,5 @@
INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)
BIN := ./_jbuild/default/bin/main.exe BIN := ./_build/default/bin/main.exe
default: boot.exe default: boot.exe
./boot.exe -j 4 --dev ./boot.exe -j 4 --dev
@ -19,6 +19,6 @@ all-supported-ocaml-versions:
$(BIN) build @install --workspace jbuild-workspace.dev --root . $(BIN) build @install --workspace jbuild-workspace.dev --root .
clean: clean:
rm -rf _jbuild rm -rf _build
.PHONY: default install uninstall reinstall clean .PHONY: default install uninstall reinstall clean

View File

@ -72,7 +72,7 @@ format and the third one describes how to use the =jbuilder= command.
takes for granted and doesn't know how to build takes for granted and doesn't know how to build
- *build context*: a build context is a subdirectory of the - *build context*: a build context is a subdirectory of the
=<root>/_jbuild= directory. It contains all the build artifacts of =<root>/_build= directory. It contains all the build artifacts of
the workspace built against a specific configuration. Without the workspace built against a specific configuration. Without
specific configuration from the user, there is always a =default= specific configuration from the user, there is always a =default=
build context, which correspond to the environment in which Jbuilder build context, which correspond to the environment in which Jbuilder
@ -80,7 +80,7 @@ format and the third one describes how to use the =jbuilder= command.
[[jbuild-workspace]] file [[jbuild-workspace]] file
- *build context root*: the root of a build context named =foo= is - *build context root*: the root of a build context named =foo= is
=<root>/_jbuild/<foo>= =<root>/_build/<foo>=
- *alias*: an alias is a build target that doesn't produce any file - *alias*: an alias is a build target that doesn't produce any file
and has configurable dependencies. Alias are per-directory and some and has configurable dependencies. Alias are per-directory and some

View File

@ -21,7 +21,7 @@ And build it with:
jbuilder hello_world.exe jbuilder hello_world.exe
#+end_src #+end_src
The executable will be built as =_jbuild/default/hello_world.exe= The executable will be built as =_build/default/hello_world.exe=
* Building a hello world program using Lwt * Building a hello world program using Lwt
@ -45,7 +45,7 @@ And build it with:
jbuilder hello_world.exe jbuilder hello_world.exe
#+end_src #+end_src
The executable will be built as =_jbuild/default/hello_world.exe= The executable will be built as =_build/default/hello_world.exe=
* Defining a library using Lwt and ocaml-re * Defining a library using Lwt and ocaml-re

View File

@ -15,7 +15,7 @@ type t =
; file : Path.t ; file : Path.t
} }
let aliases_path = Path.(relative root) "_jbuild/.aliases" let aliases_path = Path.(relative root) "_build/.aliases"
let of_path path = let of_path path =
if not (Path.is_local path) then if not (Path.is_local path) then
@ -78,7 +78,7 @@ let rules store ~prefixes ~tree =
List.iter prefixes ~f:(fun prefix -> List.iter prefixes ~f:(fun prefix ->
setup_rec_aliases store ~prefix ~tree); setup_rec_aliases store ~prefix ~tree);
(* For each alias @_jbuild/blah/../x, add a dependency: @../x --> @_jbuild/blah/../x *) (* For each alias @_build/blah/../x, add a dependency: @../x --> @_build/blah/../x *)
Hashtbl.fold store ~init:[] ~f:(fun ~key:_ ~data:{ Store. alias; _ } acc -> Hashtbl.fold store ~init:[] ~f:(fun ~key:_ ~data:{ Store. alias; _ } acc ->
match Path.extract_build_context (Name.path alias.name) with match Path.extract_build_context (Name.path alias.name) with
| None -> acc | None -> acc

View File

@ -1,7 +1,7 @@
open! Import open! Import
let local_install_dir = let local_install_dir =
let dir = Path.(relative root) "_jbuild/install" in let dir = Path.(relative root) "_build/install" in
fun ~context -> Path.relative dir context fun ~context -> Path.relative dir context
let local_install_bin_dir ~context = let local_install_bin_dir ~context =

View File

@ -134,7 +134,7 @@ let create ~(kind : Kind.t) ~path ~env ~name ~merlin =
| Some fn -> fn | Some fn -> fn
in in
let build_dir = let build_dir =
Path.of_string (sprintf "_jbuild/%s" name) Path.of_string (sprintf "_build/%s" name)
in in
let ocamlc_config_cmd = sprintf "%s -config" (Path.to_string ocamlc) in let ocamlc_config_cmd = sprintf "%s -config" (Path.to_string ocamlc) in
both both

View File

@ -8,10 +8,10 @@
- opam switch contexts, where one opam switch correspond to one context - opam switch contexts, where one opam switch correspond to one context
each context is built into a sub-directory of "_jbuild": each context is built into a sub-directory of "_build":
- _jbuild/default for the default context - _build/default for the default context
- _jbuild/<switch> for other contexts - _build/<switch> for other contexts
jbuild is able to build simultaneously against several contexts. In particular this jbuild is able to build simultaneously against several contexts. In particular this
allow for simple cross-compilation: when an executable running on the host is needed, allow for simple cross-compilation: when an executable running on the host is needed,
@ -41,7 +41,7 @@ type t =
building tools used for the compilation that run on the host. *) building tools used for the compilation that run on the host. *)
for_host : t option for_host : t option
; (** Directory where artifact are stored, for instance "_jbuild/default" *) ; (** Directory where artifact are stored, for instance "_build/default" *)
build_dir : Path.t build_dir : Path.t
; (** [PATH] *) ; (** [PATH] *)

View File

@ -27,7 +27,6 @@ let root t = t.root
let ignore_file = function let ignore_file = function
| "" | ""
| "_build" | "_build"
| "_jbuild"
| ".git" | ".git"
| ".hg" | ".hg"
| "_darcs" | "_darcs"

View File

@ -14,7 +14,7 @@ module Jbuilds = struct
type t = one list type t = one list
let generated_jbuilds_dir = Path.(relative root) "_jbuild/.jbuilds" let generated_jbuilds_dir = Path.(relative root) "_build/.jbuilds"
let ensure_parent_dir_exists path = let ensure_parent_dir_exists path =
match Path.kind path with match Path.kind path with

View File

@ -112,9 +112,9 @@ let report_error ?map_fname ppf exn =
report_error ?map_fname ppf exn ~backtrace report_error ?map_fname ppf exn ~backtrace
let create_log () = let create_log () =
if not (Sys.file_exists "_jbuild") then if not (Sys.file_exists "_build") then
Unix.mkdir "_jbuild" 0o777; Unix.mkdir "_build" 0o777;
let oc = open_out_bin "_jbuild/log" in let oc = open_out_bin "_build/log" in
Printf.fprintf oc "# %s\n%!" Printf.fprintf oc "# %s\n%!"
(String.concat (List.map (Array.to_list Sys.argv) ~f:quote_for_shell) ~sep:" "); (String.concat (List.map (Array.to_list Sys.argv) ~f:quote_for_shell) ~sep:" ");
oc oc

View File

@ -234,7 +234,7 @@ let parent t =
else else
Filename.dirname t Filename.dirname t
let build_prefix = "_jbuild/" let build_prefix = "_build/"
let is_in_build_dir t = let is_in_build_dir t =
String.is_prefix t ~prefix:build_prefix String.is_prefix t ~prefix:build_prefix