From 768902181035928365bb0395bd7b5a039b326678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 2 Jan 2017 14:02:55 +0100 Subject: [PATCH] CI: less build artifacts --- .gitignore | 2 ++ .gitlab-ci.yml | 1 + src/Makefile | 8 ++++++-- src/Makefile.config | 6 +++++- src/client/embedded/Makefile.shared | 1 + src/client/embedded/bootstrap/Makefile | 2 ++ src/compiler/tezos_compiler.ml | 3 ++- test/Makefile | 5 ++++- 8 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2bb4caf7d..ab918853d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ /tezos-webclient /tezos-attacker +/src/Makefile.local + /src/webclient_static.ml /src/.depend diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 791f99668..3b44d3a45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,7 @@ build: tags: - tezos_builder script: + - echo "PRODUCTION=yes" > src/Makefile.local - make -j4 artifacts: expire_in: 1 week diff --git a/src/Makefile b/src/Makefile index 522665bbf..5f3fa9440 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,5 @@ +-include Makefile.local include Makefile.config TZCOMPILER=../tezos-protocol-compiler @@ -357,7 +358,9 @@ proto/embedded_proto_%.cmxa: \ proto/%/TEZOS_PROTOCOL \ $$(wildcard proto/%/*.ml) \ $$(wildcard proto/%/*.mli) - @${TZCOMPILER} -static -build-dir proto/$*/_tzbuild $@ proto/$*/ + @${TZCOMPILER} -static ${DEVFLAGS} \ + -build-dir proto/$*/_tzbuild \ + $@ proto/$*/ CLIENT_PROTO_INCLUDES := \ minutils utils node/updater node/db node/net node/shell client \ @@ -370,7 +373,8 @@ proto/client_embedded_proto_%.cmxa: \ proto/%/TEZOS_PROTOCOL \ $$(wildcard proto/%/*.ml) \ $$(wildcard proto/%/*.mli) - @./${TZCOMPILER} -static -client -build-dir client/embedded/$*/_tzbuild \ + @./${TZCOMPILER} -static -client ${DEVFLAGS} \ + -build-dir client/embedded/$*/_tzbuild \ $(addprefix -I , ${CLIENT_PROTO_INCLUDES}) \ $@ proto/$* diff --git a/src/Makefile.config b/src/Makefile.config index b8c22e19c..8147ced87 100644 --- a/src/Makefile.config +++ b/src/Makefile.config @@ -8,8 +8,12 @@ INCLUDES = \ $(patsubst %, -package %, $(PACKAGES)) \ $(patsubst %, -open %, $(OPENED_MODULES)) +ifneq ($(strip ${PRODUCTION}),yes) +DEVFLAGS := -bin-annot -g +endif + OCAMLFLAGS = \ - -g -safe-string -bin-annot -w +27-30-40 -short-paths \ + ${DEVFLAGS} -short-paths -safe-string -w +27-30-40 \ ${INCLUDES} \ ${EXTRA_OCAMLFLAGS} diff --git a/src/client/embedded/Makefile.shared b/src/client/embedded/Makefile.shared index 2f56137d9..5efe00ddb 100644 --- a/src/client/embedded/Makefile.shared +++ b/src/client/embedded/Makefile.shared @@ -3,6 +3,7 @@ all: \ ../client_$(PROTO_VERSION).cmx \ ../webclient_$(PROTO_VERSION).cmx +-include ../../../Makefile.local include ../../../Makefile.config NODE_DIRECTORIES = \ diff --git a/src/client/embedded/bootstrap/Makefile b/src/client/embedded/bootstrap/Makefile index 90b82815f..558a62599 100644 --- a/src/client/embedded/bootstrap/Makefile +++ b/src/client/embedded/bootstrap/Makefile @@ -69,6 +69,8 @@ clean:: -rm -f mining/*.cm* mining/*~ mining/*.o mining/*.a -rm -f mining/*.deps mining/*.deps.byte +.INTERMEDIATE: webclient/browser/main.byte + JS_PACKAGES := \ lwt \ cstruct \ diff --git a/src/compiler/tezos_compiler.ml b/src/compiler/tezos_compiler.ml index e833929ee..d3e9c2e64 100644 --- a/src/compiler/tezos_compiler.ml +++ b/src/compiler/tezos_compiler.ml @@ -310,6 +310,8 @@ let main () = "-static", Arg.Set static, " Build a library (.cmxa)"; "-client", Arg.Set client, " Preserve type equality with concrete node environment (used to embed protocol into the client)" ; "-I", Arg.String (fun s -> include_dirs := s :: !include_dirs), "path Path for concrete node signatures (used to embed protocol into the client)" ; + "-bin-annot", Arg.Set Clflags.binary_annotations, " (see ocamlopt)" ; + "-g", Arg.Set Clflags.debug, " (see ocamlopt)" ; "-build-dir", Arg.String (fun s -> build_dir := Some s), "path Reuse build dir (incremental compilation)"] in let usage_msg = Printf.sprintf "Usage: %s \nOptions are:" Sys.argv.(0) in Arg.parse args_spec (fun s -> anonymous := s :: !anonymous) usage_msg ; @@ -374,7 +376,6 @@ let main () = Clflags.nopervasives := true; Warnings.parse_options false warnings; Warnings.parse_options true warn_error; - if keep_object then Clflags.binary_annotations := true; let md5 = if not client then diff --git a/test/Makefile b/test/Makefile index ab44dbdb4..429836541 100644 --- a/test/Makefile +++ b/test/Makefile @@ -43,7 +43,10 @@ PACKAGES := \ sodium \ unix \ kaputt \ - bisect_ppx.runtime + +ifeq ($(strip ${COVERAGE}),yes) +PACKAGES += bisect_ppx.runtime +endif ############################################################################ ## External packages