janestreet / re2

OCaml bindings for RE2
MIT License
43 stars 19 forks source link

Can't install on MAC #31

Open mimoo opened 3 years ago

mimoo commented 3 years ago

Hey! I started getting this error that I didn't get previously:

#=== ERROR while compiling re2.v0.12.1 ========================================#
# context     2.0.8 | macos/x86_64 | ocaml-variants.4.07.1+logoom | https://opam.ocaml.org#4ff0fe2a
# path        ~/Work/official_mina/_opam/.opam-switch/build/re2.v0.12.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p re2 -j 11
# exit-code   1
# env-file    ~/.opam/log/re2-17770-361372.env
# output-file ~/.opam/log/re2-17770-361372.out
### output ###
# # It must be in the format described in stdlib/sys.mli
# [...]
# In file included from stubs.cpp:1:
# In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
# In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:15:
# In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:643:
# In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
# In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
# /Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
# 4.07.1
# ^
# fatal error: too many errors emitted, stopping now [-ferror-limit=]
# 20 errors generated.

I'm still investigating, I'm not sure if the error is on my side or not.

mimoo commented 3 years ago

full output:

      ocamlc src/.re2.objs/byte/re2__Regex.{cmo,cmt}
File "src/regex.ml", line 145, characters 25-46:
Warning 52: Code should not depend on the actual values of
this constructor's arguments. They are only for information
and may change in future versions. (See manual section 9.5)
    ocamlopt src/.re2.objs/native/re2__Regex.{cmx,o}
File "src/regex.ml", line 145, characters 25-46:
Warning 52: Code should not depend on the actual values of
this constructor's arguments. They are only for information
and may change in future versions. (See manual section 9.5)
          cc src/stubs.o (exit 1)
(cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -I re2_c/libre2 -g -I /Users/davidwong/Work/official_mina/_opam/lib/ocaml -I /Users/davidwong/Work/official_mina/_opam/lib/base -I /Users/davidwong/Work/official_mina/_opam/lib/base/caml -I /Users/davidwong/Work/official_mina/_opam/lib/base/md5 -I /Users/davidwong/Work/official_mina/_opam/lib/base/shadow_stdlib -I /Users/davidwong/Work/official_mina/_opam/lib/base_bigstring -I /Users/davidwong/Work/official_mina/_opam/lib/base_quickcheck -I /Users/davidwong/Work/official_mina/_opam/lib/bin_prot -I /Users/davidwong/Work/official_mina/_opam/lib/bin_prot/shape -I /Users/davidwong/Work/official_mina/_opam/lib/core_kernel -I /Users/davidwong/Work/official_mina/_opam/lib/core_kernel/base_for_tests -I /Users/davidwong/Work/official_mina/_opam/lib/core_kernel/rope -I /Users/davidwong/Work/official_mina/_opam/lib/fieldslib -I /Users/davidwong/Work/official_mina/_opam/lib/jane-street-headers -I /Users/davidwong/Work/official_mina/_opam/lib/parsexp -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_assert/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_bench/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_compare/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_enumerate/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_expect/collector -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_expect/common -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_expect/config -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_hash/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_inline_test/config -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_inline_test/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_module_timer/runtime -I /Users/davidwong/Work/official_mina/_opam/lib/ppx_sexp_conv/runtime-lib -I /Users/davidwong/Work/official_mina/_opam/lib/sexplib -I /Users/davidwong/Work/official_mina/_opam/lib/sexplib0 -I /Users/davidwong/Work/official_mina/_opam/lib/splittable_random -I /Users/davidwong/Work/official_mina/_opam/lib/stdio -I /Users/davidwong/Work/official_mina/_opam/lib/time_now -I /Users/davidwong/Work/official_mina/_opam/lib/typerep -I /Users/davidwong/Work/official_mina/_opam/lib/variantslib -I re2_c -o stubs.o -c stubs.cpp)
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/bit:58:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:105:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive
# The version string is the first line of this file.
  ^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:4:3: error: invalid preprocessing directive
# It must be in the format described in stdlib/sys.mli
  ^
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/bit:58:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:105:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive
# The version string is the first line of this file.
  ^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:4:3: error: invalid preprocessing directive
# It must be in the format described in stdlib/sys.mli
  ^
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/bit:58:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive
# The version string is the first line of this file.
  ^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:4:3: error: invalid preprocessing directive
# It must be in the format described in stdlib/sys.mli
  ^
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/bit:60:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive
# The version string is the first line of this file.
  ^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:4:3: error: invalid preprocessing directive
# It must be in the format described in stdlib/sys.mli
  ^
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:642:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive
# The version string is the first line of this file.
  ^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:4:3: error: invalid preprocessing directive
# It must be in the format described in stdlib/sys.mli
  ^
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:643:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive
# The version string is the first line of this file.
  ^
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:4:3: error: invalid preprocessing directive
# It must be in the format described in stdlib/sys.mli
  ^
In file included from stubs.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:643:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
4.07.1
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
dwang20151005 commented 3 years ago

Hey,

Thanks for the report. I'm copying Xavier, who works on our public release.

I see two errors in your output.

File "src/regex.ml", line 145, characters 25-46: Warning 52: Code should not depend on the actual values of this constructor's arguments. They are only for information and may change in future versions. (See manual section 9.5)

Xavier, why do we have this warning enabled in the public release? I see internally that we include 52 in hardcoded_disabled_warnings:

app/jenga-rules/src/compiler_config.ml

I am also up for enabling it internally in this library. I will fix the resulting build errors if you show me how to produce them.

/Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:1:1: error: expected unqualified-id 4.07.1 ^ /Users/davidwong/Work/official_mina/_opam/lib/ocaml/version:3:3: error: invalid preprocessing directive

The version string is the first line of this file.

^

Xavier, I'm going to defer to you on this one as well. It looks like a syntax error in the opam metadata? Here's the github issue with the full output:

https://github.com/janestreet/re2/issues/31

Wang

xclerc commented 3 years ago

The warning issue is probably a red herring as I expect warnings to be non fatal when the package is installed through opam.

The version issue looks like another instance of https://github.com/ocaml/ocaml/issues/10410 which is fixed by https://github.com/ocaml/ocaml/pull/9895, but I really doubt it will be backported to 4.07.1. One can possibly fix it manually by deleting the offending version file (e.g. with something like rm $(ocamlc -where)/lib/ocaml/version).

mimoo commented 3 years ago

Indeed we are on an old version... issue might resolve itself when we bump. Thanks!

mimoo commented 3 years ago

The proposed fix worked FWIW! (except it's rm $(ocamlc -where)/version)

Is removing that file going to break anything else btw :D?

xclerc commented 3 years ago

Indeed, copy/paste mistake; sorry for that.

Given that the file used to be installed, I can imagine some tools trying to read it, but that does not sound very likely.