bcpierce00 / unison

Unison file synchronizer
GNU General Public License v3.0
4.12k stars 232 forks source link

OCaml 4.10 support #353

Closed chenrui333 closed 4 years ago

chenrui333 commented 4 years ago

During the ocaml 4.10 regression build, it looks like the unison does not build with OCaml 4.10, I have attached the build failure log below.

build failure log ``` Last 150 lines from /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/unison/01.make: -impl Compile as a .ml file -inline |=[,...] Aggressiveness of inlining (default 1.25, higher numbers mean more aggressive) -inline-toplevel |=[,...] Aggressiveness of inlining at toplevel (higher numbers mean more aggressive) -inline-alloc-cost |=[,...] The cost of not removing an allocation during inlining (default 7, higher numbers more costly) -inline-branch-cost |=[,...] The cost of not removing a conditional during inlining (default 5, higher numbers more costly) -inline-call-cost |=[,...] The cost of not removing a call during inlining (default 5, higher numbers more costly) -inline-prim-cost |=[,...] The cost of not removing a primitive during inlining (default 3, higher numbers more costly) -inline-indirect-cost |=[,...] The cost of not removing an indirect call during inlining (default 4, higher numbers more costly) -inline-lifting-benefit |=[,...] The benefit of lifting definitions to toplevel during inlining (default 1300, higher numbers more beneficial) -inlining-report Emit `..inlining' file(s) (one per round) showing the inliner's decisions -insn-sched Run the instruction scheduling pass (default) -intf Compile as a .mli file -intf-suffix Suffix for interface files (default: .mli) -keep-docs Keep documentation strings in .cmi files -no-keep-docs Do not keep documentation strings in .cmi files (default) -keep-locs Keep locations in .cmi files (default) -no-keep-locs Do not keep locations in .cmi files -labels Use commuting label mode -linkall Link all modules, even unused ones -inline-max-depth |=[,...] Maximum depth of search for inlining opportunities inside inlined functions (default 1) -alias-deps Do record dependencies for module aliases -no-alias-deps Do not record dependencies for module aliases -linscan Use the linear scan register allocator -app-funct Activate applicative functors -no-app-funct Deactivate applicative functors -no-float-const-prop Deactivate constant propagation for floating-point operations -noassert Do not compile assertion checks -noautolink Do not automatically link C libraries specified in .cmxa files -nodynlink Enable optimizations for code that will not be dynlinked -no-insn-sched Do not run the instruction scheduling pass -nolabels Ignore non-optional labels in types -nostdlib Do not add default directory to the list of include directories -nopervasives (undocumented) -no-unbox-free-vars-of-closures Do not unbox variables that will appear inside function closures -no-unbox-specialised-args Do not unbox arguments to which functions have been specialised -o Set output file name to -O2 Apply increased optimization for speed -O3 Apply aggressive optimization for speed (may significantly increase code size and compilation time) -opaque Does not generate cross-module optimization information (reduces necessary recompilation on module change) -open Opens the module before typing -output-obj Output an object file instead of an executable -output-complete-obj Output an object file, including runtime, instead of an executable -p (no longer supported) -pack Package the given .cmx files into one .cmx -plugin (no longer supported) -pp Pipe sources through preprocessor -ppx Pipe abstract syntax trees through preprocessor -principal Check principality of type inference -no-principal Do not check principality of type inference (default) -rectypes Allow arbitrary recursive types -no-rectypes Do not allow arbitrary recursive types (default) -remove-unused-arguments Remove unused function arguments -rounds Repeat tree optimization and inlining phases this many times (default 1). Rounds are numbered starting from zero. -runtime-variant Use the variant of the run-time system -with-runtime Include the runtime system in the generated program (default) -without-runtime Do not include the runtime system in the generated program. -S Keep intermediate assembly file -safe-string (was set when configuring the compiler) -shared Produce a dynlinkable plugin -short-paths Shorten paths in types -strict-sequence Left-hand part of a sequence must have type unit -no-strict-sequence Left-hand part of a sequence need not have type unit (default) -strict-formats Reject invalid formats accepted by legacy implementations (Warning: Invalid formats may behave differently from previous OCaml versions, and will become always-rejected in future OCaml versions. You should always use this flag to detect invalid formats so you can fix them.) -no-strict-formats Accept invalid formats accepted by legacy implementations (default) (Warning: Invalid formats may behave differently from previous OCaml versions, and will become always-rejected in future OCaml versions. You should never use this flag and instead fix invalid formats.) -thread (deprecated) same as -I +threads -unbox-closures Pass free variables via specialised arguments rather than closures -unbox-closures-factor 0> Scale the size threshold above which unbox-closures will slow down indirect calls rather than duplicating a function (default 10) -inline-max-unroll |=[,...] Unroll recursive functions at most this many times (default 0) -unboxed-types unannotated unboxable types will be unboxed -no-unboxed-types unannotated unboxable types will not be unboxed (default) -unsafe Do not compile bounds checking on array and string access -unsafe-string (option not available) -v Print compiler version and location of standard library and exit -verbose Print calls to external commands -version Print version and exit --version Print version and exit -vnum Print version number and exit -w Enable or disable warnings according to : + enable warnings in - disable warnings in @ enable warnings in and treat them as errors can be: a single warning number .. a range of consecutive warning numbers a predefined set default setting is "+a-4-6-7-9-27-29-30-32..42-44-45-48-50-60-66-67" -warn-error Enable or disable error status for warnings according to . See option -w for the syntax of . Default setting is "-a+31" -warn-help Show description of warning numbers -where Print location of standard library and exit - Treat as a file name (even if it starts with `-') -match-context-rows (advanced, see manual section 9.2.) -dno-unique-ids (undocumented) -dunique-ids (undocumented) -dsource (undocumented) -dparsetree (undocumented) -dtypedtree (undocumented) -drawlambda (undocumented) -dlambda (undocumented) -drawclambda (undocumented) -dclambda (undocumented) -dflambda Print Flambda terms -drawflambda Print Flambda terms after closure conversion -dflambda-invariants Check Flambda invariants around each pass -dflambda-no-invariants Do not Check Flambda invariants around each pass -dflambda-let Print when the given Flambda [Let] is created -dflambda-verbose Print Flambda terms including around each pass -dcmm (undocumented) -dsel (undocumented) -dcombine (undocumented) -dcse (undocumented) -dlive (undocumented) -davail Print register availability info when printing liveness -drunavail Run register availability pass (for testing only; needs -g) -dspill (undocumented) -dsplit (undocumented) -dinterf (undocumented) -dprefer (undocumented) -dalloc (undocumented) -dreload (undocumented) -dscheduling (undocumented) -dlinear (undocumented) -dinterval (undocumented) -dstartup (undocumented) -dtimings Print timings information for each pass -dprofile Print performance information for each pass The columns are: time alloc top-heap absolute-top-heap. -dump-into-file dump output like -dlambda into .dump -dump-pass Record transformations performed by these passes: unbox-closures unbox-specialised-args unbox-free-vars-of-closures remove-free-vars-equal-to-args remove-unused-arguments unused-arguments -args Read additional newline-terminated command line arguments from -args0 Read additional null character terminated command line arguments from -depend Compute dependencies (use 'ocamlopt -depend -help' for details) -help Display this list of options --help Display this list of options make[1]: *** [ubase/rx.cmi] Error 2 make: *** [text] Error 2 READ THIS: https://docs.brew.sh/Troubleshooting ```

relates to https://github.com/Homebrew/homebrew-core/pull/57386

glondu commented 4 years ago

The last 150 lines of log are not useful, as they only consist of the end of ocaml usage message. Is the full log available somewhere?

chenrui333 commented 4 years ago

yeah, I feel the same way, I actually grabbed it from the server log though.

Bo98 commented 4 years ago

Looks like the issue here is that OCaml 4.10 forbids unsafe strings by default, but unison still requires unsafe strings:

ocamlopt: OCaml has been configured with -force-safe-string: -unsafe-string is not available.

Bo98 commented 4 years ago

Looks like this is a duplicate of #316.

glondu commented 4 years ago

There is a pull request that fixes this: https://github.com/bcpierce00/unison/pull/351

glondu commented 4 years ago

There is a pull request that fixes this: #351

I've just merged it, could you confirm that unison compiles with OCaml 4.10?

t0fik commented 4 years ago

@glondu I've checked and project compiles without errors on OCaml 4.10, os Fedora 32 x86_64.