Skip to content

Commit

Permalink
Merge pull request #3449 from BuckleScript/fix_build
Browse files Browse the repository at this point in the history
fix build, prepare integration test with 4.06
  • Loading branch information
bobzhang committed Mar 27, 2019
2 parents c14bf79 + 3d2aa04 commit b8546ee
Show file tree
Hide file tree
Showing 91 changed files with 95,579 additions and 1,885 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ odoc_gen/*.cmxs
lib/prebuilt.ninja
lib/release.ninja
lib/build.ninja
lib/copy.ninja
jscomp/release.ninja
jscomp/build.ninja
jscomp/compiler.ninja
Expand Down Expand Up @@ -134,7 +135,6 @@ jscomp/ext/string_set.ml
jscomp/outcome_printer/tweaked_reason_oprint.ml
jscomp/outcome_printer/reason_syntax_util.ml
jscomp/outcome_printer/reason_syntax_util.mli
native/bin
native/lib
native/main
jscomp/bin/all_ounit_tests.ml
native/
vendor/ocaml
1 change: 0 additions & 1 deletion jscomp/bin/all_ounit_tests.mli

This file was deleted.

1 change: 0 additions & 1 deletion jscomp/bin/bspack.mli

This file was deleted.

2 changes: 1 addition & 1 deletion jscomp/core/config_whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(**************************************************************************)

(* The main OCaml version string has moved to ../VERSION *)
let version = "4.06.2+BS"
let version = "4.06.1+BS"
let standard_library =
Filename.concat (Filename.dirname Sys.executable_name) "ocaml"
let standard_library_default = standard_library
Expand Down
3 changes: 2 additions & 1 deletion jscomp/depends/ast_extract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type 'a kind = 'a Ml_binary.kind

let read_parse_and_extract (type t) (k : t kind) (ast : t) : String_set.t =
Depend.free_structure_names := String_set.empty;
Ext_ref.protect Clflags.transparent_modules false begin fun _ ->
List.iter
(fun modname ->
#if OCAML_VERSION =~ ">4.03.0" then
Expand All @@ -50,7 +51,7 @@ let read_parse_and_extract (type t) (k : t kind) (ast : t) : String_set.t =
| Ml_binary.Ml -> Depend.add_implementation bound_vars ast
| Ml_binary.Mli -> Depend.add_signature bound_vars ast );
!Depend.free_structure_names

end

type ('a,'b) ast_info =
| Ml of
Expand Down
3 changes: 0 additions & 3 deletions jscomp/envConfig.ninja

This file was deleted.

3 changes: 2 additions & 1 deletion jscomp/main/ounit_tests_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ let suites =
Ounit_utf8_test.suites;
Ounit_unicode_tests.suites;
Ounit_bsb_regex_tests.suites;
Ounit_bsb_pkg_tests.suites
Ounit_bsb_pkg_tests.suites;
Ounit_depends_format_test.suites;
]
let _ =
OUnit.run_test_tt_main suites
7 changes: 6 additions & 1 deletion jscomp/ounit_tests/ounit_cmd_util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ let bsc_bin = project_root // "lib"
let bsc_exe = bsc_bin // "bsc.exe"
let runtime_dir = jscomp // "runtime"
let others_dir = jscomp // "others"
let stdlib_dir = jscomp // "stdlib"

#if OCAML_VERSION =~ ">4.03.0" then
let stdlib_dir = jscomp // "stdlib-406"
#else
let stdlib_dir = jscomp // "stdlib-402"
#end

let rec safe_dup fd =
let new_fd = Unix.dup fd in
Expand Down
15 changes: 13 additions & 2 deletions jscomp/ounit_tests/ounit_depends_format_test.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
let ((>::),
(>:::)) = OUnit.((>::),(>:::))

let (=~) = OUnit.assert_equal
let (=~) (xs : string list) (ys : string list) =
OUnit.assert_equal xs ys
~printer:(fun xs -> String.concat "," xs )

let f (x : string) =
let stru = Parse.implementation (Lexing.from_string x) in
Ast_extract.String_set.elements (Ast_extract.read_parse_and_extract Ml_binary.Ml stru)


let suites =
__FILE__
>::: [

__LOC__ >:: begin fun _ ->
f {|module X = List|} =~ ["List"];
f {|module X = List module X0 = List1|} =~ ["List";"List1"]
end
]
20 changes: 11 additions & 9 deletions jscomp/snapshot.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OCAML_SRC_TOOLS=$NATIVE_OCAML_PATH/tools
includes = -I stubs -I ext -I common -I syntax -I depends -I core -I super_errors -I outcome_printer -I bsb -I ounit -I ounit_tests -I main
SNAP=../lib/$snapshot_path

build snapshot: phony $SNAP/whole_compiler.ml $SNAP/bsppx.ml $SNAP/bsdep.ml $SNAP/bsb_helper.ml $SNAP/bsb.ml $SNAP/bspp.ml bin/all_ounit_tests.ml
build snapshot: phony $SNAP/whole_compiler.ml $SNAP/bsppx.ml $SNAP/bsdep.ml $SNAP/bsb_helper.ml $SNAP/bsb.ml $SNAP/bspp.ml $SNAP/unstable/all_ounit_tests.ml

build $SNAP/whole_compiler.ml: bspack | ./bin/bspack.exe
flags = ${releaseMode} -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I $OCAML_SRC_TYPING -I $OCAML_SRC_BYTECOMP -I $OCAML_SRC_DRIVER ${includes}
Expand Down Expand Up @@ -45,24 +45,26 @@ build $SNAP/bspp.ml: bspack | ./bin/bspack.exe
flags = -D BS_MIN_LEX_DEPS=true ${releaseMode} -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING?parser -I common -I ext -I syntax -I depends -I bspp -I core -I main
main = Bspp_main

build ./bin/bsb_native.ml: bspack | ./bin/bspack.exe
build $SNAP/unstable/bsb_native.ml: bspack | ./bin/bspack.exe
flags = -D BS_MIN_LEX_DEPS=true -D BS_NATIVE=true -bs-MD ${releaseMode} -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I stubs -I common -I ext -I syntax -I depends -I bsb -I ext -I main
main = Bsb_main

build ./bin/native_ppx.ml: bspack | ./bin/bspack.exe
build $SNAP/unstable/native_ppx.ml: bspack | ./bin/bspack.exe
flags = -D BS_MIN_LEX_DEPS=true -D BS_NATIVE=true -bs-MD ${releaseMode} -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I stubs -I common -I ext -I syntax -I depends -I bsb -I ext -I main
main = Native_ppx_main

rule bsbnative
command = $ocamlopt -w -a unix.cmxa str.cmxa ./stubs/ext_basic_hash_stubs.c $in -o $out
# only check if it compiles
build ./bin/bsb_native.exe: bsbnative ./bin/bsb_native.ml

build bin/all_ounit_tests.ml: bspack | ./bin/bspack.exe
build $SNAP/unstable/all_ounit_tests.ml: bspack | ./bin/bspack.exe
flags = -bs-MD -I ounit -I ounit_tests -I stubs -I bsb -I common -I ext -I syntax -I depends -I bspp -I core -I main
main = Ounit_tests_main

build bin/bspack.ml: bspack | ./bin/bspack.exe
build $SNAP/unstable/bspack.ml: bspack | ./bin/bspack.exe
flags = -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_PARSING -I $OCAML_SRC_UTILS -I stubs -I ext -I common -I depends -I core -I main -bs-main Bspack_main
main = Bspack_main

# Check it later
# rule bsbnative
# command = $ocamlopt -w -a unix.cmxa str.cmxa ./stubs/ext_basic_hash_stubs.c $in -o $out
# only check if it compiles
# build $SNAP/unstable/bsb_native.exe: bsbnative ./bin/bsb_native.ml

4 changes: 0 additions & 4 deletions jscomp/vendorConfig.ninja

This file was deleted.

1 change: 0 additions & 1 deletion lib/4.02.3+BS/bsb.mli

This file was deleted.

1 change: 0 additions & 1 deletion lib/4.02.3+BS/bsb_helper.mli

This file was deleted.

1 change: 0 additions & 1 deletion lib/4.02.3+BS/bsdep.mli

This file was deleted.

1 change: 0 additions & 1 deletion lib/4.02.3+BS/bspp.mli

This file was deleted.

2 changes: 0 additions & 2 deletions lib/4.02.3+BS/bsppx.mli

This file was deleted.

1 change: 0 additions & 1 deletion lib/4.02.3+BS/whole_compiler.mli

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion lib/4.02.3+BS/bsb.ml.d → lib/4.02.3/bsb.ml.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
../lib/4.02.3+BS/bsb.ml:
../lib/4.02.3/bsb.ml:
./bsb/bsb_build_schemas.ml
./bsb/bsb_build_util.ml
./bsb/bsb_build_util.mli
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
../lib/4.02.3+BS/bsb_helper.ml:
../lib/4.02.3/bsb_helper.ml:
./bsb/bsb_db.ml
./bsb/bsb_db.mli
./bsb/bsb_db_io.ml
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/4.02.3+BS/bsdep.ml.d → lib/4.02.3/bsdep.ml.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
../lib/4.02.3+BS/bsdep.ml:
../lib/4.02.3/bsdep.ml:
../ocaml/driver/compenv.ml
../ocaml/driver/compenv.mli
../ocaml/driver/pparse.ml
Expand Down
Empty file added lib/4.02.3/bsdep.mli
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/4.02.3+BS/bspp.ml.d → lib/4.02.3/bspp.ml.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
../lib/4.02.3+BS/bspp.ml:
../lib/4.02.3/bspp.ml:
../ocaml/parsing/lexer.ml
../ocaml/parsing/lexer.mli
../ocaml/parsing/location.ml
Expand Down
Empty file added lib/4.02.3/bspp.mli
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/4.02.3+BS/bsppx.ml.d → lib/4.02.3/bsppx.ml.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
../lib/4.02.3+BS/bsppx.ml:
../lib/4.02.3/bsppx.ml:
../ocaml/parsing/ast_helper.ml
../ocaml/parsing/ast_helper.mli
../ocaml/parsing/asttypes.mli
Expand Down
Empty file added lib/4.02.3/bsppx.mli
Empty file.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit b8546ee

Please sign in to comment.