frenetic-lang / frenetic

The Frenetic Programming Language and Runtime System
http://www.frenetic-lang.org/
Other
222 stars 52 forks source link

Building error #633

Closed dShvetsov closed 5 years ago

dShvetsov commented 5 years ago

Hi! I was trying to build frenetic in the docker, but got the following error: Screenshot from 2019-04-08 17-47-41

The full error is here: error.txt

I've installed opam 2.0.3 from source code, and have installed all dependencies.

Used versions:

# opam --version
2.0.3
# ocaml --version
The OCaml toplevel, version 4.06.0

Here you can find my Dockerfile https://github.com/dShvetsov/frenetic-docker-env.

Could you please help me to build frenetic?

smolkaj commented 5 years ago

Hi @dShvetsov, What's the output of dune --version and opam list? There may be an incompatibility issue with an old (or maybe new?) version of Cstruct. In the meantime, could you try with OCaml 4.07.1? opam switch create 4.07.1

dShvetsov commented 5 years ago
root@frenetic:/userdata/frenetic# dune --version
1.8.2
root@frenetic:/userdata/frenetic# opam list
[WARNING] Running as root is not recommended
# Packages matching: installed
# Name                     # Installed # Synopsis
astring                    0.8.3       Alternative String module for OCaml
async                      v0.11.0     Monadic concurrency library
async_extended             v0.11.0     Additional utilities for async
async_extra                v0.11.1     Monadic concurrency library
async_find                 v0.11.0     Directory traversal with Async
async_inotify              v0.11.0     Async wrapper for inotify
async_interactive          v0.11.0     Utilities for building simple command-line based user interfaces.
async_kernel               v0.11.1     Monadic concurrency library
async_rpc_kernel           v0.11.0     Platform-independent core of Async RPC library
async_shell                v0.11.0     Shell helpers for Async
async_unix                 v0.11.0     Monadic concurrency library
base                       v0.11.1     Full standard library replacement for OCaml
base-bigarray              base
base-bytes                 base        Bytes library distributed with the OCaml compiler
base-threads               base
base-unix                  base
base64                     3.2.0       Base64 encoding for OCaml
bin_prot                   v0.11.0     A binary protocol generator
biniou                     1.2.0       Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve
cohttp                     2.0.0       An OCaml library for HTTP clients and servers
cohttp-async               2.1.1       CoHTTP implementation for the Async concurrency library
command_rpc                v0.11.0     Utilities for Versioned RPC communication with a child process over stdin and stdout.
conduit                    1.4.0       A network connection establishment library
conduit-async              1.4.0       A network connection establishment library for Async
conf-m4                    1           Virtual package relying on m4
conf-which                 1           Virtual package relying on which
configurator               v0.11.0     Helper library for gathering system configuration
core                       v0.11.3     Industrial strength alternative to OCaml's standard library
core_extended              v0.11.0     Extra components that are not as closely vetted or as stable as Core
core_kernel                v0.11.1     Industrial strength alternative to OCaml's standard library
cppo                       1.6.5       Equivalent of the C preprocessor for OCaml programs
cppo_ocamlbuild            1.6.0       ocamlbuild support for cppo, OCaml-friendly source preprocessor
cstruct                    4.0.0       Access C-like structures directly from OCaml
cstruct-async              4.0.0       Access C-like structures directly from OCaml
cstruct-lwt                4.0.0       Access C-like structures directly from OCaml
delimited_parsing          v0.11.0     Parsing of character (e.g., comma) separated and fixed-width values
dune                       1.8.2       Fast, portable and opinionated build system
duration                   0.1.2       Conversions to various time units
easy-format                1.3.1       High-level and functional interface to the Format module of the OCaml standard library
ethernet                   2.0.0       OCaml Ethernet (IEEE 802.3) layer, used in MirageOS
expect_test_helpers        v0.11.0     Async helpers for writing expectation tests
expect_test_helpers_kernel v0.11.0     Helpers for writing expectation tests
fieldslib                  v0.11.0     Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new re
fmt                        0.8.6       OCaml Format pretty-printer combinators
gen                        0.5.1       Simple and efficient iterators (modules Gen and GenLabels).
inotify                    2.3         Inotify bindings for ocaml.
ipaddr                     3.1.0       A library for manipulation of IP (and MAC) address representations
jane-street-headers        v0.11.0     Jane Street C header files
jbuilder                   transition  This is a transition package, jbuilder is now named dune. Use the dune
jsonm                      1.0.1       Non-blocking streaming JSON codec for OCaml
logs                       0.6.2       Logging infrastructure for OCaml
lru                        0.2.0       Scalable LRU caches
lwt                        4.2.1       Promises and event-driven I/O
lwt-dllist                 1.0.0       Mutable doubly-linked list with Lwt iterators
macaddr                    3.1.0       A library for manipulation of MAC address representations
magic-mime                 1.1.1       Map filenames to common MIME types
menhir                     20181113    An LR(1) parser generator
mirage-clock               2.0.0       Libraries and module types for portable clocks
mirage-clock-lwt           2.0.0       Lwt-based implementation of the MirageOS Clock interface
mirage-device              1.2.0       Abstract devices for MirageOS
mirage-flow                1.5.0       Flow implementations and combinators for MirageOS
mirage-net                 2.0.0       Network signatures for MirageOS
mirage-net-lwt             2.0.0       Network signatures for MirageOS
mirage-profile             0.8.2       Collect runtime profiling information in CTF format
mirage-protocols           2.0.0       MirageOS signatures for network protocols
mirage-protocols-lwt       2.0.0       MirageOS signatures for network protocols
mirage-random              1.2.0       Random-related devices for MirageOS
mirage-stack               1.4.0       MirageOS signatures for network stacks
mirage-stack-lwt           1.4.0       MirageOS signatures for network stacks
mirage-time                1.1.0       Time operations for MirageOS
mirage-time-lwt            1.1.0       Time operations for MirageOS
mmap                       1.1.0       File mapping functionality
mparser                    1.2.3       A simple monadic parser combinator library
num                        1.1         The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml                      4.06.0      The OCaml compiler (virtual package)
ocaml-base-compiler        4.06.0      Official 4.06.0 release
ocaml-compiler-libs        v0.11.0     OCaml compiler libraries repackaged
ocaml-config               1           OCaml Switch Configuration
ocaml-migrate-parsetree    1.2.0       Convert OCaml parsetrees between different versions
ocamlbuild                 0.14.0      OCamlbuild is a build system with builtin rules to easily build most OCaml projects.
ocamlfind                  1.8.0       A library manager for OCaml
ocamlgraph                 1.8.8       A generic graph library for OCaml
ocplib-endian              1.0         Optimised functions to read and write int16/32/64 from strings and bigarrays, based on new primitives added in version 4.01.
octavius                   1.2.0       Ocamldoc comment syntax parser
open                       0.2.2       Open files in their default applications
parsexp                    v0.11.0     S-expression parsing library
ppx_assert                 v0.11.0     Assert-like extension nodes that raise useful errors on failure
ppx_base                   v0.11.0     Base set of ppx rewriters
ppx_bench                  v0.11.0     Syntax extension for writing in-line benchmarks in ocaml code
ppx_bin_prot               v0.11.1     Generation of bin_prot readers and writers from types
ppx_compare                v0.11.1     Generation of comparison functions from types
ppx_cstruct                4.0.0       Access C-like structures directly from OCaml
ppx_custom_printf          v0.11.0     Printf-style format-strings for user-defined string conversion
ppx_derivers               1.2.1       Shared [@@deriving] plugin registry
ppx_deriving               4.2.1       Type-driven code generation for OCaml >=4.02
ppx_enumerate              v0.11.1     Generate a list containing all values of a finite type
ppx_expect                 v0.11.1     Cram like framework for OCaml
ppx_fail                   v0.11.0     Add location to calls to failwiths
ppx_fields_conv            v0.11.0     Generation of accessor and iteration functions for ocaml records
ppx_hash                   v0.11.1     A ppx rewriter that generates hash functions from type expressions and definitions
ppx_here                   v0.11.0     Expands [%here] into its location
ppx_inline_test            v0.11.0     Syntax extension for writing in-line tests in ocaml code
ppx_jane                   v0.11.0     Standard Jane Street ppx rewriters
ppx_js_style               v0.11.0     Code style checker for Jane Street Packages
ppx_let                    v0.11.0     Monadic let-bindings
ppx_optcomp                v0.11.0     Optional compilation for OCaml
ppx_optional               v0.11.0     Pattern matching on flat options
ppx_pipebang               v0.11.0     A ppx rewriter that inlines reverse application operators `|>` and `|!`
ppx_sexp_conv              v0.11.2     Generation of S-expression conversion functions from type definitions
ppx_sexp_message           v0.11.0     A ppx rewriter for easy construction of s-expressions
ppx_sexp_value             v0.11.0     A ppx rewriter that simplifies building s-expressions from ocaml values
ppx_tools                  5.1+4.06.0  Tools for authors of ppx rewriters and other syntactic tools
ppx_tools_versioned        5.2.1       A variant of ppx_tools based on ocaml-migrate-parsetree
ppx_typerep_conv           v0.11.1     Generation of runtime types from type declarations
ppx_variants_conv          v0.11.1     Generation of accessor and iteration functions for ocaml variant types
ppxlib                     0.5.0       Base library and tools for ppx rewriters
protocol_version_header    v0.11.0     Protocol versioning
psq                        0.1.1       Functional Priority Search Queues
randomconv                 0.1.2       Convert from random byte vectors (Cstruct.t) to random native numbers
re                         1.9.0       RE is a regular expression library for OCaml
re2                        v0.11.0     OCaml bindings for RE2, Google's regular expression library
result                     1.3         Compatibility Result module
rresult                    0.6.0       Result value combinators for OCaml
sedlex                     2.0         An OCaml lexer generator for Unicode
seq                        0.1         Compatibility package for OCaml's standard iterator type starting from 4.07.
sequencer_table            v0.11.0     A table of [Async.Sequencer]'s, indexed by key
sexp_pretty                v0.11.0     S-expression pretty-printer
sexplib                    v0.11.0     Library for serializing OCaml values to and from S-expressions
sexplib0                   v0.11.0     Library containing the definition of S-expressions and some base converters
spawn                      v0.13.0     Spawning sub-processes
splittable_random          v0.11.0     PRNG that can be split into independent streams
stdio                      v0.11.0     Standard IO library for OCaml
stdlib-shims               0.1.0       Backport some of the new stdlib features to older compiler
stringext                  1.5.0       Extra string functions for OCaml
tcpip                      3.7.2       OCaml TCP/IP networking stack, used in MirageOS
textutils                  v0.11.0     Text output utilities
textutils_kernel           v0.11.0     Text output utilities
topkg                      1.0.0       The transitory OCaml software packager
typerep                    v0.11.0     typerep is a library for runtime types.
uchar                      0.0.2       Compatibility library for OCaml's Uchar module
uri                        2.2.0       An RFC3986 URI/URL parsing library
uutf                       1.0.2       Non-blocking streaming Unicode codec for OCaml
variantslib                v0.11.0     Part of Jane Street's Core library
yojson                     1.7.0       Yojson is an optimized parsing and printing library for the JSON format
dShvetsov commented 5 years ago

Also the command dune external-lib-deps --missing @all gives the following result:

Error: The following libraries are missing in the default context:
- cppo
- menhir
Hint: try: opam install cppo menhir

But these libraries have been already installed:

#opam install cppo menhir
[WARNING] Running as root is not recommended
[NOTE] Package menhir is already installed (current version is 20181113).
[NOTE] Package cppo is already installed (current version is 1.6.5).
dShvetsov commented 5 years ago

Switching to ocaml 4.07.1 did not help. There is is still the same problem.

smolkaj commented 5 years ago

Thanks for all the info, @dShvetsov. The issue is due to the newest version of cstruct (4.0) making some breaking changes. I submitted a PR to address this. You can fix this by making sure you're using cstruct < 4.0, e.g. like so:

opam install cstruct.3.7.0
dShvetsov commented 5 years ago

After downgrading cstruct, I still got an error. So I had to downgrade yojson to version 1.5.0 (it seems yojson breaks backward compability)

so the following commands helped me to managed this issue:

opam install cstruct.3.7.0
opam install yojson.1.5.0
make clean
make && make install

Thank you a lot!

smolkaj commented 5 years ago

I’m glad it worked out, awesome!