janestreet / bin_prot

Binary protocol generator
MIT License
73 stars 21 forks source link

opam install bin_prot.v0.9.1 fails #15

Closed oddg closed 7 years ago

oddg commented 7 years ago

The json output of the run is as follows:

[
  [
    {
      "install": {
        "name": "bin_prot",
        "version": "v0.9.1"
      }
    }
  ],
  {
    "package": "bin_prot.v0.9.1",
    "error": {
      "process-error": {
        "code": "1",
        "duration": 1.441176891326904,
        "info": {
          "opam-version": "1.2.2",
          "os": "darwin",
          "command": "jbuilder build -p bin_prot -j 4",
          "path": "/Users/olivier/.opam/system/build/bin_prot.v0.9.1",
          "compiler": "system (4.05.0)",
          "exit-code": "1",
          "env-file": "/Users/olivier/.opam/system/build/bin_prot.v0.9.1/bin_prot-42873-6d07ae.env",
          "stdout-file": "/Users/olivier/.opam/system/build/bin_prot.v0.9.1/bin_prot-42873-6d07ae.out",
          "stderr-file": "/Users/olivier/.opam/system/build/bin_prot.v0.9.1/bin_prot-42873-6d07ae.err"
        },
        "stdout": [],
        "stderr": [
          "      ocamlc src/bin_prot.{cmi,cmo,cmt}",
          "      ocamlc shape/src/bin_shape_lib.{cmi,cmo,cmt}",
          "    ocamlopt src/bin_prot.{cmx,o}",
          "        bash src/config.h",
          "          sh src/read.pp.ml",
          "    ocamlopt shape/src/bin_shape_lib.{cmx,o}",
          "          sh src/size.pp.ml",
          "          sh src/type_class.pp.ml",
          "          sh src/write.pp.ml",
          "      ocamlc src/float_stubs.o",
          "      ocamlc src/blit_stubs.o",
          "          sh src/read.pp.mli",
          "          sh src/size.pp.mli",
          "          sh src/type_class.pp.mli",
          "          sh src/write.pp.mli",
          "  ocamlmklib src/dllbin_prot_stubs.so,src/libbin_prot_stubs.a",
          "    ocamlopt .ppx/ppx_sexp_conv+ppx_driver.runner/ppx.exe",
          "    ocamlopt .ppx/ppx_compare+ppx_custom_printf+ppx_fields_conv+ppx_sexp_conv+ppx_variants_conv+ppx_driver.runner/ppx.exe",
          "         ppx src/common.pp.mli",
          "         ppx shape/src/core_fragment.pp.ml",
          "         ppx src/common.pp.ml",
          "    ocamldep src/bin_prot.dependsi.ocamldep-output",
          "         ppx shape/src/bin_shape.pp.mli",
          "         ppx shape/src/std.pp.ml",
          "         ppx shape/src/bin_shape.pp.ml",
          "    ocamldep shape/src/bin_shape_lib.dependsi.ocamldep-output",
          "    ocamldep shape/src/bin_shape_lib.depends.ocamldep-output",
          "    ocamldep src/bin_prot.depends.ocamldep-output (exit 2)",
          "(cd _build/default && /usr/local/bin/ocamldep.opt -modules -impl src/bin_prot.ml-gen src/binable.ml src/blob.ml src/common.pp.ml src/nat0.ml src/read.pp.ml src/shape.ml src/size.pp.ml src/std.ml src/type_class.pp.ml src/utils.ml src/write.pp.ml) > _build/default/src/bin_prot.depends.ocamldep-output",
          "File \"src/config.h\", line 3, characters 4-5:",
          "Error: Syntax error",
          "File \"src/config.h\", line 3, characters 4-5:",
          "Error: Syntax error",
          "File \"src/config.h\", line 3, characters 4-5:",
          "Error: Syntax error"
        ]
      }
    }
  }
]

It seems that the problem is in file .../build/bin_prot.v0.9.1/_build/default/src/config.h

#ifndef CORE_CONFIG_H
#define CORE_CONFIG_H
1483:#define JSC_ARCH_SIXTYFOUR
#define JSC_POSIX_TIMERS
#undef JSC_ARCH_BIG_ENDIAN
#endif
oddg commented 7 years ago

Oh solved it! This was a problem with my local settings of grep having --line-number in my GREP_OPTIONS environment variable.