gfngfn / SATySFi

A statically-typed, functional typesetting system
GNU Lesser General Public License v3.0
1.16k stars 83 forks source link

Byte-compiler supported version won't compile on macOS with ruby-2.5.0 #83

Closed konn closed 6 years ago

konn commented 6 years ago

Following the following code on macOS High Sierra 10.13.4, it fails to compile the SATySFi:

$ opam update
$ opam install SATySFi

=-=- Synchronising pinned packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[satysfi] /Users/me/github/SATySFi/ already up-to-date
The following actions will be performed:
  ∗  install satysfi *

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[satysfi.~unknown] /Users/me/github/SATySFi/ already up-to-date

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[ERROR] The compilation of satysfi failed at "make -f Makefile
        PREFIX=/Users/me/.opam/4.06.0".
Processing  1/1: [satysfi: make Makefile]
#=== ERROR while installing satysfi.~unknown ==================================#
# opam-version 1.2.2
# os           darwin
# command      make -f Makefile PREFIX=/Users/me/.opam/4.06.0
# path         /Users/me/.opam/4.06.0/build/satysfi.~unknown
# compiler     4.06.0
# exit-code    2
# env-file     /Users/me/.opam/4.06.0/build/satysfi.~unknown/satysfi-38561-05296d.env
# stdout-file  /Users/me/.opam/4.06.0/build/satysfi.~unknown/satysfi-38561-05296d.out
# stderr-file  /Users/me/.opam/4.06.0/build/satysfi.~unknown/satysfi-38561-05296d.err
### stdout ###
# ruby ./gen_code.rb --gen-insttype src/frontend/bytecomp/vminstdef.yaml > src/frontend/__insttype.ml
### stderr ###
# ./gen_code.rb:166:in `gen_insttype': undefined method `load_documents' for Psych:Module (NoMethodError)
# Did you mean?  load_stream
#   from ./gen_code.rb:254:in `call'
#   from ./gen_code.rb:254:in `<main>'
# make: *** [src/frontend/types_.ml] Error 1

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
The following actions failed
  ∗  install satysfi ~unknown
No changes have been performed

environments

$ opam switch
--     -- 3.07    Official 3.07 release
... [snip] ...
4.06.0  C 4.06.0  Official 4.06.0 release
--     -- 4.06.1  Official 4.06.1 release
system  I system  System compiler (4.06.0)
# 197 more patched or experimental compilers, use '--all' to show

$ opam --version
1.2.2

$ opam repository
  10 [git]   satysfi-external     https://github.com/gfngfn/satysfi-external-repo.git
   0 [http]     default     https://opam.ocaml.org

$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]

$ gem list psych
*** LOCAL GEMS ***
psych (default: 3.0.2)
gfngfn commented 6 years ago

Though I cannot immediately suggest a solution, it seems that Psych.load_documents(...) is deprecated and that this causes the error.

matsud224 commented 6 years ago

According to the reference manual, 'load_documents' was removed in Ruby 2.5.0. I simply replaced `load_documents' with 'load_stream' and it worked.

gfngfn commented 6 years ago

I pushed a commit where all YAML.load_documentss in gen_code.rb are replaced with YAML.load_stream (871c286bef74d2a421b19f2b1211752b9c7daafd). It seems that new gen_code.rb works fine. Please try it.

konn commented 6 years ago

It seems that the error related ruby vanished, but still failing compilation due to another reason. Should I have to open a new issue?

konn commented 6 years ago

It seems that new error isn't related to Ruby, so I will open a new issue. Thanks!