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

Unable to compile Felix #171

Open
Sod-Almighty opened this issue Sep 2, 2022 · 53 comments
Open

Unable to compile Felix #171

Sod-Almighty opened this issue Sep 2, 2022 · 53 comments

Comments

@Sod-Almighty
Copy link

Having installed ocaml (manually, because the opam instructions on their website don't work), I followed the Felix installation instructions:

git clone https://github.com/felix-lang/felix.git
cd felix
. buildscript/linuxsetup.sh
make

The build failed, and I got a bunch of error messages (and warnings!)

# =========================================================
# generates source code from "src/packages" to various places
# around the repo
# =========================================================
python3 src/tools/flx_iscr.py -q -d "src/packages" build/release
PACKAGE src/packages/py_memoryview.fdoc
PACKAGE src/packages/char.fdoc
PACKAGE src/packages/cparse.fdoc
PACKAGE src/packages/py_pystate.fdoc
PACKAGE src/packages/flx_profile.fdoc
PACKAGE src/packages/algebra.fdoc
PACKAGE src/packages/logic.fdoc
PACKAGE src/packages/py_method.fdoc
PACKAGE src/packages/gc.fdoc
PACKAGE src/packages/libstruct.fdoc
PACKAGE src/packages/faio.fdoc
PACKAGE src/packages/uint256_t.fdoc
PACKAGE src/packages/py_string.fdoc
PACKAGE src/packages/debug.fdoc
PACKAGE src/packages/int256.fdoc
PACKAGE src/packages/io.fdoc
PACKAGE src/packages/fibres.fdoc
PACKAGE src/packages/ncurses.fdoc
PACKAGE src/packages/complex.fdoc
PACKAGE src/packages/flx_web.fdoc
PACKAGE src/packages/py_list.fdoc
PACKAGE src/packages/py_pycapsule.fdoc
PACKAGE src/packages/pthreads.fdoc
PACKAGE src/packages/memory.fdoc
PACKAGE src/packages/py_pylifecycle.fdoc
PACKAGE src/packages/quaternion.fdoc
PACKAGE src/packages/stl.fdoc
PACKAGE src/packages/py_iterator.fdoc
PACKAGE src/packages/rtl-slist.fdoc
PACKAGE src/packages/time.fdoc
PACKAGE src/packages/buildtools.fdoc
PACKAGE src/packages/web.fdoc
PACKAGE src/packages/rtl-lfbag.fdoc
PACKAGE src/packages/botan.fdoc
PACKAGE src/packages/spinlock.fdoc
PACKAGE src/packages/py_module.fdoc
PACKAGE src/packages/py_type.fdoc
PACKAGE src/packages/py_mapping.fdoc
PACKAGE src/packages/py_float.fdoc
PACKAGE src/packages/async.fdoc
PACKAGE src/packages/gmp.fdoc
PACKAGE src/packages/py_sequence.fdoc
PACKAGE src/packages/parsers.fdoc
PACKAGE src/packages/py_bytes.fdoc
PACKAGE src/packages/recognisers.fdoc
PACKAGE src/packages/flx_pkgconfig.fdoc
PACKAGE src/packages/rtl.fdoc
PACKAGE src/packages/py_tuple.fdoc
PACKAGE src/packages/regex.fdoc
PACKAGE src/packages/rtl-waitablebool.fdoc
PACKAGE src/packages/py_number.fdoc
PACKAGE src/packages/py_version.fdoc
PACKAGE src/packages/arrays.fdoc
PACKAGE src/packages/judy.fdoc
PACKAGE src/packages/flx_flxg.fdoc
PACKAGE src/packages/strutil.fdoc
PACKAGE src/packages/chips.fdoc
PACKAGE src/packages/rtl-sysdlist.fdoc
PACKAGE src/packages/sdl.fdoc
PACKAGE src/packages/gsl.fdoc
PACKAGE src/packages/strings.fdoc
PACKAGE src/packages/programmer.fdoc
PACKAGE src/packages/ucstring.fdoc
PACKAGE src/packages/py_oldbuffer.fdoc
PACKAGE src/packages/sqlite3.fdoc
PACKAGE src/packages/py_weakref.fdoc
PACKAGE src/packages/python.fdoc
PACKAGE src/packages/py_long.fdoc
PACKAGE src/packages/core_type_constructors.fdoc
PACKAGE src/packages/py_bytearray.fdoc
PACKAGE src/packages/rparse.fdoc
PACKAGE src/packages/embed.fdoc
PACKAGE src/packages/flx.fdoc
PACKAGE src/packages/rtl-boundqueue.fdoc
PACKAGE src/packages/codecs.fdoc
PACKAGE src/packages/linux.fdoc
PACKAGE src/packages/umka.fdoc
PACKAGE src/packages/py_bool.fdoc
PACKAGE src/packages/reals.fdoc
PACKAGE src/packages/py_dict.fdoc
PACKAGE src/packages/rtl-conditionvariable.fdoc
PACKAGE src/packages/grammars.fdoc
PACKAGE src/packages/trees.fdoc
PACKAGE src/packages/flx_doc.fdoc
PACKAGE src/packages/py_int.fdoc
PACKAGE src/packages/driver.fdoc
PACKAGE src/packages/toolchain.fdoc
PACKAGE src/packages/svc.fdoc
PACKAGE src/packages/program.fdoc
PACKAGE src/packages/configs.fdoc
PACKAGE src/packages/py_complex.fdoc
PACKAGE src/packages/gui.fdoc
PACKAGE src/packages/serialisation.fdoc
PACKAGE src/packages/cheaders.fdoc
PACKAGE src/packages/integers.fdoc
PACKAGE src/packages/dynlink.fdoc
PACKAGE src/packages/py_slice.fdoc
PACKAGE src/packages/apple.fdoc
PACKAGE src/packages/control.fdoc
PACKAGE src/packages/py_mem.fdoc
PACKAGE src/packages/filesystem.fdoc
PACKAGE src/packages/py_pythread.fdoc
PACKAGE src/packages/rlang.fdoc
PACKAGE src/packages/core_scalar_types.fdoc
PACKAGE src/packages/lists.fdoc
PACKAGE src/packages/demux.fdoc
PACKAGE src/packages/py_descr.fdoc
PACKAGE src/packages/py_exc.fdoc
PACKAGE src/packages/py_unicode.fdoc
PACKAGE src/packages/py_function.fdoc
PACKAGE src/packages/rtl-pthread-impl.fdoc
PACKAGE src/packages/py_set.fdoc
PACKAGE src/packages/random.fdoc
PACKAGE src/packages/grammar.fdoc
PACKAGE src/packages/pointers.fdoc
PACKAGE src/packages/py_ceval.fdoc
PACKAGE src/packages/sync.fdoc
PACKAGE src/packages/filetools.fdoc
PACKAGE src/packages/concordance.fdoc
PACKAGE src/packages/py_ref.fdoc
PACKAGE src/packages/py_object.fdoc
PACKAGE src/packages/dynamic_metatyping.fdoc
PACKAGE src/packages/stdlib_toc.fdoc
PACKAGE src/packages/rtl-monitor.fdoc
PACKAGE src/packages/exceptions.fdoc
PACKAGE src/packages/py_instance.fdoc
PACKAGE src/packages/py_cobject.fdoc
PACKAGE src/packages/py_buffer.fdoc
PACKAGE src/packages/rtl-threads.fdoc
PACKAGE src/packages/unique.fdoc
PACKAGE src/packages/streams.fdoc
PACKAGE src/packages/flx_cache.fdoc
src/tools/flx_find_grammar_files.py build/release
[flx_find_grammar_files] ** Scanning build/release/share/lib
echo Felix Version 2019.01.06
Felix Version 2019.01.06
#
# ============================================================
#
# CONFIGURING FELIX
#
#   See build/release/fbuild.log for full transcript
#
# ============================================================
#
python3 fbuild/fbuild-light configure --buildroot=build
configuring build phase
determining platform     : {'linux', 'posix'}
looking for clang        : failed
looking for icc          : failed
looking for gcc          : ok /usr/bin/gcc
checking gcc             : ok
checking gcc with -fomit-frame-pointer : ok
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
looking for ar                          : ok /usr/bin/ar
looking for ranlib                      : ok /usr/bin/ranlib
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
checking if gcc can make objects        : ok
checking if gcc can make libraries      : ok
checking if gcc can make exes           : ok
checking if gcc can link lib to exe     : ok
looking for clang                       : failed
looking for icc                         : failed
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC: ok
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC -shared: ok
checking if gcc can make objects        : ok
checking if gcc can make libraries      : ok
checking if gcc can make exes           : ok
checking if gcc can link lib to exe     : ok
looking for clang++                     : failed
looking for icpc                        : failed
looking for g++                         : ok /usr/bin/g++
checking g++                            : ok
checking g++ with -fomit-frame-pointer  : ok
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
checking if g++ can make objects        : ok
checking if g++ can make libraries      : ok
checking if g++ can make exes           : ok
checking if g++ can link lib to exe     : ok
looking for clang++                     : failed
looking for icpc                        : failed
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC: ok
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC -shared: ok
checking if g++ can make objects        : ok
checking if g++ can make libraries      : ok
checking if g++ can make exes           : ok
checking if g++ can link lib to exe     : ok
configuring host phase
using build's c and cxx compiler
looking for ocamldep.opt                : ok /usr/local/bin/ocamldep.opt
looking for ocamlc.opt                  : ok /usr/local/bin/ocamlc.opt
checking ocamlc.opt version             : 5.1.0+dev1-2022-06-09
checking if ocamlc.opt can make objects : ok
checking if ocamlc.opt can make libraries: ok
checking if ocamlc.opt can make exes    : ok
checking if ocamlc.opt can link lib to exe: ok
looking for ocamlcp.opt                 : ok /usr/local/bin/ocamlcp.opt
checking ocamlcp.opt version            : 5.1.0+dev1-2022-06-09
checking if ocamlcp.opt can make objects: ok
checking if ocamlcp.opt can make libraries: ok
checking if ocamlcp.opt can make exes   : ok
checking if ocamlcp.opt can link lib to exe: ok
looking for ocamlopt.opt                : ok /usr/local/bin/ocamlopt.opt
checking ocamlopt.opt version           : 5.1.0+dev1-2022-06-09
checking if ocamlopt.opt can make objects: ok
checking if ocamlopt.opt can make libraries: ok
checking if ocamlopt.opt can make exes  : ok
checking if ocamlopt.opt can link lib to exe: ok
looking for ocamllex.opt                : ok /usr/local/bin/ocamllex.opt
looking for llvm-config                 : ok /usr/bin/llvm-config
checking llvm-config version            : 3.8.1
configuring target phase
using host's c and cxx compiler
looking for sdl-config                  : failed
checking void*                          : alignment: 8 size: 8
[fbuild] COPYING UNIVERSAL RESOURCE DATABASE
copying 25 files
cp src/config/build_flx_rtl_msvc_win.fpc -> build/release/host/config/build_flx_rtl_msvc_win.fpc
cp src/config/botan_bigint.fpc -> build/release/host/config/botan_bigint.fpc
cp src/config/build_flx_rtl_gcc_linux.fpc -> build/release/host/config/build_flx_rtl_gcc_linux.fpc
cp src/config/build_flx_rtl_clang_linux.fpc -> build/release/host/config/build_flx_rtl_clang_linux.fpc
cp src/config/botan_hash.fpc -> build/release/host/config/botan_hash.fpc
cp src/config/build_boot.fpc -> build/release/host/config/build_boot.fpc
cp src/config/timer.fpc -> build/release/host/config/timer.fpc
cp src/config/flx_executil.fpc -> build/release/host/config/flx_executil.fpc
cp src/config/build_flx_rtl_clang_macosx.fpc -> build/release/host/config/build_flx_rtl_clang_macosx.fpc
cp src/config/pthread.fpc -> build/release/host/config/pthread.fpc
cp src/config/cygwin.fpc -> build/release/host/config/cygwin.fpc
cp src/config/flx_run.fpc -> build/release/host/config/flx_run.fpc
cp src/config/build_flx_rtl_gcc_macosx.fpc -> build/release/host/config/build_flx_rtl_gcc_macosx.fpc
cp src/config/flx_thread_free_run.fpc -> build/release/host/config/flx_thread_free_run.fpc
cp src/config/demux.fpc -> build/release/host/config/demux.fpc
cp src/config/flx_spinlock.fpc -> build/release/host/config/flx_spinlock.fpc
cp src/config/build_flx_rtl_clang_iphoneos.fpc -> build/release/host/config/build_flx_rtl_clang_iphoneos.fpc
cp src/config/flx_arun.fpc -> build/release/host/config/flx_arun.fpc
cp src/config/flx_bound_queue.fpc -> build/release/host/config/flx_bound_queue.fpc
cp src/config/botan_system_rng.fpc -> build/release/host/config/botan_system_rng.fpc
cp src/config/botan_rng.fpc -> build/release/host/config/botan_rng.fpc
cp src/config/flx_i18n.fpc -> build/release/host/config/flx_i18n.fpc
cp src/config/flx_ioutil.fpc -> build/release/host/config/flx_ioutil.fpc
cp src/config/flx_rtl_core.fpc -> build/release/host/config/flx_rtl_core.fpc
cp src/config/flx_thread_free_rtl_core.fpc -> build/release/host/config/flx_thread_free_rtl_core.fpc
[fbuild] COPYING compiler/C++ version RESOURCE DATABASE
copying 4 files
cp src/config/gcc/cplusplus_11.fpc -> build/release/host/config/cplusplus_11.fpc
cp src/config/gcc/cplusplus_17.fpc -> build/release/host/config/cplusplus_17.fpc
cp src/config/gcc/cplusplus_14.fpc -> build/release/host/config/cplusplus_14.fpc
cp src/config/gcc/cplusplus_20.fpc -> build/release/host/config/cplusplus_20.fpc
[fbuild] COPYING generic unix RESOURCE DATABASE
copying 17 files
cp src/config/unix/flx_strutil.fpc -> build/release/host/config/flx_strutil.fpc
cp src/config/unix/flx_async.fpc -> build/release/host/config/flx_async.fpc
cp src/config/unix/flx_uint256_t.fpc -> build/release/host/config/flx_uint256_t.fpc
cp src/config/unix/ncurses.fpc -> build/release/host/config/ncurses.fpc
cp src/config/unix/umka.fpc -> build/release/host/config/umka.fpc
cp src/config/unix/flx_pthread.fpc -> build/release/host/config/flx_pthread.fpc
cp src/config/unix/re2.fpc -> build/release/host/config/re2.fpc
cp src/config/unix/flx_dynlink.fpc -> build/release/host/config/flx_dynlink.fpc
cp src/config/unix/rparse.fpc -> build/release/host/config/rparse.fpc
cp src/config/unix/flx_exceptions.fpc -> build/release/host/config/flx_exceptions.fpc
cp src/config/unix/demux.fpc -> build/release/host/config/demux.fpc
cp src/config/unix/sqlite3.fpc -> build/release/host/config/sqlite3.fpc
cp src/config/unix/faio.fpc -> build/release/host/config/faio.fpc
cp src/config/unix/botan.fpc -> build/release/host/config/botan.fpc
cp src/config/unix/flx.fpc -> build/release/host/config/flx.fpc
cp src/config/unix/dl.fpc -> build/release/host/config/dl.fpc
cp src/config/unix/flx_gc.fpc -> build/release/host/config/flx_gc.fpc
copying 1 files
cp src/config/unix64/judy.fpc -> build/release/host/config/judy.fpc
[fbuild] COPYING linux RESOURCE DATABASE
copying 5 files
cp src/config/linux/sdl2.fpc -> build/release/host/config/sdl2.fpc
cp src/config/linux/pthread.fpc -> build/release/host/config/pthread.fpc
cp src/config/linux/demux.fpc -> build/release/host/config/demux.fpc
cp src/config/linux/sdl2_ttf.fpc -> build/release/host/config/sdl2_ttf.fpc
cp src/config/linux/sdl2_image.fpc -> build/release/host/config/sdl2_image.fpc
[fbuild] COPYING linux64 RESOURCE DATABASE
copying 0 files
[fbuild] COPYING linux PLAT MACROS
copying 1 files
cp src/config/linux/flx.flxh -> build/release/host/lib/plat/flx.flxh
C[fbuild] OPYING linux64/gcc RTL CONFIG
copying 1 files
cp src/config/linux64/gcc/rtl/flx_rtl_config_params.hpp -> build/release/host/lib/rtl/flx_rtl_config_params.hpp
[fbuild] COPYING linux64 SOCKET CONFIG
copying 1 files
cp src/config/linux64/rtl/demux_sockety_config.hpp -> build/release/host/lib/rtl/demux_sockety_config.hpp
COPYING USER CONFIG DATA FROM /root/.felix/config
COPY FPCS to CONFIG
copying 0 files
**********************************************
SETTING TOOLCHAIN toolchain_gcc_linux
**********************************************
#
# ============================================================
#
# BOOTSTRAPPING FELIX
#
#   See build/release/fbuild.log for full transcript
#
# ============================================================
#
python3 fbuild/fbuild-light build --buildroot=build
FELIX VERSION 2019.01.06
[fbuild] RUNNING PACKAGE MANAGER
PACKAGE src/packages/py_memoryview.fdoc
PACKAGE src/packages/char.fdoc
PACKAGE src/packages/cparse.fdoc
PACKAGE src/packages/py_pystate.fdoc
PACKAGE src/packages/flx_profile.fdoc
PACKAGE src/packages/algebra.fdoc
PACKAGE src/packages/logic.fdoc
PACKAGE src/packages/py_method.fdoc
PACKAGE src/packages/gc.fdoc
PACKAGE src/packages/libstruct.fdoc
PACKAGE src/packages/faio.fdoc
PACKAGE src/packages/uint256_t.fdoc
PACKAGE src/packages/py_string.fdoc
PACKAGE src/packages/debug.fdoc
PACKAGE src/packages/int256.fdoc
PACKAGE src/packages/io.fdoc
PACKAGE src/packages/fibres.fdoc
PACKAGE src/packages/ncurses.fdoc
PACKAGE src/packages/complex.fdoc
PACKAGE src/packages/flx_web.fdoc
PACKAGE src/packages/py_list.fdoc
PACKAGE src/packages/py_pycapsule.fdoc
PACKAGE src/packages/pthreads.fdoc
PACKAGE src/packages/memory.fdoc
PACKAGE src/packages/py_pylifecycle.fdoc
PACKAGE src/packages/quaternion.fdoc
PACKAGE src/packages/stl.fdoc
PACKAGE src/packages/py_iterator.fdoc
PACKAGE src/packages/rtl-slist.fdoc
PACKAGE src/packages/time.fdoc
PACKAGE src/packages/buildtools.fdoc
PACKAGE src/packages/web.fdoc
PACKAGE src/packages/rtl-lfbag.fdoc
PACKAGE src/packages/botan.fdoc
PACKAGE src/packages/spinlock.fdoc
PACKAGE src/packages/py_module.fdoc
PACKAGE src/packages/py_type.fdoc
PACKAGE src/packages/py_mapping.fdoc
PACKAGE src/packages/py_float.fdoc
PACKAGE src/packages/async.fdoc
PACKAGE src/packages/gmp.fdoc
PACKAGE src/packages/py_sequence.fdoc
PACKAGE src/packages/parsers.fdoc
PACKAGE src/packages/py_bytes.fdoc
PACKAGE src/packages/recognisers.fdoc
PACKAGE src/packages/flx_pkgconfig.fdoc
PACKAGE src/packages/rtl.fdoc
PACKAGE src/packages/py_tuple.fdoc
PACKAGE src/packages/regex.fdoc
PACKAGE src/packages/rtl-waitablebool.fdoc
PACKAGE src/packages/py_number.fdoc
PACKAGE src/packages/py_version.fdoc
PACKAGE src/packages/arrays.fdoc
PACKAGE src/packages/judy.fdoc
PACKAGE src/packages/flx_flxg.fdoc
PACKAGE src/packages/strutil.fdoc
PACKAGE src/packages/chips.fdoc
PACKAGE src/packages/rtl-sysdlist.fdoc
PACKAGE src/packages/sdl.fdoc
PACKAGE src/packages/gsl.fdoc
PACKAGE src/packages/strings.fdoc
PACKAGE src/packages/programmer.fdoc
PACKAGE src/packages/ucstring.fdoc
PACKAGE src/packages/py_oldbuffer.fdoc
PACKAGE src/packages/sqlite3.fdoc
PACKAGE src/packages/py_weakref.fdoc
PACKAGE src/packages/python.fdoc
PACKAGE src/packages/py_long.fdoc
PACKAGE src/packages/core_type_constructors.fdoc
PACKAGE src/packages/py_bytearray.fdoc
PACKAGE src/packages/rparse.fdoc
PACKAGE src/packages/embed.fdoc
PACKAGE src/packages/flx.fdoc
PACKAGE src/packages/rtl-boundqueue.fdoc
PACKAGE src/packages/codecs.fdoc
PACKAGE src/packages/linux.fdoc
PACKAGE src/packages/umka.fdoc
PACKAGE src/packages/py_bool.fdoc
PACKAGE src/packages/reals.fdoc
PACKAGE src/packages/py_dict.fdoc
PACKAGE src/packages/rtl-conditionvariable.fdoc
PACKAGE src/packages/grammars.fdoc
PACKAGE src/packages/trees.fdoc
PACKAGE src/packages/flx_doc.fdoc
PACKAGE src/packages/py_int.fdoc
PACKAGE src/packages/driver.fdoc
PACKAGE src/packages/toolchain.fdoc
PACKAGE src/packages/svc.fdoc
PACKAGE src/packages/program.fdoc
PACKAGE src/packages/configs.fdoc
PACKAGE src/packages/py_complex.fdoc
PACKAGE src/packages/gui.fdoc
PACKAGE src/packages/serialisation.fdoc
PACKAGE src/packages/cheaders.fdoc
PACKAGE src/packages/integers.fdoc
PACKAGE src/packages/dynlink.fdoc
PACKAGE src/packages/py_slice.fdoc
PACKAGE src/packages/apple.fdoc
PACKAGE src/packages/control.fdoc
PACKAGE src/packages/py_mem.fdoc
PACKAGE src/packages/filesystem.fdoc
PACKAGE src/packages/py_pythread.fdoc
PACKAGE src/packages/rlang.fdoc
PACKAGE src/packages/core_scalar_types.fdoc
PACKAGE src/packages/lists.fdoc
PACKAGE src/packages/demux.fdoc
PACKAGE src/packages/py_descr.fdoc
PACKAGE src/packages/py_exc.fdoc
PACKAGE src/packages/py_unicode.fdoc
PACKAGE src/packages/py_function.fdoc
PACKAGE src/packages/rtl-pthread-impl.fdoc
PACKAGE src/packages/py_set.fdoc
PACKAGE src/packages/random.fdoc
PACKAGE src/packages/grammar.fdoc
PACKAGE src/packages/pointers.fdoc
PACKAGE src/packages/py_ceval.fdoc
PACKAGE src/packages/sync.fdoc
PACKAGE src/packages/filetools.fdoc
PACKAGE src/packages/concordance.fdoc
PACKAGE src/packages/py_ref.fdoc
PACKAGE src/packages/py_object.fdoc
PACKAGE src/packages/dynamic_metatyping.fdoc
PACKAGE src/packages/stdlib_toc.fdoc
PACKAGE src/packages/rtl-monitor.fdoc
PACKAGE src/packages/exceptions.fdoc
PACKAGE src/packages/py_instance.fdoc
PACKAGE src/packages/py_cobject.fdoc
PACKAGE src/packages/py_buffer.fdoc
PACKAGE src/packages/rtl-threads.fdoc
PACKAGE src/packages/unique.fdoc
PACKAGE src/packages/streams.fdoc
PACKAGE src/packages/flx_cache.fdoc
[fbuild] CONFIGURING FELIX
[fbuild] [ocaml] COMPILING COMPILER
 * ocamldep.opt          : src/compiler/ocs/src/ocs_wrap.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_error.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_types.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_port.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_port.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_vartable.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_vartable.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_string.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_char.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_numaux.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_numaux.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_prim.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_compile.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_compile.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_env.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_sym.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_sym.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_env.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_misc.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_misc.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_eval.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_eval.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_print.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_print.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_char.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_numstr.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_numstr.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_num.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_num.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_complex.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_complex.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_io.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_io.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_read.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_lex.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_lex.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_read.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_macro.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_macro.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_prim.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_top.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_vector.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_string.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_contin.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_contin.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_top.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_list.mli
 * ocamldep.opt          : src/compiler/ocs/src/ocs_list.ml
 * ocamldep.opt          : src/compiler/ocs/src/ocs_vector.ml
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_vartable.mli -> build/release/src/compiler/ocs/src/ocs_vartable.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_error.ml -> build/release/src/compiler/ocs/src/ocs_error.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_vartable.ml -> build/release/src/compiler/ocs/src/ocs_vartable.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_complex.mli -> build/release/src/compiler/ocs/src/ocs_complex.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_port.mli -> build/release/src/compiler/ocs/src/ocs_port.cmi
File "_none_", line 1:
Alert ocaml_deprecated_auto_include:
OCaml's lib directory layout changed in 5.0. The unix subdirectory has been
automatically added to the search path, but you should add -I +unix to the
command-line to silence this alert (e.g. by adding unix to the list of
libraries in your dune file, or adding use_unix to your _tags file for
ocamlbuild, or using -package unix for ocamlfind).
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_complex.ml -> build/release/src/compiler/ocs/src/ocs_complex.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_port.ml -> build/release/src/compiler/ocs/src/ocs_port.cmx
File "_none_", line 1:
Alert ocaml_deprecated_auto_include:
OCaml's lib directory layout changed in 5.0. The unix subdirectory has been
automatically added to the search path, but you should add -I +unix to the
command-line to silence this alert (e.g. by adding unix to the list of
libraries in your dune file, or adding use_unix to your _tags file for
ocamlbuild, or using -package unix for ocamlfind).
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_types.mli -> build/release/src/compiler/ocs/src/ocs_types.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_num.mli -> build/release/src/compiler/ocs/src/ocs_num.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_numstr.mli -> build/release/src/compiler/ocs/src/ocs_numstr.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_compile.mli -> build/release/src/compiler/ocs/src/ocs_compile.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_sym.mli -> build/release/src/compiler/ocs/src/ocs_sym.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_eval.mli -> build/release/src/compiler/ocs/src/ocs_eval.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_sym.ml -> build/release/src/compiler/ocs/src/ocs_sym.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_numaux.mli -> build/release/src/compiler/ocs/src/ocs_numaux.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_env.mli -> build/release/src/compiler/ocs/src/ocs_env.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_numaux.ml -> build/release/src/compiler/ocs/src/ocs_numaux.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_env.ml -> build/release/src/compiler/ocs/src/ocs_env.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_vector.mli -> build/release/src/compiler/ocs/src/ocs_vector.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_num.ml -> build/release/src/compiler/ocs/src/ocs_num.cmx
File "build/release/src/compiler/ocs/src/ocs_num.ml", line 11, characters 4-17:
11 |     (Sint i) as s -> Sint (- i)
         ^^^^^^^^^^^^^
Warning 26 [unused-var]: unused variable s.
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_vector.ml -> build/release/src/compiler/ocs/src/ocs_vector.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_numstr.ml -> build/release/src/compiler/ocs/src/ocs_numstr.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_char.mli -> build/release/src/compiler/ocs/src/ocs_char.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_macro.mli -> build/release/src/compiler/ocs/src/ocs_macro.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_char.ml -> build/release/src/compiler/ocs/src/ocs_char.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_prim.mli -> build/release/src/compiler/ocs/src/ocs_prim.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_print.mli -> build/release/src/compiler/ocs/src/ocs_print.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_list.mli -> build/release/src/compiler/ocs/src/ocs_list.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_print.ml -> build/release/src/compiler/ocs/src/ocs_print.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_lex.mli -> build/release/src/compiler/ocs/src/ocs_lex.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_wrap.ml -> build/release/src/compiler/ocs/src/ocs_wrap.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_lex.ml -> build/release/src/compiler/ocs/src/ocs_lex.cmx
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_contin.mli -> build/release/src/compiler/ocs/src/ocs_contin.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_read.mli -> build/release/src/compiler/ocs/src/ocs_read.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_io.mli -> build/release/src/compiler/ocs/src/ocs_io.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_top.mli -> build/release/src/compiler/ocs/src/ocs_top.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_misc.mli -> build/release/src/compiler/ocs/src/ocs_misc.cmi
 * ocamlc.opt            : build/release/src/compiler/ocs/src/ocs_string.mli -> build/release/src/compiler/ocs/src/ocs_string.cmi
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_misc.ml -> build/release/src/compiler/ocs/src/ocs_misc.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_string.ml -> build/release/src/compiler/ocs/src/ocs_string.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_eval.ml -> build/release/src/compiler/ocs/src/ocs_eval.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_list.ml -> build/release/src/compiler/ocs/src/ocs_list.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_contin.ml -> build/release/src/compiler/ocs/src/ocs_contin.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_read.ml -> build/release/src/compiler/ocs/src/ocs_read.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_compile.ml -> build/release/src/compiler/ocs/src/ocs_compile.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_io.ml -> build/release/src/compiler/ocs/src/ocs_io.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_macro.ml -> build/release/src/compiler/ocs/src/ocs_macro.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_prim.ml -> build/release/src/compiler/ocs/src/ocs_prim.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_top.ml -> build/release/src/compiler/ocs/src/ocs_top.cmx
 * ocamlopt.opt          : build/release/src/compiler/ocs/src/ocs_error.cmx build/release/src/compiler/ocs/src/ocs_port.cmx build/release/src/compiler/ocs/src/ocs_vartable.cmx build/release/src/compiler/ocs/src/ocs_wrap.cmx build/release/src/compiler/ocs/src/ocs_numaux.cmx build/release/src/compiler/ocs/src/ocs_sym.cmx build/release/src/compiler/ocs/src/ocs_env.cmx build/release/src/compiler/ocs/src/ocs_misc.cmx build/release/src/compiler/ocs/src/ocs_compile.cmx build/release/src/compiler/ocs/src/ocs_char.cmx build/release/src/compiler/ocs/src/ocs_complex.cmx build/release/src/compiler/ocs/src/ocs_num.cmx build/release/src/compiler/ocs/src/ocs_numstr.cmx build/release/src/compiler/ocs/src/ocs_print.cmx build/release/src/compiler/ocs/src/ocs_eval.cmx build/release/src/compiler/ocs/src/ocs_lex.cmx build/release/src/compiler/ocs/src/ocs_read.cmx build/release/src/compiler/ocs/src/ocs_io.cmx build/release/src/compiler/ocs/src/ocs_macro.cmx build/release/src/compiler/ocs/src/ocs_prim.cmx build/release/src/compiler/ocs/src/ocs_string.cmx build/release/src/compiler/ocs/src/ocs_contin.cmx build/release/src/compiler/ocs/src/ocs_list.cmx build/release/src/compiler/ocs/src/ocs_vector.cmx build/release/src/compiler/ocs/src/ocs_top.cmx -> build/release/src/compiler/ocs/src/ocs.cmxa
 * ocamllex.opt          : src/compiler/dypgen/dypgen/dypgen_lexer.mll -> build/release/src/compiler/dypgen/dypgen/dypgen_lexer.ml
195 states, 1556 transitions, table size 7394 bytes
2280 additional bytes used for bindings
 * ocamllex.opt          : src/compiler/dypgen/dypgen/extract_type.mll -> build/release/src/compiler/dypgen/dypgen/extract_type.ml
360 states, 11307 transitions, table size 47388 bytes
22672 additional bytes used for bindings
 * ocamllex.opt          : src/compiler/dypgen/dypgen/insert_linenum.mll -> build/release/src/compiler/dypgen/dypgen/insert_linenum.ml
6 states, 259 transitions, table size 1072 bytes
 * ocamldep.opt          : src/compiler/dypgen/dyplib/dyp.mli
 * ocamldep.opt          : src/compiler/dypgen/dyplib/automaton.ml
 * ocamldep.opt          : src/compiler/dypgen/dyplib/priority_by_relation.ml
 * ocamldep.opt          : src/compiler/dypgen/dyplib/dyplex.ml
 * ocamldep.opt          : src/compiler/dypgen/dyplib/dyp.ml
 * ocamlc.opt            : build/release/src/compiler/dypgen/dyplib/dyp.mli -> build/release/src/compiler/dypgen/dyplib/dyp.cmi
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dyplib/priority_by_relation.ml -> build/release/src/compiler/dypgen/dyplib/priority_by_relation.cmx
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dyplib/automaton.ml -> build/release/src/compiler/dypgen/dyplib/automaton.cmx
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dyplib/dyplex.ml -> build/release/src/compiler/dypgen/dyplib/dyplex.cmx
File "build/release/src/compiler/dypgen/dyplib/dyplex.ml", line 598, characters 29-52:
598 |         with Invalid_argument("index out of bounds")
                                   ^^^^^^^^^^^^^^^^^^^^^^^
Warning 52 [fragile-literal-pattern]: 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 11.5)
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dyplib/dyp.ml -> build/release/src/compiler/dypgen/dyplib/dyp.cmx
File "build/release/src/compiler/dypgen/dyplib/dyp.ml", line 5067, characters 19-40:
5067 |       with Failure "lexing: empty token" ->
                          ^^^^^^^^^^^^^^^^^^^^^
Warning 52 [fragile-literal-pattern]: 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 11.5)
File "build/release/src/compiler/dypgen/dyplib/dyp.ml", line 5085, characters 29-43:
5085 |         with Invalid_argument("String.sub") ->
                                    ^^^^^^^^^^^^^^
Warning 52 [fragile-literal-pattern]: 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 11.5)
File "build/release/src/compiler/dypgen/dyplib/dyp.ml", line 5095, characters 29-43:
5095 |         with Invalid_argument("String.sub") ->
                                    ^^^^^^^^^^^^^^
Warning 52 [fragile-literal-pattern]: 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 11.5)
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dyplib/priority_by_relation.cmx build/release/src/compiler/dypgen/dyplib/automaton.cmx build/release/src/compiler/dypgen/dyplib/dyplex.cmx build/release/src/compiler/dypgen/dyplib/dyp.cmx -> build/release/src/compiler/dypgen/dyplib/dyp.cmxa
 * ocamldep.opt          : src/compiler/dypgen/dypgen/dypgen_parser.mli
 * ocamldep.opt          : build/release/src/compiler/dypgen/dyplib/dyp.mli
 * ocamldep.opt          : build/release/src/compiler/dypgen/dyplib/dyp.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dyplib/dyplex.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dyplib/automaton.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dyplib/priority_by_relation.ml
 * ocamldep.opt          : src/compiler/dypgen/dypgen/parse_tree.mli
 * ocamldep.opt          : src/compiler/dypgen/dypgen/argument.ml
 * ocamldep.opt          : src/compiler/dypgen/dypgen/dypgen_parser.ml
 * ocamldep.opt          : src/compiler/dypgen/dypgen/dypgen.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/dypgen_lexer.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/extract_type.ml
 + /usr/local/bin/ocamldep.opt -modules build/release/src/compiler/dypgen/dypgen/extract_type.ml
File "src/compiler/dypgen/dypgen/extract_type.mll", line 129, characters 6-29:
Error: Syntax error: strings are immutable, there is no assignment syntax for them.
Hint: Mutable sequences of bytes are available in the Bytes module.
Hint: Did you mean to use 'Bytes.set'?
Error running '/usr/local/bin/ocamldep.opt -modules build/release/src/compiler/dypgen/dypgen/extract_type.ml' exited with 2
GNUmakefile:119: recipe for target 'do-fbuild' failed
make: *** [do-fbuild] Error 1

Environment:

# ocaml --version
The OCaml toplevel, version 5.1.0+dev1-2022-06-09
# uname -a; cat /etc/issue
Linux nas 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux
Debian GNU/Linux 9 \n \l
@skaller
Copy link
Member

skaller commented Sep 3, 2022

Oh dear. Ocaml messes it up again. I'm using this:

The OCaml toplevel, version 4.13.0+dev0-2020-10-19

You have a hyper new version 5.x Ocaml which has changed things I have not noticed because I'm running and older version. BTW yes opam doesn't seem to work for me either.

The compiler is complaining about this:

    if s = Bytes.of_string oldtp then
      (let s = Bytes.of_string ("'"^newtp^" ") in
      let len2 = Bytes.length s in
      s.[len2-1] <- r.[len-1];
      Buffer.add_bytes string_buf s)

on the second last line. It's complaint is very strange. The symbol s there actually IS of type Bytes.t. However I cannot find at the moment the syntax shown in the module definition online. Obviously it USED to work.

This can be fixed by just using the set function instead. However the file is not editable because it is generated.

I cannot fix this without building Ocaml version 5.x because I need to reproduce the error and then see if I can fix it. The problem has to be fixed in the lexer generator program to generate a valid Ocaml 5.1 lexer.

The other issue, the alert on module Unix is unrelated and the advice given is rubbish since Felix is not using any of that stuff: it builds using the compiler directly. No dune, ocamlfind, or any other crap. This is a pain, because if I adjust the build script to work for Ocaml 5 it won't work for Ocaml 4. Grr.

OK .. Ill try to get Ocaml 5 now.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

The github website says this:

"Owing to the large number of changes, the initial 5.0 release will be more experimental than usual. It is recommended that all users wanting a stable release use the 4.14 release which will continue to be supported and updated while 5.0 reaches feature and stability parity. Similarly, if you need one of the ports not yet supported in the 5.0 release you must use the 4.14 release."

You have 5.1 which is already more advanced than these comments suggest. Wonder where you got it? Did you build from the github repo?

@skaller
Copy link
Member

skaller commented Sep 3, 2022

OOps .. wrong that file is editable ...

skaller added a commit that referenced this issue Sep 3, 2022
@skaller
Copy link
Member

skaller commented Sep 3, 2022

OK tried a fix .. works with Ocaml 4.x. Used "set" function instead of assignment syntax.

@Sod-Almighty
Copy link
Author

skaller added a commit

Thank you. So.....I should re-download this repo and try it again?

BTW yes opam doesn't seem to work for me either.

I reported an issue to the opam repo, and suggested they update their instructions. I got yelled at and the ticket was closed for "being offensive". I hadn't been rude. I've noticed a lot of open source maintainers are like that: any criticism whatsoever is considered offensive, and the ticket is closed.

You have 5.1 which is already more advanced than these comments suggest. Wonder where you got it? Did you build from the github repo?

Yes. I had to. Bloody opam doesn't work. What other option is there, other than to build it by hand?

Believe me, I would much rather just download a release and install it. But Felix hasn't released since 2019, and OCaml doesn't appear to have any options other than opam - which doesn't work.

@Sod-Almighty
Copy link
Author

Btw, your website is down. Just FYI.

@Sod-Almighty
Copy link
Author

Sod-Almighty commented Sep 3, 2022

I'm afraid it still will not compile:

 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/dypgen_lexer.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/extract_type.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/insert_linenum.ml
 * ocamlc.opt            : build/release/src/compiler/dypgen/dypgen/parse_tree.mli -> build/release/src/compiler/dypgen/dypgen/parse_tree.cmi
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dypgen/extract_type.ml -> build/release/src/compiler/dypgen/dypgen/extract_type.cmx
 + /usr/local/bin/ocamlopt.opt -c -I build/release/src/compiler/dypgen/dypgen -I build/release/src/compiler/dypgen/dyplib -I src/compiler/dypgen/dypgen -I src/compiler/dypgen/dyplib -o build/release/src/compiler/dypgen/dypgen/extract_type.cmx build/release/src/compiler/dypgen/dypgen/extract_type.ml
File "src/compiler/dypgen/dypgen/extract_type.mll", line 170, characters 4-15:
Error: Unbound value String.fill
Error running '/usr/local/bin/ocamlopt.opt -c -I build/release/src/compiler/dypgen/dypgen -I build/release/src/compiler/dypgen/dyplib -I src/compiler/dypgen/dypgen -I src/compiler/dypgen/dyplib -o build/release/src/compiler/dypgen/dypgen/extract_type.cmx build/release/src/compiler/dypgen/dypgen/extract_type.ml' exited with 2
 * ocamlc.opt            : build/release/src/compiler/dypgen/dypgen/dypgen_parser.mli -> build/release/src/compiler/dypgen/dypgen/dypgen_parser.cmi
GNUmakefile:119: recipe for target 'do-fbuild' failed
make: *** [do-fbuild] Error 1

@skaller
Copy link
Member

skaller commented Sep 3, 2022

I know the website is down. The owner is uncontactable. I need another server but i cannot afford to rent one. It has to be a raw machine preferably running some kind of Unix because I'm using flx_web, a web server written in Felix that automatically displays felix packages you can see in src/packages of the repo, and automatically hyperlinks Felix and C++.

Ok I fixed that next bug I think (the patch compiles on Ocaml 4 at least).

@skaller
Copy link
Member

skaller commented Sep 3, 2022

FYI: there are lots of options other than opam. For example with Debian you can apt-get ocaml-nox. You can also build the 4.14 branch of the repo. I personally had so much trouble with opam I just build from source myself. My build is actually from the trunk, but it's old I guess.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

Opam should work. I'm on MacOS and it used to be fine. However when I try to get other packages it refuses and thats actually the packages being out of date and not building, rather than opam failing. The problem with Ocaml is the core developers are really only interested in the type system not industrial strength tooling, and they're idiot copy-left anti-microsoft and refuse to support Windows. So if you have trouble on a Linux platforms .. OMG don't try to build it on Windows. Felix itself works fine on Windows once Ocaml is built and you can actually build the compiler but, even though i have a Windows box, I cannot maintain the Windows binding because my stupid iPhone I used for internet won't accept a wifi connection from it.

I can rewrite most of the compiler in Felix or even (ARGGGGHHHH in C++) but not the parser. Dypgen is the best parser ever written, but it's not maintained. Felix relies on its ability to dynamically update itself on the fly.

@Sod-Almighty
Copy link
Author

Compilation still fails:

 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/dypgen_lexer.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/extract_type.ml
 * ocamldep.opt          : build/release/src/compiler/dypgen/dypgen/insert_linenum.ml
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dypgen/extract_type.ml -> build/release/src/compiler/dypgen/dypgen/extract_type.cmx
 * ocamlc.opt            : build/release/src/compiler/dypgen/dypgen/parse_tree.mli -> build/release/src/compiler/dypgen/dypgen/parse_tree.cmi
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dypgen/insert_linenum.ml -> build/release/src/compiler/dypgen/dypgen/insert_linenum.cmx
 * ocamlc.opt            : build/release/src/compiler/dypgen/dypgen/dypgen_parser.mli -> build/release/src/compiler/dypgen/dypgen/dypgen_parser.cmi
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dypgen/argument.ml -> build/release/src/compiler/dypgen/dypgen/argument.cmx
 * ocamlopt.opt          : build/release/src/compiler/dypgen/dypgen/dypgen_parser.ml -> build/release/src/compiler/dypgen/dypgen/dypgen_parser.cmx
 + /usr/local/bin/ocamlopt.opt -c -I build/release/src/compiler/dypgen/dypgen -I build/release/src/compiler/dypgen/dyplib -I src/compiler/dypgen/dypgen -I src/compiler/dypgen/dyplib -o build/release/src/compiler/dypgen/dypgen/dypgen_parser.cmx build/release/src/compiler/dypgen/dypgen/dypgen_parser.ml
File "dypgen_parser.dyp", line 24, characters 16-34:
Error: Unbound module Pervasives
Error running '/usr/local/bin/ocamlopt.opt -c -I build/release/src/compiler/dypgen/dypgen -I build/release/src/compiler/dypgen/dyplib -I src/compiler/dypgen/dypgen -I src/compiler/dypgen/dyplib -o build/release/src/compiler/dypgen/dypgen/dypgen_parser.cmx build/release/src/compiler/dypgen/dypgen/dypgen_parser.ml' exited with 2
GNUmakefile:119: recipe for target 'do-fbuild' failed
make: *** [do-fbuild] Error 1

I also tried using ocaml-nox and building with that. This also failed:

# ocaml -version
The OCaml toplevel, version 4.02.3

# make
# =========================================================
# generates source code from "src/packages" to various places
# around the repo
# =========================================================
python3 src/tools/flx_iscr.py -q -d "src/packages" build/release
PACKAGE src/packages/py_memoryview.fdoc
PACKAGE src/packages/char.fdoc
PACKAGE src/packages/cparse.fdoc
PACKAGE src/packages/py_pystate.fdoc
PACKAGE src/packages/flx_profile.fdoc
PACKAGE src/packages/algebra.fdoc
PACKAGE src/packages/logic.fdoc
PACKAGE src/packages/py_method.fdoc
PACKAGE src/packages/gc.fdoc
PACKAGE src/packages/libstruct.fdoc
PACKAGE src/packages/faio.fdoc
PACKAGE src/packages/uint256_t.fdoc
PACKAGE src/packages/py_string.fdoc
PACKAGE src/packages/debug.fdoc
PACKAGE src/packages/int256.fdoc
PACKAGE src/packages/io.fdoc
PACKAGE src/packages/fibres.fdoc
PACKAGE src/packages/ncurses.fdoc
PACKAGE src/packages/complex.fdoc
PACKAGE src/packages/flx_web.fdoc
PACKAGE src/packages/py_list.fdoc
PACKAGE src/packages/py_pycapsule.fdoc
PACKAGE src/packages/pthreads.fdoc
PACKAGE src/packages/memory.fdoc
PACKAGE src/packages/py_pylifecycle.fdoc
PACKAGE src/packages/quaternion.fdoc
PACKAGE src/packages/stl.fdoc
PACKAGE src/packages/py_iterator.fdoc
PACKAGE src/packages/rtl-slist.fdoc
PACKAGE src/packages/time.fdoc
PACKAGE src/packages/buildtools.fdoc
PACKAGE src/packages/web.fdoc
PACKAGE src/packages/rtl-lfbag.fdoc
PACKAGE src/packages/botan.fdoc
PACKAGE src/packages/spinlock.fdoc
PACKAGE src/packages/py_module.fdoc
PACKAGE src/packages/py_type.fdoc
PACKAGE src/packages/py_mapping.fdoc
PACKAGE src/packages/py_float.fdoc
PACKAGE src/packages/async.fdoc
PACKAGE src/packages/gmp.fdoc
PACKAGE src/packages/py_sequence.fdoc
PACKAGE src/packages/parsers.fdoc
PACKAGE src/packages/py_bytes.fdoc
PACKAGE src/packages/recognisers.fdoc
PACKAGE src/packages/flx_pkgconfig.fdoc
PACKAGE src/packages/rtl.fdoc
PACKAGE src/packages/py_tuple.fdoc
PACKAGE src/packages/regex.fdoc
PACKAGE src/packages/rtl-waitablebool.fdoc
PACKAGE src/packages/py_number.fdoc
PACKAGE src/packages/py_version.fdoc
PACKAGE src/packages/arrays.fdoc
PACKAGE src/packages/judy.fdoc
PACKAGE src/packages/flx_flxg.fdoc
PACKAGE src/packages/strutil.fdoc
PACKAGE src/packages/chips.fdoc
PACKAGE src/packages/rtl-sysdlist.fdoc
PACKAGE src/packages/sdl.fdoc
PACKAGE src/packages/gsl.fdoc
PACKAGE src/packages/strings.fdoc
PACKAGE src/packages/programmer.fdoc
PACKAGE src/packages/ucstring.fdoc
PACKAGE src/packages/py_oldbuffer.fdoc
PACKAGE src/packages/sqlite3.fdoc
PACKAGE src/packages/py_weakref.fdoc
PACKAGE src/packages/python.fdoc
PACKAGE src/packages/py_long.fdoc
PACKAGE src/packages/core_type_constructors.fdoc
PACKAGE src/packages/py_bytearray.fdoc
PACKAGE src/packages/rparse.fdoc
PACKAGE src/packages/embed.fdoc
PACKAGE src/packages/flx.fdoc
PACKAGE src/packages/rtl-boundqueue.fdoc
PACKAGE src/packages/codecs.fdoc
PACKAGE src/packages/linux.fdoc
PACKAGE src/packages/umka.fdoc
PACKAGE src/packages/py_bool.fdoc
PACKAGE src/packages/reals.fdoc
PACKAGE src/packages/py_dict.fdoc
PACKAGE src/packages/rtl-conditionvariable.fdoc
PACKAGE src/packages/grammars.fdoc
PACKAGE src/packages/trees.fdoc
PACKAGE src/packages/flx_doc.fdoc
PACKAGE src/packages/py_int.fdoc
PACKAGE src/packages/driver.fdoc
PACKAGE src/packages/toolchain.fdoc
PACKAGE src/packages/svc.fdoc
PACKAGE src/packages/program.fdoc
PACKAGE src/packages/configs.fdoc
PACKAGE src/packages/py_complex.fdoc
PACKAGE src/packages/gui.fdoc
PACKAGE src/packages/serialisation.fdoc
PACKAGE src/packages/cheaders.fdoc
PACKAGE src/packages/integers.fdoc
PACKAGE src/packages/dynlink.fdoc
PACKAGE src/packages/py_slice.fdoc
PACKAGE src/packages/apple.fdoc
PACKAGE src/packages/control.fdoc
PACKAGE src/packages/py_mem.fdoc
PACKAGE src/packages/filesystem.fdoc
PACKAGE src/packages/py_pythread.fdoc
PACKAGE src/packages/rlang.fdoc
PACKAGE src/packages/core_scalar_types.fdoc
PACKAGE src/packages/lists.fdoc
PACKAGE src/packages/demux.fdoc
PACKAGE src/packages/py_descr.fdoc
PACKAGE src/packages/py_exc.fdoc
PACKAGE src/packages/py_unicode.fdoc
PACKAGE src/packages/py_function.fdoc
PACKAGE src/packages/rtl-pthread-impl.fdoc
PACKAGE src/packages/py_set.fdoc
PACKAGE src/packages/random.fdoc
PACKAGE src/packages/grammar.fdoc
PACKAGE src/packages/pointers.fdoc
PACKAGE src/packages/py_ceval.fdoc
PACKAGE src/packages/sync.fdoc
PACKAGE src/packages/filetools.fdoc
PACKAGE src/packages/concordance.fdoc
PACKAGE src/packages/py_ref.fdoc
PACKAGE src/packages/py_object.fdoc
PACKAGE src/packages/dynamic_metatyping.fdoc
PACKAGE src/packages/stdlib_toc.fdoc
PACKAGE src/packages/rtl-monitor.fdoc
PACKAGE src/packages/exceptions.fdoc
PACKAGE src/packages/py_instance.fdoc
PACKAGE src/packages/py_cobject.fdoc
PACKAGE src/packages/py_buffer.fdoc
PACKAGE src/packages/rtl-threads.fdoc
PACKAGE src/packages/unique.fdoc
PACKAGE src/packages/streams.fdoc
PACKAGE src/packages/flx_cache.fdoc
src/tools/flx_find_grammar_files.py build/release
[flx_find_grammar_files] ** Scanning build/release/share/lib
echo Felix Version 2019.01.06
Felix Version 2019.01.06
#
# ============================================================
#
# CONFIGURING FELIX
#
#   See build/release/fbuild.log for full transcript
#
# ============================================================
#
python3 fbuild/fbuild-light configure --buildroot=build
configuring build phase
determining platform     : {'linux', 'posix'}
looking for clang        : failed
looking for icc          : failed
looking for gcc          : ok /usr/bin/gcc
checking gcc             : ok
checking gcc with -fomit-frame-pointer : ok
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
looking for ar                          : ok /usr/bin/ar
looking for ranlib                      : ok /usr/bin/ranlib
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
checking if gcc can make objects        : ok
checking if gcc can make libraries      : ok
checking if gcc can make exes           : ok
checking if gcc can link lib to exe     : ok
looking for clang                       : failed
looking for icc                         : failed
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC: ok
checking gcc with -std=gnu89 -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC -shared: ok
checking if gcc can make objects        : ok
checking if gcc can make libraries      : ok
checking if gcc can make exes           : ok
checking if gcc can link lib to exe     : ok
looking for clang++                     : failed
looking for icpc                        : failed
looking for g++                         : ok /usr/bin/g++
checking g++                            : ok
checking g++ with -fomit-frame-pointer  : ok
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing: ok
checking if g++ can make objects        : ok
checking if g++ can make libraries      : ok
checking if g++ can make exes           : ok
checking if g++ can link lib to exe     : ok
looking for clang++                     : failed
looking for icpc                        : failed
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC: ok
checking g++ with -std=c++14 -D_POSIX -w -fno-common -fvisibility=hidden -fno-strict-aliasing -fPIC -shared: ok
checking if g++ can make objects        : ok
checking if g++ can make libraries      : ok
checking if g++ can make exes           : ok
checking if g++ can link lib to exe     : ok
configuring host phase
using build's c and cxx compiler
looking for ocamldep.opt                : failed
looking for ocamldep                    : ok /usr/bin/ocamldep
looking for ocamlc.opt                  : failed
looking for ocamlc                      : ok /usr/bin/ocamlc
checking ocamlc version                 : 4.02.3
checking if ocamlc can make objects     : ok
checking if ocamlc can make libraries   : ok
checking if ocamlc can make exes        : ok
checking if ocamlc can link lib to exe  : ok
looking for ocamlcp.opt                 : failed
looking for ocamlcp                     : ok /usr/bin/ocamlcp
checking ocamlcp version                : 4.02.3
checking if ocamlcp can make objects    : ok
checking if ocamlcp can make libraries  : ok
checking if ocamlcp can make exes       : ok
checking if ocamlcp can link lib to exe : ok
looking for ocamlopt.opt                : failed
looking for ocamlopt                    : ok /usr/bin/ocamlopt
checking ocamlopt version               : 4.02.3
checking if ocamlopt can make objects   : ok
checking if ocamlopt can make libraries : ok
checking if ocamlopt can make exes      : ok
checking if ocamlopt can link lib to exe: ok
looking for ocamllex.opt                : failed
looking for ocamllex                    : ok /usr/bin/ocamllex
looking for llvm-config                 : ok /usr/bin/llvm-config
checking llvm-config version            : 3.8.1
configuring target phase
using host's c and cxx compiler
looking for sdl-config                  : failed
checking void*                          : alignment: 8 size: 8
[fbuild] COPYING UNIVERSAL RESOURCE DATABASE
copying 25 files
cp src/config/build_flx_rtl_msvc_win.fpc -> build/release/host/config/build_flx_rtl_msvc_win.fpc
cp src/config/botan_bigint.fpc -> build/release/host/config/botan_bigint.fpc
cp src/config/build_flx_rtl_gcc_linux.fpc -> build/release/host/config/build_flx_rtl_gcc_linux.fpc
cp src/config/build_flx_rtl_clang_linux.fpc -> build/release/host/config/build_flx_rtl_clang_linux.fpc
cp src/config/botan_hash.fpc -> build/release/host/config/botan_hash.fpc
cp src/config/build_boot.fpc -> build/release/host/config/build_boot.fpc
cp src/config/timer.fpc -> build/release/host/config/timer.fpc
cp src/config/flx_executil.fpc -> build/release/host/config/flx_executil.fpc
cp src/config/build_flx_rtl_clang_macosx.fpc -> build/release/host/config/build_flx_rtl_clang_macosx.fpc
cp src/config/pthread.fpc -> build/release/host/config/pthread.fpc
cp src/config/cygwin.fpc -> build/release/host/config/cygwin.fpc
cp src/config/flx_run.fpc -> build/release/host/config/flx_run.fpc
cp src/config/build_flx_rtl_gcc_macosx.fpc -> build/release/host/config/build_flx_rtl_gcc_macosx.fpc
cp src/config/flx_thread_free_run.fpc -> build/release/host/config/flx_thread_free_run.fpc
cp src/config/demux.fpc -> build/release/host/config/demux.fpc
cp src/config/flx_spinlock.fpc -> build/release/host/config/flx_spinlock.fpc
cp src/config/build_flx_rtl_clang_iphoneos.fpc -> build/release/host/config/build_flx_rtl_clang_iphoneos.fpc
cp src/config/flx_arun.fpc -> build/release/host/config/flx_arun.fpc
cp src/config/flx_bound_queue.fpc -> build/release/host/config/flx_bound_queue.fpc
cp src/config/botan_system_rng.fpc -> build/release/host/config/botan_system_rng.fpc
cp src/config/botan_rng.fpc -> build/release/host/config/botan_rng.fpc
cp src/config/flx_i18n.fpc -> build/release/host/config/flx_i18n.fpc
cp src/config/flx_ioutil.fpc -> build/release/host/config/flx_ioutil.fpc
cp src/config/flx_rtl_core.fpc -> build/release/host/config/flx_rtl_core.fpc
cp src/config/flx_thread_free_rtl_core.fpc -> build/release/host/config/flx_thread_free_rtl_core.fpc
[fbuild] COPYING compiler/C++ version RESOURCE DATABASE
copying 4 files
cp src/config/gcc/cplusplus_11.fpc -> build/release/host/config/cplusplus_11.fpc
cp src/config/gcc/cplusplus_17.fpc -> build/release/host/config/cplusplus_17.fpc
cp src/config/gcc/cplusplus_14.fpc -> build/release/host/config/cplusplus_14.fpc
cp src/config/gcc/cplusplus_20.fpc -> build/release/host/config/cplusplus_20.fpc
[fbuild] COPYING generic unix RESOURCE DATABASE
copying 17 files
cp src/config/unix/flx_strutil.fpc -> build/release/host/config/flx_strutil.fpc
cp src/config/unix/flx_async.fpc -> build/release/host/config/flx_async.fpc
cp src/config/unix/flx_uint256_t.fpc -> build/release/host/config/flx_uint256_t.fpc
cp src/config/unix/ncurses.fpc -> build/release/host/config/ncurses.fpc
cp src/config/unix/umka.fpc -> build/release/host/config/umka.fpc
cp src/config/unix/flx_pthread.fpc -> build/release/host/config/flx_pthread.fpc
cp src/config/unix/re2.fpc -> build/release/host/config/re2.fpc
cp src/config/unix/flx_dynlink.fpc -> build/release/host/config/flx_dynlink.fpc
cp src/config/unix/rparse.fpc -> build/release/host/config/rparse.fpc
cp src/config/unix/flx_exceptions.fpc -> build/release/host/config/flx_exceptions.fpc
cp src/config/unix/demux.fpc -> build/release/host/config/demux.fpc
cp src/config/unix/sqlite3.fpc -> build/release/host/config/sqlite3.fpc
cp src/config/unix/faio.fpc -> build/release/host/config/faio.fpc
cp src/config/unix/botan.fpc -> build/release/host/config/botan.fpc
cp src/config/unix/flx.fpc -> build/release/host/config/flx.fpc
cp src/config/unix/dl.fpc -> build/release/host/config/dl.fpc
cp src/config/unix/flx_gc.fpc -> build/release/host/config/flx_gc.fpc
copying 1 files
cp src/config/unix64/judy.fpc -> build/release/host/config/judy.fpc
[fbuild] COPYING linux RESOURCE DATABASE
copying 5 files
cp src/config/linux/sdl2.fpc -> build/release/host/config/sdl2.fpc
cp src/config/linux/pthread.fpc -> build/release/host/config/pthread.fpc
cp src/config/linux/demux.fpc -> build/release/host/config/demux.fpc
cp src/config/linux/sdl2_ttf.fpc -> build/release/host/config/sdl2_ttf.fpc
cp src/config/linux/sdl2_image.fpc -> build/release/host/config/sdl2_image.fpc
[fbuild] COPYING linux64 RESOURCE DATABASE
copying 0 files
[fbuild] COPYING linux PLAT MACROS
copying 1 files
cp src/config/linux/flx.flxh -> build/release/host/lib/plat/flx.flxh
C[fbuild] OPYING linux64/gcc RTL CONFIG
copying 1 files
cp src/config/linux64/gcc/rtl/flx_rtl_config_params.hpp -> build/release/host/lib/rtl/flx_rtl_config_params.hpp
[fbuild] COPYING linux64 SOCKET CONFIG
copying 1 files
cp src/config/linux64/rtl/demux_sockety_config.hpp -> build/release/host/lib/rtl/demux_sockety_config.hpp
COPYING USER CONFIG DATA FROM /root/.felix/config
COPY FPCS to CONFIG
copying 0 files
**********************************************
SETTING TOOLCHAIN toolchain_gcc_linux
**********************************************
#
# ============================================================
#
# BOOTSTRAPPING FELIX
#
#   See build/release/fbuild.log for full transcript
#
# ============================================================
#
python3 fbuild/fbuild-light build --buildroot=build
FELIX VERSION 2019.01.06
[fbuild] RUNNING PACKAGE MANAGER
PACKAGE src/packages/py_memoryview.fdoc
PACKAGE src/packages/char.fdoc
PACKAGE src/packages/cparse.fdoc
PACKAGE src/packages/py_pystate.fdoc
PACKAGE src/packages/flx_profile.fdoc
PACKAGE src/packages/algebra.fdoc
PACKAGE src/packages/logic.fdoc
PACKAGE src/packages/py_method.fdoc
PACKAGE src/packages/gc.fdoc
PACKAGE src/packages/libstruct.fdoc
PACKAGE src/packages/faio.fdoc
PACKAGE src/packages/uint256_t.fdoc
PACKAGE src/packages/py_string.fdoc
PACKAGE src/packages/debug.fdoc
PACKAGE src/packages/int256.fdoc
PACKAGE src/packages/io.fdoc
PACKAGE src/packages/fibres.fdoc
PACKAGE src/packages/ncurses.fdoc
PACKAGE src/packages/complex.fdoc
PACKAGE src/packages/flx_web.fdoc
PACKAGE src/packages/py_list.fdoc
PACKAGE src/packages/py_pycapsule.fdoc
PACKAGE src/packages/pthreads.fdoc
PACKAGE src/packages/memory.fdoc
PACKAGE src/packages/py_pylifecycle.fdoc
PACKAGE src/packages/quaternion.fdoc
PACKAGE src/packages/stl.fdoc
PACKAGE src/packages/py_iterator.fdoc
PACKAGE src/packages/rtl-slist.fdoc
PACKAGE src/packages/time.fdoc
PACKAGE src/packages/buildtools.fdoc
PACKAGE src/packages/web.fdoc
PACKAGE src/packages/rtl-lfbag.fdoc
PACKAGE src/packages/botan.fdoc
PACKAGE src/packages/spinlock.fdoc
PACKAGE src/packages/py_module.fdoc
PACKAGE src/packages/py_type.fdoc
PACKAGE src/packages/py_mapping.fdoc
PACKAGE src/packages/py_float.fdoc
PACKAGE src/packages/async.fdoc
PACKAGE src/packages/gmp.fdoc
PACKAGE src/packages/py_sequence.fdoc
PACKAGE src/packages/parsers.fdoc
PACKAGE src/packages/py_bytes.fdoc
PACKAGE src/packages/recognisers.fdoc
PACKAGE src/packages/flx_pkgconfig.fdoc
PACKAGE src/packages/rtl.fdoc
PACKAGE src/packages/py_tuple.fdoc
PACKAGE src/packages/regex.fdoc
PACKAGE src/packages/rtl-waitablebool.fdoc
PACKAGE src/packages/py_number.fdoc
PACKAGE src/packages/py_version.fdoc
PACKAGE src/packages/arrays.fdoc
PACKAGE src/packages/judy.fdoc
PACKAGE src/packages/flx_flxg.fdoc
PACKAGE src/packages/strutil.fdoc
PACKAGE src/packages/chips.fdoc
PACKAGE src/packages/rtl-sysdlist.fdoc
PACKAGE src/packages/sdl.fdoc
PACKAGE src/packages/gsl.fdoc
PACKAGE src/packages/strings.fdoc
PACKAGE src/packages/programmer.fdoc
PACKAGE src/packages/ucstring.fdoc
PACKAGE src/packages/py_oldbuffer.fdoc
PACKAGE src/packages/sqlite3.fdoc
PACKAGE src/packages/py_weakref.fdoc
PACKAGE src/packages/python.fdoc
PACKAGE src/packages/py_long.fdoc
PACKAGE src/packages/core_type_constructors.fdoc
PACKAGE src/packages/py_bytearray.fdoc
PACKAGE src/packages/rparse.fdoc
PACKAGE src/packages/embed.fdoc
PACKAGE src/packages/flx.fdoc
PACKAGE src/packages/rtl-boundqueue.fdoc
PACKAGE src/packages/codecs.fdoc
PACKAGE src/packages/linux.fdoc
PACKAGE src/packages/umka.fdoc
PACKAGE src/packages/py_bool.fdoc
PACKAGE src/packages/reals.fdoc
PACKAGE src/packages/py_dict.fdoc
PACKAGE src/packages/rtl-conditionvariable.fdoc
PACKAGE src/packages/grammars.fdoc
PACKAGE src/packages/trees.fdoc
PACKAGE src/packages/flx_doc.fdoc
PACKAGE src/packages/py_int.fdoc
PACKAGE src/packages/driver.fdoc
PACKAGE src/packages/toolchain.fdoc
PACKAGE src/packages/svc.fdoc
PACKAGE src/packages/program.fdoc
PACKAGE src/packages/configs.fdoc
PACKAGE src/packages/py_complex.fdoc
PACKAGE src/packages/gui.fdoc
PACKAGE src/packages/serialisation.fdoc
PACKAGE src/packages/cheaders.fdoc
PACKAGE src/packages/integers.fdoc
PACKAGE src/packages/dynlink.fdoc
PACKAGE src/packages/py_slice.fdoc
PACKAGE src/packages/apple.fdoc
PACKAGE src/packages/control.fdoc
PACKAGE src/packages/py_mem.fdoc
PACKAGE src/packages/filesystem.fdoc
PACKAGE src/packages/py_pythread.fdoc
PACKAGE src/packages/rlang.fdoc
PACKAGE src/packages/core_scalar_types.fdoc
PACKAGE src/packages/lists.fdoc
PACKAGE src/packages/demux.fdoc
PACKAGE src/packages/py_descr.fdoc
PACKAGE src/packages/py_exc.fdoc
PACKAGE src/packages/py_unicode.fdoc
PACKAGE src/packages/py_function.fdoc
PACKAGE src/packages/rtl-pthread-impl.fdoc
PACKAGE src/packages/py_set.fdoc
PACKAGE src/packages/random.fdoc
PACKAGE src/packages/grammar.fdoc
PACKAGE src/packages/pointers.fdoc
PACKAGE src/packages/py_ceval.fdoc
PACKAGE src/packages/sync.fdoc
PACKAGE src/packages/filetools.fdoc
PACKAGE src/packages/concordance.fdoc
PACKAGE src/packages/py_ref.fdoc
PACKAGE src/packages/py_object.fdoc
PACKAGE src/packages/dynamic_metatyping.fdoc
PACKAGE src/packages/stdlib_toc.fdoc
PACKAGE src/packages/rtl-monitor.fdoc
PACKAGE src/packages/exceptions.fdoc
PACKAGE src/packages/py_instance.fdoc
PACKAGE src/packages/py_cobject.fdoc
PACKAGE src/packages/py_buffer.fdoc
PACKAGE src/packages/rtl-threads.fdoc
PACKAGE src/packages/unique.fdoc
PACKAGE src/packages/streams.fdoc
PACKAGE src/packages/flx_cache.fdoc
[fbuild] CONFIGURING FELIX
[fbuild] [ocaml] COMPILING COMPILER
 * ocamldep              : src/compiler/ocs/src/ocs_wrap.ml
 * ocamldep              : src/compiler/ocs/src/ocs_error.ml
 * ocamldep              : src/compiler/ocs/src/ocs_types.mli
 * ocamldep              : src/compiler/ocs/src/ocs_port.mli
 * ocamldep              : src/compiler/ocs/src/ocs_port.ml
 * ocamldep              : src/compiler/ocs/src/ocs_vartable.mli
 * ocamldep              : src/compiler/ocs/src/ocs_vartable.ml
 * ocamldep              : src/compiler/ocs/src/ocs_string.mli
 * ocamldep              : src/compiler/ocs/src/ocs_char.mli
 * ocamldep              : src/compiler/ocs/src/ocs_numaux.ml
 * ocamldep              : src/compiler/ocs/src/ocs_numaux.mli
 * ocamldep              : src/compiler/ocs/src/ocs_prim.ml
 * ocamldep              : src/compiler/ocs/src/ocs_compile.mli
 * ocamldep              : src/compiler/ocs/src/ocs_compile.ml
 * ocamldep              : src/compiler/ocs/src/ocs_env.mli
 * ocamldep              : src/compiler/ocs/src/ocs_sym.mli
 * ocamldep              : src/compiler/ocs/src/ocs_sym.ml
 * ocamldep              : src/compiler/ocs/src/ocs_env.ml
 * ocamldep              : src/compiler/ocs/src/ocs_misc.mli
 * ocamldep              : src/compiler/ocs/src/ocs_misc.ml
 * ocamldep              : src/compiler/ocs/src/ocs_eval.mli
 * ocamldep              : src/compiler/ocs/src/ocs_eval.ml
 * ocamldep              : src/compiler/ocs/src/ocs_print.mli
 * ocamldep              : src/compiler/ocs/src/ocs_print.ml
 * ocamldep              : src/compiler/ocs/src/ocs_char.ml
 * ocamldep              : src/compiler/ocs/src/ocs_numstr.mli
 * ocamldep              : src/compiler/ocs/src/ocs_numstr.ml
 * ocamldep              : src/compiler/ocs/src/ocs_num.mli
 * ocamldep              : src/compiler/ocs/src/ocs_num.ml
 * ocamldep              : src/compiler/ocs/src/ocs_complex.mli
 * ocamldep              : src/compiler/ocs/src/ocs_complex.ml
 * ocamldep              : src/compiler/ocs/src/ocs_io.mli
 * ocamldep              : src/compiler/ocs/src/ocs_io.ml
 * ocamldep              : src/compiler/ocs/src/ocs_read.mli
 * ocamldep              : src/compiler/ocs/src/ocs_lex.mli
 * ocamldep              : src/compiler/ocs/src/ocs_lex.ml
 * ocamldep              : src/compiler/ocs/src/ocs_read.ml
 * ocamldep              : src/compiler/ocs/src/ocs_macro.mli
 * ocamldep              : src/compiler/ocs/src/ocs_macro.ml
 * ocamldep              : src/compiler/ocs/src/ocs_prim.mli
 * ocamldep              : src/compiler/ocs/src/ocs_top.mli
 * ocamldep              : src/compiler/ocs/src/ocs_vector.mli
 * ocamldep              : src/compiler/ocs/src/ocs_string.ml
 * ocamldep              : src/compiler/ocs/src/ocs_contin.mli
 * ocamldep              : src/compiler/ocs/src/ocs_contin.ml
 * ocamldep              : src/compiler/ocs/src/ocs_top.ml
 * ocamldep              : src/compiler/ocs/src/ocs_list.mli
 * ocamldep              : src/compiler/ocs/src/ocs_list.ml
 * ocamldep              : src/compiler/ocs/src/ocs_vector.ml
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_error.ml -> build/release/src/compiler/ocs/src/ocs_error.cmx
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_port.mli -> build/release/src/compiler/ocs/src/ocs_port.cmi
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_vartable.mli -> build/release/src/compiler/ocs/src/ocs_vartable.cmi
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_port.ml -> build/release/src/compiler/ocs/src/ocs_port.cmx
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_vartable.ml -> build/release/src/compiler/ocs/src/ocs_vartable.cmx
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_complex.mli -> build/release/src/compiler/ocs/src/ocs_complex.cmi
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_types.mli -> build/release/src/compiler/ocs/src/ocs_types.cmi
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_complex.ml -> build/release/src/compiler/ocs/src/ocs_complex.cmx
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_sym.mli -> build/release/src/compiler/ocs/src/ocs_sym.cmi
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_lex.mli -> build/release/src/compiler/ocs/src/ocs_lex.cmi
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_sym.ml -> build/release/src/compiler/ocs/src/ocs_sym.cmx
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_vector.mli -> build/release/src/compiler/ocs/src/ocs_vector.cmi
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_env.mli -> build/release/src/compiler/ocs/src/ocs_env.cmi
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_string.mli -> build/release/src/compiler/ocs/src/ocs_string.cmi
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_env.ml -> build/release/src/compiler/ocs/src/ocs_env.cmx
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_print.mli -> build/release/src/compiler/ocs/src/ocs_print.cmi
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_vector.ml -> build/release/src/compiler/ocs/src/ocs_vector.cmx
 * ocamlopt              : build/release/src/compiler/ocs/src/ocs_string.ml -> build/release/src/compiler/ocs/src/ocs_string.cmx
 + /usr/bin/ocamlopt -c -I build/release/src/compiler/ocs/src -I src/compiler/ocs/src -o build/release/src/compiler/ocs/src/ocs_string.cmx build/release/src/compiler/ocs/src/ocs_string.ml
File "build/release/src/compiler/ocs/src/ocs_string.ml", line 68, characters 13-34:
Error: Unbound value Bytes.lowercase_ascii
Error running '/usr/bin/ocamlopt -c -I build/release/src/compiler/ocs/src -I src/compiler/ocs/src -o build/release/src/compiler/ocs/src/ocs_string.cmx build/release/src/compiler/ocs/src/ocs_string.ml' exited with 2
 * ocamlc                : build/release/src/compiler/ocs/src/ocs_macro.mli -> build/release/src/compiler/ocs/src/ocs_macro.cmi
GNUmakefile:119: recipe for target 'do-fbuild' failed
make: *** [do-fbuild] Error 1

To be honest, I'm surprised you don't do regular releases as AppImages or Docker containers. Would make it much easier.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

I have no idea how to stuff around with Docker or AppImages (never even heard of that). That's just one more layer of idiot dependencies I am trying to avoid. At the moment to get Felix moving you need, obviously, C++, you need Ocaml, and you need Python 3.x and that's ALL you need (well apart from basic tools like make and shell and git). Everything else, such as ocaml packages like Dypgen, and C++ packages like Google RE2 are bundled directly in the system.

It looks like the Debian build is also way WAY out of date which is not surprising. Probably the Ubuntu build is more up to date. The problems we're having here all stem from one really bad change to Ocaml which is the result of a long running stupidity: in Ocaml strings were originally mutable. The problem was the compiler assumed string literals were immutable .. so the type system as unsound.

To fix this, they added a new type bytes which was mutable, and made strings immutable, which broke every program that used mutable string buffers .. including other standard Ocaml library packages like Lexing. Lex buffers are intrinsically mutable (they get reloaded obviously), but when you change them to bytes that breaks everything using it.

I fixed a whole lot of stuff already. I have my own Dypgen clone inside Felix. But whilst the older compilers have some tolerance, it seems the 5.x family doesn't. They should have fixed the dang compiler, not messed with every user program in existence that used strings.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

ok i'm building Ocaml from trunk now.

@Sod-Almighty
Copy link
Author

AppImage is a way to bundle your product and its dependancies into a single executable. I use it myself, for the Linux edition of my product.

@Sod-Almighty
Copy link
Author

Will updating the Felix sources to be compatible with OCaml 5 break compatibility with OCaml 4?

@skaller
Copy link
Member

skaller commented Sep 3, 2022

Will updating the Felix sources to be compatible with OCaml 5 break compatibility with OCaml 4?

No idea. Possibly. Felix doesn't require any C modules in Ocaml, but the 5.x family is a totally rewrite of the run time, especially the garbage collector, so Ocaml can finally run multicore. It's really hard to know what might break. It probably still has bugs.

The problems will be mainly on Windows. It uses a mingw variant to build the Ocaml run time, but Felix itself doesn't bother supporting crud, and only supports the Microsoft compiler. Unfortunately C++ ABI is dependent on the compiler as well as the OS, unlike C. So basically a Windows developer either needs to have the right mingw installed AS WELL as Visual Studio, or they just need to use Bash for Windows which uses Ubuntu.

So the answer is .. probably going to Ocaml 5.x will make the system unbuildable on Windows but I have no way to find out. Microsoft owns GitHub but I cannot get their own CI build services to run their own compiler. Ideally I'd build Felix on GitHub for Linux, Mac, and Windows, and you could just install a tarball and bobs your uncle.

I can't use Applimages .. my box is an old Macbook Pro running the latest MacOS.

@Sod-Almighty
Copy link
Author

Okay, now I'm confused.

I cloned OCaml 4.14, built and installed it. Then I cloned Felix again, and managed to get most of the way through compiling it. Then it failed:

Can't load automaton '/tmp/ocaml/felix/build/release/cache/binary/tmp/ocaml/felix/build/release/share/lib/grammar/syntax.automaton'from disk: building!
Opening syntax extensions /tmp/ocaml/felix/src/packages/grammar.fdoc: line 4724, cols 1 to 19
Parsed open of syntax extensions felix
Setting automaton
Automaton set
Trying to store automaton /tmp/ocaml/felix/build/release/cache/binary/tmp/ocaml/felix/build/release/share/lib/grammar/syntax.automaton
Saved automaton to disk.
Binding library std
binding library std done
Exports = 0
 * g++                                 : build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/flx_pkgconfig.cpp -> build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/flx_pkgconfig_static.o
 * g++                                 : build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/flx_pkgconfig_static_link_thunk.cpp -> build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/flx_pkgconfig_static_link_thunk_static.o
 * g++                                 : build/release/host/lib/rtl/flx_run_lib_static_static.o build/release/host/lib/rtl/flx_run_main_static.o build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/flx_pkgconfig_static.o build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/flx_pkgconfig_static_link_thunk_static.o flx_static flx_gc_static flx_exceptions_static judy_static flx_exceptions_static flx_async_static flx_gc_static flx_exceptions_static judy_static flx_pthread_static flx_gc_static flx_exceptions_static judy_static flx_dynlink_static flx_gc_static flx_exceptions_static judy_static flx_strutil_static flx_strutil_static flx_uint256_t_static -> build/release/host/bin/flx_pkgconfig
[fbuild] [flx] building flx
[fbuild] [rtl] MAKING RTL *******
[fbuild] [rtl] build uint256_t
[fbuild] [rtl] build strutil
[fbuild] [rtl] build dynlink
[fbuild] [rtl] build strutil
64 bit JUDY
[fbuild] [rtl] build exceptions
[fbuild] [rtl] build pthread
64 bit JUDY
[fbuild] [rtl] build exceptions
64 bit JUDY
[fbuild] [rtl] build exceptions
[fbuild] [rtl] build exceptions
64 bit JUDY
[fbuild] [rtl] build exceptions
Buildroot        = build/release
Src to flxg      = build/release/share/src/tools/bootflx.flx
Expected flg dst = build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/bootflx.cpp
 * flxg                                : build/release/share/src/tools/bootflx.flx -> build/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools/bootflx.cpp
 + build/release/host/bin/flxg -Ibuild/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools -Ibuild/release/host/lib -Ibuild/release/share/lib -Ibuild/release/share/src/tools --syntax=@grammar/grammar.files --import=concordance/concordance.flxh --import=plat/flx.flxh --output_dir=build/release/cache/text --cache_dir=build/release/cache/binary std build/release/share/src/tools/bootflx
Flx_lookup:inner_bind_expression: SimpleNameNotFound binding expression ((cpps control), save_extra_cxx)
Error at:
/tmp/ocaml/felix/src/packages/flx.fdoc: line 3257, cols 11 to 41
3256:           control.EXPECT <- "";
3257:           control.cpps <- save_extra_cxx; // because in C++ batch mode there's no main so we have to tack it on here
                *******************************
3258:           if control*.CXXONLY == 1 do

[Flx_lookup.bind_expression] Inner bind expression failed binding ((cpps control), save_extra_cxx)
SIMPLE NAME save_extra_cxx NOT FOUND ERROR
In /tmp/ocaml/felix/src/packages/flx.fdoc: line 3257, cols 27 to 41
3256:           control.EXPECT <- "";
3257:           control.cpps <- save_extra_cxx; // because in C++ batch mode there's no main so we have to tack it on here
                                ***************
3258:           if control*.CXXONLY == 1 do

Routine: inner_lookup_name_in_env
Error running 'build/release/host/bin/flxg -Ibuild/release/cache/text/tmp/ocaml/felix/build/release/share/src/tools -Ibuild/release/host/lib -Ibuild/release/share/lib -Ibuild/release/share/src/tools --syntax=@grammar/grammar.files --import=concordance/concordance.flxh --import=plat/flx.flxh --output_dir=build/release/cache/text --cache_dir=build/release/cache/binary std build/release/share/src/tools/bootflx' exited with 1
GNUmakefile:119: recipe for target 'do-fbuild' failed
make: *** [do-fbuild] Error 1

If I'm using the exact version of OCaml recommended for building Felix............I don't understand why it's still broken.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

Nothing to do with Ocaml by the look of it. That's an error in Felix building the compiler driver flx, which is written Felix. And its due to change I did two days ago. I missed that bug. Here's why:

The first time you build Felix, you build a bootstrap version using script written in Python. The build tool is called fbuild. The bootstrap version uses a slightly munged "flx" which physically includes all the code required for a cut down Felix, to avoid the dynamic loading subsystem. To make bthis work, there are two slightly different versions of flx the first one you make is called bootflx but is renamed flx and then you rebuild the whole system .. this time using Felix instead of Python.

There is a BUG in bootflx I didn't catch because normally I just rebuild Felix using Felix rather than rebuilding from scratch. I'll fix that now.

@Sod-Almighty
Copy link
Author

I have to wonder though......as interesting as Felix looks, and as helpful as you are being......if it's dependant on a broken compiler for a broken language (which also has unfriendly maintainers!) and is also dependant on a parser that is no longer being maintained.............is it really wise for me to write software in this language?

@skaller
Copy link
Member

skaller commented Sep 3, 2022

The problem with the parser is due to Ocaml team breaking stuff. I wish I had written the compiler in Haskell now but I don't know Haskell. But once the parser is built it should be fine. I don't need to ever change the parser except when Ocaml team breaks it. The Felix parser dynamically loads the grammar using Dypgen. The only hassle might be if Ocaml breaks their Marshal module because Felix uses that to save and reload the parsing automaton, to avoid rebuilding the parser every time you run the compiler.

So the only real pain is getting the compiler to actually build. Once it builds, it should be fine because it doesn't depend on anything nasty at all. It's all very basic Felix file to C++ file stuff. The last bug you found is actually because Felix is working fine: that's an error in Felix code you found and it's my bad and already fixed.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

I'm going to try to build Felix with Ocaml 5.x trunk. The problem is without opam, its very hard to switch to another Ocaml version and make sure it builds with 4.14 as well. Opam can do this with a single command.

You are going to find bugs in Felix espeically if you push it and use some of the latest experimental stuff. These will be like:

  • the compiler bugs out something that should compile: I can usually fix this
  • the compiler gives a useless error message when you make a mistake: again, I can usually fix this, it WILL happen. I can fix your Felix bug and also fix the compiler so the error message tells you what you did wrong.
  • the generated code doesn't compile with your C++ compiler. This can and does sometimes happens because of differences in C++ compilers and versions and changes made by the C++ committee. Again, I can usually fix this, however I run clang, and the brew installed version of gnu compiler doesn't always work because I run the latest MacOS and they don't care about gcc. Some recent changes to MacOS include changing how all standard binary libraries are linked: all the MacOS system libraries are now pre-linked so you cannot find any system library.dyp files anymore they're all gone.

In the build, you may find a couple of regression test cases fail. In particular if you don't have the SDL2 multi-media stuff installed, or it isn't where Felix expects to find it, the GUI test cases will fail. That's not a bug, it's just because you haven't got SDL2 support: SDL2 is not bundled with Felix. The build system doesn't detect if you have a valid install of SDL2.

@Sod-Almighty
Copy link
Author

Still fails with 4.14:

build exes
tools/flx_cp -> flx_cp
tools/flx_ls -> flx_ls
tools/flx_grep -> flx_grep
tools/flx_replace -> flx_replace
tools/flx_batch_replace -> flx_batch_replace
tools/flx_tangle -> flx_tangle
tools/flx_perror -> flx_perror
tools/flx_gramdoc -> flx_gramdoc
tools/flx_libindex -> flx_libindex
tools/flx_libcontents -> flx_libcontents
tools/flx_mktutindex -> flx_mktutindex
tools/flx_renumber -> flx_renumber
tools/flx_find_grammar_files -> flx_find_grammar_files
tools/flx_iscr -> flx_iscr
Fatal error: exception Invalid_argument("Filename.chop_suffix")
Felix compilation "build/release/trial/bin/flxg" "-q" "--inline=25" "--output_dir=/root/.felix/cache/text" "--cache_dir=/root/.felix/cache/binary" "-Ibuild/release/share/lib" "-Ibuild/release/trial/lib" "--syntax=@/tmp/ocaml/felix/build/release/share/lib/grammar/grammar.files" "--automaton=/root/.felix/cache/binary/tmp/ocaml/felix/build/release/share/lib/grammar/grammar.files/syntax.automaton" "--import=plat/flx.flxh" "--import=concordance/concordance.flxh" "std" "/tmp/ocaml/felix/build/release/share/src/tools/flx_iscr.fdoc" failed
exe build failed
GNUmakefile:224: recipe for target 'boot' failed
make: *** [boot] Error 1

@Sod-Almighty
Copy link
Author

I can fix your Felix bug and also fix the compiler so the error message tells you what you did wrong

Thank you. I appreciate that.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

OK that's interesting. This is a run time error in the compiler. It's saying the standard Ocaml module Filename, function chop_suffix is given an invalid string eg a filename without a suffix to chop. Which is a bit weird because it works for me using 4.13 and Linux and Mac use the same Unix filenames for everything for .. will suffices.

chop_suffix name suff removes the suffix suff from the filename name.

Raises Invalid_argument if name does not end with the suffix suff.

I sure wish I knew what caused the error exactly. Unfortunately dynamic exception handling is a very bad idea (which is why Felix doesn't have it). However:

src/compiler/flxg/flxg_parse.ml: let local_prefix = Filename.chop_suffix (Filename.basename file_name) ".flx" in

is the only use of it. Stuff knows why I do not get this error. I'll have to add a special test to trap the problem for you to run.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

LOL! The result of that operation is never used anyhow.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

Just on the "should you use Felix to write software" issue: my assessment is that it should be good to write support tools. For production software I'd be more wary: you need to gain confidence not only in the system but that you will get support when there's an issue. The flip side is you're obviously an expert developer so as you become familiar with the system you'll be able to resolve a lot of issues yourself and also help modify and extend the system's capabilities. Try doing that with other software, open source or not!

So the issues to consider are at least partly political. You have to trade off some problems arising due to the small number of users against the fact that a small number of users also means YOU get the maximum support to get the system to do things that YOU want to do .. and you'll find the flexibility in the system .. such as user defined grammar and the ability to bind to C++ almost seamlessly .. increasingly useful for doing what Felix was designed for: automation.

If you're doing something repeatedly enough to recognise "engineering patterns" you should be able to get your language to abstract away the boilerplate, and if you can't, you can then ask, how you would modify that system in order to be able to do so. There are a lot of papers on different kinds of polymorphism and a lot of the systems are well described with formal semantics etc, so quite a lot can be implemented without too much effort: the real problem is deciding which things to implement.

One of the things you cannot do easily with Felix at the moment is write real-time programs. This is because it uses a garbage collector. The fix for that is not a minor patch: I'm woking on real time CSP and the design seems to work, but getting Felix to use it AS WELL as the GC is a hard problem: the real-time channels and continuation objects are quite different (ref counted instead of garbage collected). That's an example of something that cannot be made to work in 24 hours.

@Sod-Almighty
Copy link
Author

Did you fix the thing that isn't used? Should I retry the compilation?

you're obviously an expert developer

Thanks. I've had quite a bit of experience in certain areas of development, but I'm not sure I'd call myself an expert.

What makes you think so?

you should be able to get your language to abstract away the boilerplate

Absolutely! This is one reason I detest C++ with a passion.

user defined grammar

Oh yes? Wasn't aware of that facility. It's hard enough even to find a language with UFCS, or with user-definable infix operators. Am I to assume Felix has both?

real-time programs

Not 100% sure what you mean by that. Just that the GC takes time to operate, causing tiny delays every so often, like .NET does? It's not often that this becomes a major issue, in my experience.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

If you look in src/packages/grammar.fdoc that is the actual "Felix" grammar. When you unpack it with flx_iscr or the Python version thereof, which happens when you say make extract, it installs a set of grammar definitions .. in the standard library.

The bootstrap grammar that is hard baked into Felix consists of core comment lexing and a the "grammar of the grammar specifications". So the bootstrap parser cannot parse Felix, it can only parse Felix grammar specifications. It parses these specifications into modules called DSSLs or Domain Specific Sub-Lanuages" which when opened cause the parse automaton to be rebuilt on the fly (that is at compile time) and then THAT parser is used to parse your "Felix code".

So if you can write an EBNF grammar for something you want to do, provided it fits in with the existing grammar sanely, you just extended the language syntax.

TO extend the semantics, we look further and the first thing we see is that your grammar productions have action codes that say how to build an AST from productions .. and you find NO that is not actually an AST code .. that is executable R5RS Scheme. So you can write "grammar macros" in Scheme! The Scheme, when executed, must generate an S-expression which the Ocaml module src/compiler/flx_desugar/sex2flx.ml can unpack. The actual representation in Ocaml for the Scheme is another unmaintained package ocs_scheme. I maintain that now, this one I can understand well enough (whereas Dypgen is very sophisticated).

The actual S-expressions the Ocaml sex2flx module recognises aren't documented separately from the actual code. Felix uses a very specific abstract machine model represented with Ocaml code and all the complexity reduces down to this model. Basically has Executable instructions which have arguments that can be Executable Expressions, and which has specific Types and few other things. The Ocaml names are

  • BTYP_ * types
  • BEXPR_* expressions
  • BEXE_* instructions
  • KIND_* kinds

and this virtual machine code is stashed into symbol tables.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

SO: a real time program is one which must complete in a fixed amount of time (no matter what the inputs are) OR more commonly, a program which loops forever doing a job with the same property as above. The time in seconds that the code has to complete is a hard bound. If the program fails to do this, the program has failed and the code is incorrect (in that it failed to meet its temporal boundary condition).

For example, my use case: on an Apple platform the operating system is able to deliver sound data in blocks in real time, where the sound say comes from the computer microphone, and it can deliver sound data to the speaker in real time too. So any audio processing you are doing on a block of data must complete before the next one is delivered. Sound is sampled at 44.1KHz and you can choose a block size, typically 128 or 256 floating point numbers, which determines the period of a processing cycle. So you have to ask the OS to give you a real time thread and promise you a certain amount of CPU time in any given time span the length of the period. On MacOS you can do this. You can in Unix too if you have RT-extensions. There are RT versions of Linux too.

What this means is that a GC is fine if it can use an amount of time every cycle which is bounded so you can allow for it. And that's more or less impossible with the Felix GC. It's a standard mark/sweep world/stop algorithm. World stop is a real pain because there is no portable way to stop a thread. On MacOS there is no way at all. On Linux, you can send a signal but that's close to useless because the GC thread has to be able to capture the machine stack because that with the machine registers pushed onto it, is the root for the collector.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

yeah i made a patch but only you can tell if it's actually a fix ..

@Sod-Almighty
Copy link
Author

So if you can write an EBNF grammar

I'm afraid I understood very little of that post. Parsers and grammars have always confused me.

Recently I tried writing a toy Lisp parser for experience. I found it very difficult and confusing.

On MacOS there is no way at all. On Linux, you can send a signal but that's close to useless

If it can't be done.....how is Felix available for those platforms?

On second thought.....I probably wouldn't understand the explanation. Compiler design is a couple layers below my experience level.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

Example of grammar:

syntax mulexpr
{
  //$ multiplication: non-associative.
  x[sproduct_pri] := x[sproduct_pri] "*" x[>sproduct_pri] =># "(Infix)";
}

syntax addexpr
{
  //$ Addition: left associative.
  x[ssum_pri] := x[ssum_pri] "+" x[>ssum_pri] =># "(Infix)";

  //$ Subtraction: left associative.
  x[ssum_pri] := x[ssum_pri] "-" x[>ssum_pri] =># "(Infix)";
}

syntax divexpr
{
  //$ division: right associative low precedence fraction form
  x[stuple_pri] := x[>stuple_pri] "\over" x[>stuple_pri] =># "(Infix)";

  //$ division: left associative.
  x[sproduct_pri] := x[sproduct_pri] "/" x[>sproduct_pri] =># "(Infix)";

  //$ remainder: left associative.
  x[sproduct_pri] := x[sproduct_pri] "%" x[>sproduct_pri] =># "(Infix)";

  //$ remainder: left associative.
  x[sproduct_pri] := x[sproduct_pri] "\bmod" x[>sproduct_pri] =># "(Infix)";
}

That's pretty easy to understand except that there is one more piece of information you need:

priority
...
    // BITWISE OPERATORS
    sbor_pri <
    sbxor_pri <
    sband_pri <
    sshift_pri <

    // NUMERIC OPERATORS
    ssum_pri <
    scompactsum_pri <
    ssubtraction_pri <
    sproduct_pri <
    scompactproduct_pri <
    s_term_pri <        // division 
...

which defines some of the precedences needed. It's saying multiplication is bound tighter syntactically than addition so a+b*c is parsed as a+(b*c). The Scheme action here is just (Infix) which calls a predefined Scheme procedure that translates addition and multiplication to function calls. For our example +(a,*(b,c)) where + and * are legal function names in Felix. So the DSSLs above (constructions with the syntax keyword) map arithmetic syntax onto function calls. There are no arithmetic operators in Felix. Instead you just define it yourself in terms of C++, sort of like this:

fun +: int * int -> int  = "$1+$2";

This definition, for your convenience, is already in the standard library.

The fact Felix doesn't know how to add integers is a major powerup! It forces the developer, that's me, to find a way to let the user do it. If the user can do that, then the user can do a whole lot of other things the same way.

@Sod-Almighty
Copy link
Author

I got Felix compiled and installed, but I'm getting a strange error when I run it:

# flx
Cache may be out of date due to grammar upgrade!
Grammar time stamp          =1662240587.000
Automaton.syntax time stamp =BIG BANG
Delete cache /root/.felix/cache/text
Delete cache /root/.felix/cache/binary

The /root/.felix directory doesn't exist...

@skaller
Copy link
Member

skaller commented Sep 3, 2022

You're running as root?? Ouch. I'd advise against that but you can just create it: mkdir /root/.felix and try again. It's possible the build procedure omitted this step, it's hard for me to test because of course my $HOME/.felix always exists. I'd have to create another account on my laptop to test that.

@Sod-Almighty
Copy link
Author

I mean, the error occurs irrespective of the existence of the directory.
The flx executable creates the directory. If I remove it, the problem still occurs.

And yeah, I run as root. I figure I can accidentally delete all my files just as easily as a limited user, because they're owned by me. Only additional risk of being root is that I might break the operating system. And if I do, I can just run a massive Ruby script I wrote that reinstalls the whole machine from the ground up...

@Sod-Almighty
Copy link
Author

Running as a limited user doesn't help with the flx problem, by the way. I tried.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

The test line is:

flx hello.flx

That should work and print "Hello World". You can also do make test although that usually has run as part of the build already. Note you can use Felix directly out of the repo without ever installing it; you just need to set up some environment variables. Also there is a master control file

~/felix>cat $HOME/.felix/config/felix.fpc
FLX_INSTALL_DIR: /Users/skaller/felix/build/release

which tells where Felix is installed if it isn't the default. Since I don't install it, the install directory is set to the build target in the repository clone.

To make that work, however, you need to set $PATH and $LD_LIBRARY_PATH to include the location of the tool binaries and the system run time libraries. You might need to do this even if you install it, since the install puts flx and flxg in /usr/local/bin but it does NOT put the libraries into /usr/local/lib. Felix is actually installed in /usr/local/lib/felix/felix-version/.

@Sod-Almighty
Copy link
Author

flx hello.flx works. And following that, the cache messages have gone away. Interesting though, that the messages persisted until I compiled hello.flx. Could be a bug?

Thanks for the help. I will play about with it and see how I get on.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

What exactly is the error? Below is correct and expected:

~/felix>flx --clean
Cache may be out of date due to compiler change!
Flxg compiler time stamp=1662234849.000
Cache time stamp        =1662231378.000
Delete cache /Users/skaller/.felix/cache/text
Delete cache /Users/skaller/.felix/cache/binary
~/felix>flx hello
Cache may be out of date due to grammar upgrade!
Grammar time stamp          =1662231292.000
Automaton.syntax time stamp =BIG BANG
Delete cache /Users/skaller/.felix/cache/text
Delete cache /Users/skaller/.felix/cache/binary
Can't load automaton '/Users/skaller/.felix/cache/binary/Users/skaller/felix/build/release/share/lib/grammar/grammar.files/syntax.automaton'from disk: building!
Opening syntax extensions /Users/skaller/felix/src/packages/grammar.fdoc: line 4724, cols 1 to 19
Parsed open of syntax extensions felix
Setting automaton
Automaton set
Trying to store automaton /Users/skaller/.felix/cache/binary/Users/skaller/felix/build/release/share/lib/grammar/grammar.files/syntax.automaton
Saved automaton to disk.
Binding library std
binding library std done
Exports = 0
Hello World!
~/felix>flx hello
Hello World!

@Sod-Almighty
Copy link
Author

Sod-Almighty commented Sep 3, 2022

I mean, the error I posted (Cache may be out of date due to compiler change etc) happened every time I ran flx......until I ran flx hello.flx, whereupon it worked correctly, and the message stopped appearing.

It was like this:

# flx
Cache may be out of date due to grammar upgrade!
Grammar time stamp          =1662240587.000
Automaton.syntax time stamp =BIG BANG
Delete cache /root/.felix/cache/text
Delete cache /root/.felix/cache/binary

# flx
Cache may be out of date due to grammar upgrade!
Grammar time stamp          =1662240587.000
Automaton.syntax time stamp =BIG BANG
Delete cache /root/.felix/cache/text
Delete cache /root/.felix/cache/binary

# flx hello.flx
Hello World!

# flx
usage: flx [options] filename

See? Running flx with no arguments works now, but only after compiling hello.flx. Bit strange.

@Sod-Almighty
Copy link
Author

I would have expected the usage message to be printed every time no arguments were supplied. And the cache warning to only be printed once.

@skaller
Copy link
Member

skaller commented Sep 3, 2022

So: Felix puts EVERYTHING into the cache. So you can run flx in a read only directory, and run felix programs that are in a read only directory. By default. The "hello"

~/felix>ls ~/.felix/cache/binary/Users/skaller/felix/h*
/Users/skaller/.felix/cache/binary/Users/skaller/felix/hello.dylib
/Users/skaller/.felix/cache/binary/Users/skaller/felix/hello.flx.par

Notice, I have a shared library there not an executable. You'll find a .so file. By default, Felix generates a shared library NOT an exeuctable, and uses a thunk to run the library "as if it were a program". Felix actually generates libraries not programs. The "program action" of your program is just the library initialisation code!

If you want an executable:

flx --static hello.flx

If you want it in the current directory:

flx --static -od . hello.flx

The -od names the output directory for the linker. This is platform independent, so on Windows you get hello.exe without changing the build command.

The flx tool autobuilds everything. It finds dependencies, tracks time stamps, and caches all build steps so that it can only rebuild what needs to be rebuilt. NO MAKEFILES. It's a scripting language!

Sometimes .. stuff is so radically changed the tool gives up and rebuilds everything from scratch. The way this is forced is by .. deleting the cache!

@skaller
Copy link
Member

skaller commented Sep 3, 2022

Oh, the usage message should be printed every time, it's just a quirk that the cache was deleted because it was out of date (even though there's nothing in it .. that's precisely what makes it out of date). Since Felix autocompiles everything, things like the parser automaton are also built on demand. And it will be rebuilt if you change the grammar! So all this autobuilding (without any actual felix program to compile) has somehow become a higher priority than printing the usage message.

When the system gets changed and/or rebuilt, running the hello world program is the authoritative way to finalise the build. You don't want to reparse and rebind the standard library every time!

EDIT: this one is a "Wont Fix". :-)

@Sod-Almighty
Copy link
Author

Felix puts EVERYTHING into the cache

So....running the same source again should be quicker the second time? Felix skips the compilation phase if the source hasn't changed?

Are --static executables actually statically linked? No dependancies? (Except for libc.so, I assume?)

Is it possible to compile against musl, rather than libc, for truly dependancy-free executables?

this one is a "Wont Fix"

The failure to print the usage? Or....?

@Sod-Almighty
Copy link
Author

Also, what is a .par file, and what purpose does it serve? (Google results were unhelpful)

@skaller
Copy link
Member

skaller commented Sep 5, 2022

Yes, if you flx hello twice, the second time it has to still do dependency checking, which takes some time, but if the sources have not changed, it just runs the executable again.

The *.par file is a cache of the AST produced by parsing the file. There are other cached files in $HOME/.felix/cache/text. Not sure splitting the cache into binary and text was a good idea. You will see the generated C++:

/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.cpp
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.ctors_cpp
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.dep
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.hpp
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.includes
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.resh
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello.rtti
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello_dynamic.o
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello_dynamic.o.d
/Users/skaller/.felix/cache/text/Users/skaller/felix/hello_static_link_thunk.cpp

The .dep and .d files record dependency information. The *.resh file contains the list of packages required to C++ compile and link. The *.rtti file contains tables the compiler generates which tell the garbage collector where all the pointers in a type are. The generated C++ is split into a few files: the _ctors file contains constructors.

The static_link_thunk is a small thing that links the standard driver and run time to your program statically, by default, a shared library is used and loaded dynamically using a fixed startup executable.

If you generate an executable it is already linked to ALL the Felix run time and startup code, so it is entirely portable (except for any system enforced shared libraries. On MacOS the C library is always dynamically linked).

@Sod-Almighty
Copy link
Author

Linux platforms always enforce libc to be a shared library. libc cannot be statically linked. However, there is an alternative library called musl. Any plans to add support for linking to that instead during compilation?

Given that Felix is transcoded to CPP before being compiled, I would expect this to be reasonably straightforward to implement.

@skaller
Copy link
Member

skaller commented Sep 5, 2022

Is that musl working with both clang and gcc? How does it work? I mean, what switches are needed to make it work?

Felix does allow you to specify compiler and linker switches on the flx command line.
You can find the switches by

flx --help

Relevant here are:

-Idir                : add dir to search path for both felix and C++ includes
-Ldir                : add dir to linker search path
-llib                : add dir lib to linker command
-foption             : add switch to compiler command
-Woption             : add switch to compiler command
-O0                  : add switch to compiler command
-O1                  : add switch to compiler command
-O2                  : add switch to compiler command
-O3                  : add switch to compiler command
--cflags=flags       : addd flags to compiler command
--obj=objfile_base   : add object to link, adds extension
                         so eg fred becomes fred_static.o
-Dmac                : add macro def to C++ compiler command

although note these are not well tested. The spirit of the system is that you can use the exact same shell commands on Linux, MacOS and Windows to do the exact same thing, so using these switches will break that property.

There MAY be another way to do this however: using the metadata database query system. Something like require package "musl" in the code would force this. It's not clear to me what happens if you use this with dynamic linkage though. In Windows if you try this sort of thing, when you load say two DLLs linked with a static C library, you get TWO copies of static data found in the libraries in particular static buffers used with C level file I/O. It's a mess. So to use the meta data you have to say what happens with dynamic linkage, probably the answer is: nothing.

The advantage of the meta data method is it doesn't require changing the build tool flx but it IS portable (it just does a specialised thing on Linux only and only with static linkage). However, I suspect you really do NOT want to do this unless your building embedded software. Which may or may not count Android Linux as embedded software.

The flx tool uses a thing called a toolchain which has an API which allows a fixed set of operations, it's provided by default for 5 platforms: Linux gcc/clang MacOs gcc/clang Windows MSVC++. plus some more experimental bindings for iPhone and iPhoneEmulator.

interface toolchain_t {
  whatami : 1 -> string;
  host_os : 1 -> string;
  target_os : 1 -> string;
  cxx_compiler_vendor : 1 -> string;

  dependency_extension: 1 -> string;
  executable_extension : 1 -> string;
  static_object_extension: 1 -> string;
  dynamic_object_extension: 1 -> string;
  static_library_extension: 1 -> string;
  dynamic_library_extension: 1 -> string;
  pathname_separator : 1 -> string;
  get_base_c_compile_flags: 1 -> list[string];
  get_base_cxx_compile_flags: 1 -> list[string];

  cxx_dependency_generator : (src:string) -> int * string;
  c_dependency_generator : (src:string) -> int * string;
  dependency_parser : string -> list[string];

  cxx_static_object_compiler : (dst:string,src: string) -> int;
  cxx_static_library_object_compiler : (dst:string,src: string) -> int;
  c_static_object_compiler : (dst:string,src: string) -> int;
  static_library_linker : (dst:string,srcs:list[string]) -> int;
  static_executable_linker : (dst:string,srcs:list[string]) -> int;
  dynamic_executable_linker : (dst:string,srcs:list[string]) -> int;

  cxx_dynamic_object_compiler : (dst:string,src: string) -> int;
  c_dynamic_object_compiler : (dst:string,src: string) -> int;
  dynamic_library_linker : (dst:string,srcs: list[string]) -> int;

  debug_flags : 1 -> list[string];
}

In the flx model, instances of this interface are constructed by code in a plugin. As it happens Felix can freeze or more accurately preload plugins, which are otherwise shared libraries, and flx preloads the 5 required plugins so flx itself is statically linked (but it can still load other toolchains dynamically at run time).

The point is the system is deliberately restricted in its capabilities so they're well defined, and the interactions between them are well defined, AND, those operational definitions are platform independent (in that they work on all current toolchains). So the whole idea is to avoid using anything platform specific. However as mentioned Windows ALSO has a static link C library. MacOS does not deliberately. Apple uses frameworks instead to manage OS version dependency. But then it's a locked in authoritatively controlled OS, whilst Linux is open.

Apart from the bad interaction with shared libraries, your executable would be very platform dependent, it would not work on different versions of Linux that used different OS calling conventions. It breaks the tradition for Unix that the OS interface is via C, not assembler.

In any case you can try using the -L and -l switches. I can't because I run MacOS.

@skaller
Copy link
Member

skaller commented Sep 7, 2022

BTW there is a mailing list, send a message to it I'll add you: felix-lang@googlegroups.com

@Sod-Almighty
Copy link
Author

Done!

@Sod-Almighty
Copy link
Author

Well...that didn't seem to work...

@skaller
Copy link
Member

skaller commented Sep 9, 2022

Your email is going to the group. But you're not subscribed. Try to subscribe. I seem to be the owner of the group but I am not getting the "Add Members" option i should be. I had an issue with passwords etc before.

@skaller
Copy link
Member

skaller commented Nov 2, 2022

Use group: felixpl@googlegroups.com because I can manage that.

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