Skip to content
Merged
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
6 changes: 6 additions & 0 deletions jscomp/common/bs_exception.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type error =
| Bs_cyclic_depends of string list
| Bs_duplicated_module of string * string
| Bs_package_not_found of string
| Bs_main_not_exist of string

exception Error of error

let error err = raise (Error err)
Expand All @@ -44,6 +46,10 @@ let report_error ppf = function
| Bs_duplicated_module (a,b)
->
Format.fprintf ppf "The build system does not support two files with same names yet %s, %s" a b
| Bs_main_not_exist main
->
Format.fprintf ppf "File %s not found " main

| Bs_package_not_found package
->
Format.fprintf ppf "Pacage %s not found or %s/lib/ocaml does not exist"
Expand Down
2 changes: 2 additions & 0 deletions jscomp/common/bs_exception.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ type error =
| Bs_cyclic_depends of string list
| Bs_duplicated_module of string * string
| Bs_package_not_found of string
| Bs_main_not_exist of string

val error : error -> 'a
3 changes: 3 additions & 0 deletions jscomp/ocaml_batch_compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ let batch_compile ppf files main_file =
Ocaml_parse.lazy_parse_implementation
Ocaml_parse.lazy_parse_interface
main_file in
if Queue.is_empty result then
Bs_exception.error (Bs_main_not_exist main_file)
;
process_result ppf main_file ast_table result
else 0

Expand Down
2 changes: 1 addition & 1 deletion jscomp/runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ else
BS_FLAGS= $(BS_COMMON_FLAGS) -bs-package-output lib/js
endif

COMPFLAGS += $(BS_FLAGS) -I ../stdlib -nostdlib -nopervasives -open Pervasives -unsafe -w -40
COMPFLAGS += $(BS_FLAGS) -I ../stdlib -nostdlib -nopervasives -open Pervasives -unsafe -w -40-49



Expand Down