Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Can't build on Mac #158

Open
voidcenter opened this issue May 23, 2018 · 7 comments
Open

Can't build on Mac #158

voidcenter opened this issue May 23, 2018 · 7 comments

Comments

@voidcenter
Copy link

Hi, I'm having trouble getting pfff built on Mac and the error message is:

Error: The implementation common.ml does not match the interface common.cmi:
       Values do not match:
         val read_file : string -> bytes
       is not included in
         val read_file : filename -> string
       File "/Users/{}/git/pfff/commons/common.mli", line 55, characters 0-34:
         Expected declaration
       File "/Users/{}/git/pfff/commons/common.ml", line 838, characters 4-13:
         Actual declaration
make[2]: *** [common.cmo] Error 2

Seems like there is a signature mismatch for the read_file function. Wonder if anyone else is having the same problem?

macOS High Sierra 10.13.4

$ uname -a
Darwin {} 17.5.0 Darwin Kernel Version 17.5.0: {}; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,4 Darwin

The OCaml toplevel, version 4.06.1

Thx~

@aryx
Copy link
Contributor

aryx commented May 25, 2018

Do you use opam? Can you try to switch to ocaml 4.02.3 and check it it works?
I think recent ocaml versions make a strong difference between strings and bytes (they use to be the same type).

@voidcenter
Copy link
Author

Hi @aryx , thanks for the reply. I uninstalled ocaml 4.06.1 and switched to ocaml 4.02.3:

$ opam config list
# Global OPAM configuration variables

user                 {}
group                staff
make                 make
os                   darwin
root                 /Users/{}/.opam
prefix               /Users/{}/.opam/system
lib                  /Users/{}/.opam/system/lib
bin                  /Users/{}/.opam/system/bin
sbin                 /Users/{}/.opam/system/sbin
doc                  /Users/{}/.opam/system/doc
stublibs             /Users/{}/.opam/system/lib/stublibs
toplevel             /Users/{}/.opam/system/lib/toplevel
man                  /Users/{}/.opam/system/man
share                /Users/{}/.opam/system/share
etc                  /Users/{}/.opam/system/etc

# Global variables from the environment

ocaml-version        4.02.3               # The version of the currently used OCaml compiler
opam-version         1.2.2                # The currently running OPAM version
compiler             system               # The name of the current OCaml compiler (may be more specific than the version, eg: "4.01.0+fp", or "system")
preinstalled         true                 # Whether the compiler was preinstalled on the system, or installed by OPAM
switch               system               # The local name (alias) of the current switch
jobs                 4                    # The number of parallel jobs set up in OPAM configuration
ocaml-native         true                 # Whether the OCaml native compilers are available
ocaml-native-tools   true                 # Whether the native ".opt" version of the OCaml toolchain is available
ocaml-native-dynlink true                 # Whether native dynlink is available on this installation
arch                 x86_64               # The current arch, as returned by "uname -m"

# Package variables ('opam config list PKG' to show)

PKG:name                                  # Name of the package
PKG:version                               # Version of the package
PKG:depends                               # Resolved direct dependencies of the package
PKG:installed                             # Whether the package is installed
PKG:enable                                # Takes the value "enable" or "disable" depending on whether the package is installed
PKG:pinned                                # Whether the package is pinned
PKG:bin                                   # Binary directory for this package
PKG:sbin                                  # System binary directory for this package
PKG:lib                                   # Library directory for this package
PKG:man                                   # Man directory for this package
PKG:doc                                   # Doc directory for this package
PKG:share                                 # Share directory for this package
PKG:etc                                   # Etc directory for this package
PKG:build                                 # Directory where the package was built
PKG:hash                                  # Hash of the package archive

But when I do make depend I got the following errors:

Fatal error: unknown C primitive caml_add_debug_info'`

I did some search but the answer seems not helpful. Wonder how shall I solve this problem?

Thx!

@QuyTran
Copy link

QuyTran commented Jun 9, 2018

same on my side also,

➜ pfff git:(master) make
/Library/Developer/CommandLineTools/usr/bin/make rec
/Library/Developer/CommandLineTools/usr/bin/make -C commons
ocamlc.opt -g -dtypes -bin-annot -absname -thread -w +9 -I ocamlextra -I ocollection -c common.ml
File "/Users/quytran/Working/pfff/commons/common.ml", line 252, characters 16-25:
Warning 3: deprecated: Obj.final_tag
Replaced by custom_tag.
File "/Users/quytran/Working/pfff/commons/common.ml", line 841, characters 12-25:
Warning 3: deprecated: String.create
Use Bytes.create instead.
File "/Users/quytran/Working/pfff/commons/common.ml", line 1:
Error: The implementation common.ml does not match the interface common.cmi:
Values do not match:
val read_file : string -> bytes
is not included in
val read_file : filename -> string
File "/Users/quytran/Working/pfff/commons/common.mli", line 55, characters 0-34:
Expected declaration
File "/Users/quytran/Working/pfff/commons/common.ml", line 838, characters 4-13:
Actual declaration
make[2]: *** [common.cmo] Error 2
make[1]: *** [rec] Error 2
make: *** [all] Error 2

is there any work around for it? thanks

@aryx
Copy link
Contributor

aryx commented Jun 9, 2018

Ok, I've added a fix in my fork of pfff:
try https://github.com/aryx/pfff
(I do not have commit write anymore to this repository since I left facebook).

note that before make depend you will also need to do make -C external
(follow the instructions shown by ./configure)

@QuyTran
Copy link

QuyTran commented Jun 12, 2018

thanks @aryx, let me try again

@zoidyzoidzoid
Copy link

@aryx There are a lot of commits in your fork. Would it be possible to try get Facebook to deprecate their repo and recommend yours instead? Or at least give you commit rights to this repo?

@aryx
Copy link
Contributor

aryx commented Sep 25, 2018

I'm the main author of Pfff but I don't work at Facebook anymore so I doubt I can get the commit rights.
Just use my fork. @phooji may know if it's possible for Facebook to deprecate facebook/pfff or at least edit the readme or project line to redirect to my repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants