Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.99.19-beta breaks Flow build #92

Open
gabelevi opened this issue May 4, 2017 · 1 comment
Open

1.99.19-beta breaks Flow build #92

gabelevi opened this issue May 4, 2017 · 1 comment

Comments

@gabelevi
Copy link

gabelevi commented May 4, 2017

For github.com/facebook/flow, 1.99.19-beta has broken our build

opam install ocp-build.1.99.18-beta
make all-ocp // Works fine
opam install ocp-build.1.99.19-beta
make all-ocp // Fails

The linker is failing with this error

Undefined symbols for architecture x86_64:
  "_LZ4_compressBound", referenced from:
      _write_at in libmlhh-heap.a(hh_shared.o)
  "_LZ4_compress_default", referenced from:
      _write_at in libmlhh-heap.a(hh_shared.o)
  "_LZ4_decompress_safe", referenced from:
      _hh_get_and_deserialize in libmlhh-heap.a(hh_shared.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
File "_none_", line 1:
Error: Error while building custom runtime system

The failing command for 1.99.19-beta looks like this

 '/Users/glevi/.opam/4.03.0/bin/ocamlc.opt' '-o' './_obuild/flow/flow.byte' '-I' './_obuild/flow' '-I' './src' '-I' './_obuild/flow-commands' '-I' '.' '-I' './_obuild/flow-server' '-I' './_obuild/hh-socket' '-I' './_obuild/flow-services-port' '-I' './_obuild/flow-services-inference' '-I' './_obuild/flow-server-env' '-I' './src/server' '-I' './_obuild/hh-dfind' '-I' './_obuild/tp-avl' '-I' './_obuild/hh-fsnotify' '-I' './_obuild/hh-fsnotify-darwin' '-I' './_obuild/flow-persistent-connection' '-I' './_obuild/flow-common-audit' '-I' './_obuild/flow-services-flowFileGen' '-I' './_obuild/flow-services-autocomplete' '-I' './_obuild/flow-typing' '-I' './_obuild/flow-parsing' '-I' './_obuild/flow-parser-utils' '-I' './_obuild/flow-common-errors' '-I' './_obuild/flow-common-profiling' '-I' './_obuild/flow-embedded' '-I' './_obuild/hh-win32res' '-I' './_obuild/hh-find' '-I' './_obuild/flow-shmem' '-I' './_obuild/flow-server-files' '-I' './_obuild/flow-common-config' '-I' './_obuild/flow-dts' '-I' './_obuild/flow-common' '-I' './_obuild/hh-procs' '-I' './_obuild/flow-stubs' '-I' './_obuild/flow-common-utils' '-I' './_obuild/hh-utils' '-I' './hack/utils' '-I' './_obuild/hh-utils-relative-path' '-I' './_obuild/hh-utils-sys' '-I' './_obuild/hh-utils-disk' '-I' './_obuild/hh-injector-default' '-I' './_obuild/hh-utils-string' '-I' './_obuild/hh-heap' '-I' './_obuild/lz4' '-I' './_obuild/hh-stubs' '-I' './_obuild/hh-utils-core' '-I' './_obuild/hh-utils-json' '-I' './_obuild/tp-core' '-I' './_obuild/hh-utils-collections' '-I' '/Users/glevi/.opam/4.03.0/lib/ocaml' '-I' './_obuild/flow-parser' '-I' '/Users/glevi/.opam/4.03.0/lib/sedlex' '-I' '/Users/glevi/.opam/4.03.0/lib/gen' '-I' './_obuild/ROOTPROJECT' '/Users/glevi/.opam/4.03.0/lib/ocaml/unix.cma' '/Users/glevi/.opam/4.03.0/lib/ocaml/bigarray.cma' '/Users/glevi/.opam/4.03.0/lib/gen/gen.cma' '/Users/glevi/.opam/4.03.0/lib/sedlex/sedlexing.cma' './_obuild/flow-parser/flow-parser.cma' '/Users/glevi/.opam/4.03.0/lib/ocaml/str.cma' '-thread' './_obuild/hh-utils-collections/hh-utils-collections.cma' '-thread' './_obuild/tp-core/tp-core.cma' '-thread' './_obuild/hh-utils-json/hh-utils-json.cma' '-thread' './_obuild/hh-utils-core/hh-utils-core.cma' '-thread' './_obuild/hh-stubs/hh-stubs.cma' '-thread' '-thread' './_obuild/hh-heap/hh-heap.cma' '-thread' './_obuild/hh-utils-string/hh-utils-string.cma' '-thread' './_obuild/hh-injector-default/hh-injector-default.cma' '-thread' './_obuild/hh-utils-disk/hh-utils-disk.cma' '-thread' './_obuild/hh-utils-sys/hh-utils-sys.cma' '-thread' './_obuild/hh-utils-relative-path/hh-utils-relative-path.cma' '-thread' './_obuild/hh-utils/hh-utils.cma' './_obuild/flow-common-utils/flow-common-utils.cma' './_obuild/flow-stubs/flow-stubs.cma' '-thread' './_obuild/hh-procs/hh-procs.cma' './_obuild/flow-common/flow-common.cma' './_obuild/flow-dts/flow-dts.cma' './_obuild/flow-common-config/flow-common-config.cma' './_obuild/flow-server-files/flow-server-files.cma' './_obuild/flow-shmem/flow-shmem.cma' '-thread' './_obuild/hh-find/hh-find.cma' '-thread' './_obuild/hh-win32res/hh-win32res.cma' './_obuild/flow-embedded/flow-embedded.cma' './_obuild/flow-common-profiling/flow-common-profiling.cma' './_obuild/flow-common-errors/flow-common-errors.cma' './_obuild/flow-parser-utils/flow-parser-utils.cma' './_obuild/flow-parsing/flow-parsing.cma' './_obuild/flow-typing/flow-typing.cma' './_obuild/flow-services-autocomplete/flow-services-autocomplete.cma' './_obuild/flow-services-flowFileGen/flow-services-flowFileGen.cma' './_obuild/flow-common-audit/flow-common-audit.cma' './_obuild/flow-persistent-connection/flow-persistent-connection.cma' '-thread' './_obuild/hh-fsnotify-darwin/hh-fsnotify-darwin.cma' '-thread' '-thread' './_obuild/tp-avl/tp-avl.cma' '-thread' './_obuild/hh-dfind/hh-dfind.cma' './_obuild/flow-server-env/flow-server-env.cma' './_obuild/flow-services-inference/flow-services-inference.cma' './_obuild/flow-services-port/flow-services-port.cma' '-thread' './_obuild/hh-socket/hh-socket.cma' './_obuild/flow-server/flow-server.cma' './_obuild/flow-commands/flow-commands.cma' './_obuild/flow/flow.cmo'

I think the key difference is that 1.99.19-beta is missing the '-cclib' '-lmllz4' which 1.99.18-beta has when I run it with --verbosity 4

The linking command that is failing looks like this for 1.99.18-beta

'/Users/glevi/.opam/4.03.0/bin/ocamlc.opt' '-o' './_obuild/flow/flow.byte' '-I' './_obuild/flow' '-I' './src' '-I' './_obuild/flow-commands' '-I' '.' '-I' './_obuild/flow-server' '-I' './_obuild/flow-services-inference' '-I' './_obuild/flow-server-env' '-I' './src/server' '-I' './_obuild/flow-persistent-connection' '-I' './_obuild/flow-services-autocomplete' '-I' './_obuild/flow-services-port' '-I' './_obuild/flow-services-flowFileGen' '-I' './_obuild/flow-embedded' '-I' './_obuild/flow-parsing' '-I' './_obuild/flow-shmem' '-I' './_obuild/flow-typing' '-I' './_obuild/flow-common-errors' '-I' './_obuild/flow-server-files' '-I' './_obuild/flow-common-config' '-I' './_obuild/hh-dfind' '-I' './_obuild/hh-fsnotify' '-I' './_obuild/flow-common' '-I' './_obuild/flow-common-profiling' '-I' './_obuild/flow-dts' '-I' './_obuild/flow-common-utils' '-I' './_obuild/hh-procs' '-I' './_obuild/hh-win32res' '-I' './_obuild/hh-find' '-I' './_obuild/hh-socket' '-I' './_obuild/hh-fsnotify-darwin' '-I' './_obuild/hh-utils' '-I' './hack/utils' '-I' './_obuild/hh-utils-relative-path' '-I' './_obuild/hh-heap' '-I' './_obuild/hh-utils-sys' '-I' './_obuild/hh-utils-core' '-I' './_obuild/hh-utils-json' '-I' './_obuild/hh-utils-disk' '-I' './_obuild/flow-parser-utils' '-I' './_obuild/flow-parser' '-I' './_obuild/lz4' '-I' './_obuild/hh-utils-string' '-I' './_obuild/hh-utils-collections' '-I' './_obuild/hh-injector-default' '-I' './_obuild/hh-stubs' '-I' './_obuild/tp-avl' '-I' './_obuild/tp-core' '-I' '/Users/glevi/.opam/4.03.0/lib/ocaml/threads' '-I' '/Users/glevi/.opam/4.03.0/lib/ocaml' '-I' '/Users/glevi/.opam/4.03.0/lib/sedlex' '-I' '/Users/glevi/.opam/4.03.0/lib/gen' '-I' './_obuild/ROOTPROJECT' '-I' './_obuild/flow-common-audit' '-I' './_obuild/flow-stubs' 'flow-stubs.cma' 'flow-common-audit.cma' 'str.cma' 'unix.cma' 'gen.cma' 'sedlexing.cma' 'bigarray.cma' '-thread' 'threads.cma' '-thread' 'tp-core.cma' '-thread' 'tp-avl.cma' '-thread' 'hh-stubs.cma' '-thread' 'hh-injector-default.cma' '-thread' 'hh-utils-collections.cma' '-thread' 'hh-utils-string.cma' '-thread' '-cclib' '-lmllz4' 'flow-parser.cma' 'flow-parser-utils.cma' '-thread' 'hh-utils-disk.cma' '-thread' 'hh-utils-json.cma' '-thread' 'hh-utils-core.cma' '-thread' 'hh-utils-sys.cma' '-thread' 'hh-heap.cma' '-thread' 'hh-utils-relative-path.cma' '-thread' 'hh-utils.cma' '-thread' 'hh-fsnotify-darwin.cma' '-thread' 'hh-socket.cma' '-thread' 'hh-find.cma' '-thread' 'hh-win32res.cma' '-thread' 'hh-procs.cma' 'flow-common-utils.cma' 'flow-dts.cma' 'flow-common-profiling.cma' 'flow-common.cma' '-thread' '-thread' 'hh-dfind.cma' 'flow-common-config.cma' 'flow-server-files.cma' 'flow-common-errors.cma' 'flow-typing.cma' 'flow-shmem.cma' 'flow-parsing.cma' 'flow-embedded.cma' 'flow-services-flowFileGen.cma' 'flow-services-port.cma' 'flow-services-autocomplete.cma' 'flow-persistent-connection.cma' 'flow-server-env.cma' 'flow-services-inference.cma' 'flow-server.cma' 'flow-commands.cma' './_obuild/flow/flow.cmo'

Our lz4 library is a c-only library, which is defined here: https://github.com/facebook/flow/blob/master/ocp_build_hack.ocp.fb#L23

The .ocp.fb files are basically just .ocp build but with file globbing support (when you run make all-ocp, it compiles the actual .ocp files)

facebook-github-bot pushed a commit to facebook/flow that referenced this issue May 4, 2017
Summary:
Until OCamlPro/ocp-build#92 is closed, let's stick with older versions of ocp-build.
Closes #3879

Reviewed By: samwgoldman

Differential Revision: D5005310

Pulled By: gabelevi

fbshipit-source-id: 348104ceb309bef66ee34b8cd624d87d63f530a6
@lefessan
Copy link
Member

lefessan commented May 5, 2017

Fix is coming, I will hot-fix ocp-build 1.99.19-beta in OPAM:
#93

In the meantime, you can also add "autolink = true" in the lz4 description.

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

No branches or pull requests

2 participants