From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 574777FACE for ; Thu, 18 Sep 2014 23:32:43 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvYBAOhOG1QmachwnGdsb2JhbABgg2BXBIJ8xkuHTQGBAwgWAREBAQEBAQYWCT6EBAEBBBIRHQEBLgkBDwsLDQICJgICIQESAQUBHAYTIogIAxEDCp92a4o4eIUCAQWJfg2HLAERAgQKgSKMHoFKYweCeIFThRIChTqLPIR3ghCHSYc9hFAYKYUrUIJKAQEB X-IPAS-Result: AvYBAOhOG1QmachwnGdsb2JhbABgg2BXBIJ8xkuHTQGBAwgWAREBAQEBAQYWCT6EBAEBBBIRHQEBLgkBDwsLDQICJgICIQESAQUBHAYTIogIAxEDCp92a4o4eIUCAQWJfg2HLAERAgQKgSKMHoFKYweCeIFThRIChTqLPIR3ghCHSYc9hFAYKYUrUIJKAQEB X-IronPort-AV: E=Sophos;i="5.04,550,1406584800"; d="scan'208";a="79977079" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Sep 2014 23:32:41 +0200 Received: from tot-smtp.delacy.com ([172.27.22.15] helo=tot-smtp) by mxout1.mail.janestreet.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XUjJf-0003Wo-Qs for caml-list@inria.fr; Thu, 18 Sep 2014 17:32:39 -0400 Received: from [172.27.229.230] (helo=mxgoog1.mail.janestreet.com) by tot-smtp with esmtps (UNKNOWN:AES256-GCM-SHA384:256) (Exim 4.72) (envelope-from ) id 1XUjJf-0004vw-O1 for caml-list@inria.fr; Thu, 18 Sep 2014 17:32:39 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]) by mxgoog1.mail.janestreet.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.72) (envelope-from ) id 1XUjJf-00037t-Et for caml-list@inria.fr; Thu, 18 Sep 2014 17:32:39 -0400 Received: by mail-la0-f50.google.com with SMTP id ty20so1996876lab.23 for ; Thu, 18 Sep 2014 14:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=44KG5kj+GvQgcIU3RWP9dSZ4rbzba9GXmpT5g8ViTnY=; b=XYTHR4gZs4Kyrf4nQxlrG3H5qIP80vwRMpZia6r1KKPQreFbyPXetbyaDaJYHptoVv MB1QfoKSPQbshIRVNANS8EraYOUo8YH4k2PN5TZ6nbIxOU/rqAs9etsuOH5kfH/LEY2e QNg5lJWRNwYhWwMcOuOxfpAwwTVBHKP4Tmq64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=44KG5kj+GvQgcIU3RWP9dSZ4rbzba9GXmpT5g8ViTnY=; b=CNB+nacHfiSc3mGxnN/IbWHk7Q8KoWQkLKLoQ95dBgMzFFku6xQ/KkA6wrqbGOS5yJ k6ysFVeCK52g2VgkokBfO2wsL3CxbwUA4vcnpfdjFWNjEQPn+qcBa2gRKa2boT+eF+LV v8XSJMX1Ao92xK8fbN0B7LlYtD4a/poaxzxU83x/tPHnDMJgZ7x4AmjyfigktS4YkbS+ V/MlGNJEeNdxcAC4EDtcWmJVjG+0txpvEQHicYUZTiS7DAs989TDGLfS20YmpSbXLHzX ATIp35KGOvbr0ltzcqlf7F20fY8Eol9pJ1IPdDo7s1ynOfEiTFfqhEY6V3zYYH4AyftR KVxg== X-Gm-Message-State: ALoCoQmVN0vEZ0iOSe/NM/kRsdhsnUCzPbTdvibQg2Im3SfEBovYRQgRiuQI06bIO1+LROv4KebuHAJ6q1tO9g/gMtgz4k3p3ZIlIESBoPJLk5vHLMW4rCgBpedopKwX+dF8abv/wu45 X-Received: by 10.112.54.135 with SMTP id j7mr2194654lbp.51.1411075958349; Thu, 18 Sep 2014 14:32:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.54.135 with SMTP id j7mr2194642lbp.51.1411075958250; Thu, 18 Sep 2014 14:32:38 -0700 (PDT) Received: by 10.112.56.136 with HTTP; Thu, 18 Sep 2014 14:32:38 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Sep 2014 17:32:38 -0400 Message-ID: From: Yaron Minsky To: Bob Zhang Cc: caml-list-request@inria.fr, Caml List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] improve omake [was One build system to rule them all] This is not the main point of your post, but to reply to your concerns on Jenga: - I'm not sure why the dependency chain of Jenga matters much. You need camlp4 to build it, but not to use it. In any case, I expect that in a few months, that dependency will be gone as we migrate to extension points. - The examples are big, but that's mostly because it takes a lot of code to precisely express OCaml's dependency and build rules. Other tools either hide that code from you (ocamlbuild) or have incomplete rules that don't quite do the right thing (omake). Note that with our Jenga rules, we do have simple build specification files. Here's the one for async_kernel, which emphasizes how simple these can be. (library ((name async_kernel) (libraries (core)))) Here's the one for async_unix, which is a little more complicated. (library ((name async_unix) (libraries (async_kernel core)) (c_names (dump_core_on_job_delay_stubs)) (preprocess (((pps (JANE pa_macro)) All))))) And here's a much more complicated one, for core: (rule ((targets (config.mlh config.h)) (deps (discover.sh)) (action "${<} ${OCAML} ${OCAMLC} config.mlh config.h -DLINUX_EXT -DPOSIX_TIMERS -DWORDEXP"))) (rule ((targets (version_defaults.mlh)) (deps ()) (action "echo 'DEFINE DEFAULT_VERSION = Version_util.version' > version_defaults.mlh echo 'DEFINE DEFAULT_BUILDINFO = Version_util.build_info' >> version_defaults.mlh echo 'DEFINE BUILD_VERSION_UTIL' >> version_defaults.mlh"))) (library ((name core) (libraries (core_kernel sexplib_unix version_util_fallback)) (interfaces (core_kernel)) (extra_cflags (-D_LARGEFILE64_SOURCE)) ;; We omit [-pedantic] because ;; [bigstring_recvmmsg_assume_fd_is_nonblocking_stub] in ;; bigstring_stubs.c uses variable-length arrays rather than [alloca]. (avoid_cflags (-pedantic)) (library_flags (-cclib -lrt)) (c_names (backtrace_stubs bigstring_stubs crc_stubs iobuf_stubs linux_ext_stubs ocaml_utils_stubs recvmmsg signal_stubs syslog_stubs time_stamp_counter_stubs time_stubs timespec unix_stubs)) (preprocess (((pps (JANE pa_macro)) All))) (preprocessor_deps (version_defaults.mlh config.mlh)))) The point is, there is a simple DSL embedded that we use for specifying individual projects, but it's _very_ simple, with more complicated things done by extending the build rules, in OCaml. Really, I think this is the right design. Build DSLs are typically horrible programming languages, and you don't want to do anything complicated with them. That said, it's not ready for prime time yet, mostly in that it needs some portability work, and some work to get good default rules that people can use externally from Jane Street, with a good story for interacting with ocamlfind and the like. But we'd love to have people trying it out and helping us work out those use cases. Indeed, we've already exported a version of our build rules that are suitable for building with OCaml 4.02: https://github.com/janestreet/jenga/tree/master/examples/js-build-style y On Thu, Sep 18, 2014 at 4:14 PM, Bob Zhang wrote: > Dear camlers, > I have done some work to improve omake available here: > https://github.com/bobzhang/omake-fork/tree/work > Before deciding spending some time in improving omake, I have tried > various build systems. > 1. ocamlbuild > ocamlbuild is really nice for small to medium projects and I have used > it pervasively in my personal projects and corporation projects. It works > pretty well in most cases. > There are mainly three drawbacks: > a. Easy things hard to do. > Even for some very trivial things, if you don't write > myocamlbuild.m for a long time, you have to google ocamlbuild API and figure > it out how to do it correctly. > b. Error messages hard to understand > It's cool that ocamlbuild detect dependencies dynamically, when it > does not work out, in general, I would turn on -verbose and search which > part goes wrong. > c. no parallellism > This is fatal and main reason that I gave it up > 2. ocp-build > I tried it for my hobby project, it's not close to maturity yet. > 3. jenga > Jenga looks promising, but I don't think it would be usable inside our > company, the dependency is huge, more importantly, its dependency chain > includes Camlp4 which we can not rely on. Also, looking at the examples, it > is quite verbose even for trivial projects. > > omake has its own drawbacks as well, for example, the language is overly > complex and error message is hard to understand(still better than > ocamlbuild), startup speed is slow, no easy FFI interface to write rules in > OCaml language itself, but that's all we can find a way to fix. > > -- > Regards > -- Hongbo Zhang