Scryer-prolog: Compilation error when installing scryer-prolog

Created on 16 May 2020  路  6Comments  路  Source: mthom/scryer-prolog

I'm getting the following compilation errors when trying to cargo install scryer-prolog today (May 16).

Can post system details if needed.

    Updating crates.io index
 Downloading crates ...
  Downloaded scryer-prolog v0.8.120
  Installing scryer-prolog v0.8.120
 Downloading crates ...
  Downloaded prolog_parser v0.8.57
  Downloaded libc v0.2.70
  Downloaded ref_thread_local v0.0.0
  Downloaded lazy_static v1.4.0
  Downloaded indexmap v1.3.2
  Downloaded downcast v0.10.0
  Downloaded nix v0.15.0
  Downloaded dirs v2.0.2
  Downloaded rustyline v6.1.2
  Downloaded crossterm v0.16.0
  Downloaded rug v1.8.0
  Downloaded git-version v0.3.4
  Downloaded ordered-float v0.5.2
  Downloaded cfg-if v0.1.10
  Downloaded autocfg v1.0.0
  Downloaded utf8parse v0.2.0
  Downloaded nix v0.17.0
  Downloaded lexical v2.2.2
  Downloaded unicode_reader v1.0.0
  Downloaded bitflags v1.2.1
  Downloaded memchr v2.3.3
  Downloaded unicode-segmentation v1.6.0
  Downloaded unicode-width v0.1.7
  Downloaded log v0.4.8
  Downloaded void v1.0.2
  Downloaded dirs-sys v0.3.4
  Downloaded parking_lot v0.10.2
  Downloaded rustc_version v0.2.3
  Downloaded num-traits v0.1.43
  Downloaded git-version-macro v0.3.4
  Downloaded mio v0.6.22
  Downloaded unreachable v1.0.0
  Downloaded signal-hook v0.1.15
  Downloaded az v0.3.1
  Downloaded lexical-core v0.4.6
  Downloaded smallvec v0.6.13
  Downloaded proc-macro-hack v0.5.15
  Downloaded iovec v0.1.4
  Downloaded lock_api v0.3.4
  Downloaded proc-macro2 v1.0.13
  Downloaded num-traits v0.2.11
  Downloaded net2 v0.2.34
  Downloaded signal-hook-registry v1.2.0
  Downloaded quote v1.0.5
  Downloaded semver v0.9.0
  Downloaded syn v1.0.22
  Downloaded parking_lot_core v0.7.2
  Downloaded slab v0.4.2
  Downloaded semver-parser v0.7.0
  Downloaded static_assertions v0.3.4
  Downloaded ryu v1.0.4
  Downloaded arrayvec v0.4.12
  Downloaded maybe-uninit v2.0.0
  Downloaded arc-swap v0.4.6
  Downloaded scopeguard v1.1.0
  Downloaded gmp-mpfr-sys v1.2.2
  Downloaded smallvec v1.4.0
  Downloaded nodrop v0.1.14
  Downloaded unicode-xid v0.2.0
   Compiling libc v0.2.70
   Compiling cfg-if v0.1.10
   Compiling autocfg v1.0.0
   Compiling semver-parser v0.7.0
   Compiling void v1.0.2
   Compiling proc-macro2 v1.0.13
   Compiling log v0.4.8
   Compiling bitflags v1.2.1
   Compiling gmp-mpfr-sys v1.2.2
   Compiling arrayvec v0.4.12
   Compiling unicode-xid v0.2.0
   Compiling maybe-uninit v2.0.0
   Compiling ryu v1.0.4
   Compiling nodrop v0.1.14
   Compiling syn v1.0.22
   Compiling nix v0.17.0
   Compiling arc-swap v0.4.6
   Compiling smallvec v1.4.0
   Compiling memchr v2.3.3
   Compiling scopeguard v1.1.0
   Compiling static_assertions v0.3.4
   Compiling rug v1.8.0
   Compiling unicode-segmentation v1.6.0
   Compiling slab v0.4.2
   Compiling proc-macro-hack v0.5.15
   Compiling nix v0.15.0
   Compiling az v0.3.1
   Compiling lazy_static v1.4.0
   Compiling unicode-width v0.1.7
   Compiling utf8parse v0.2.0
   Compiling downcast v0.10.0
   Compiling ref_thread_local v0.0.0
   Compiling semver v0.9.0
   Compiling num-traits v0.2.11
   Compiling indexmap v1.3.2
   Compiling unreachable v1.0.0
   Compiling lock_api v0.3.4
   Compiling rustc_version v0.2.3
   Compiling net2 v0.2.34
   Compiling iovec v0.1.4
   Compiling signal-hook-registry v1.2.0
   Compiling parking_lot_core v0.7.2
   Compiling dirs-sys v0.3.4
   Compiling lexical-core v0.4.6
   Compiling lexical v2.2.2
   Compiling quote v1.0.5
   Compiling smallvec v0.6.13
   Compiling mio v0.6.22
   Compiling parking_lot v0.10.2
   Compiling dirs v2.0.2
   Compiling num-traits v0.1.43
   Compiling scryer-prolog v0.8.120
   Compiling unicode_reader v1.0.0
   Compiling signal-hook v0.1.15
   Compiling rustyline v6.1.2
   Compiling ordered-float v0.5.2
   Compiling git-version-macro v0.3.4
   Compiling crossterm v0.16.0
   Compiling git-version v0.3.4
   Compiling prolog_parser v0.8.57
error[E0308]: mismatched types
  --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/compile.rs:82:9
   |
82 |         &mut parsing_stream(stream),
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
   |
   = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
              found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/compile.rs:376:9
    |
376 |         &mut parsing_stream(src),
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
    |
    = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
               found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
    --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/compile.rs:1345:64
     |
1345 |     let results = try_eval_session!(compiler.gather_items(wam, src, &mut indices));
     |                                                                ^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
     |
     = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
                found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
    --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/compile.rs:1365:50
     |
1365 |     let mut results = compiler.gather_items(wam, src, &mut indices)?;
     |                                                  ^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
     |
     = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
                found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/machine_state.rs:504:13
    |
504 |             &mut parsing_stream(current_input_stream.clone()),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
    |
    = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
               found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
    --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/machine_state.rs:1117:21
     |
1117 |                     &mut parsing_stream(current_input_stream.clone()),
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
     |
     = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
                found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/term_expansion.rs:222:38
    |
222 |         let mut parser = Parser::new(&mut stream, self.parser.get_atom_tbl(), self.flags);
    |                                      ^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
    |
    = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<_>>>`
               found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<&[u8]>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/system_calls.rs:604:38
    |
604 |         let mut parser = Parser::new(&mut stream, indices.atom_tbl.clone(), self.machine_flags());
    |                                      ^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
    |
    = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<_>>>`
               found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<std::io::Cursor<std::string::String>>>>, prolog_parser::ast::ParserError>`

error[E0599]: no method named `next` found for enum `std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>` in the current scope
    --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/system_calls.rs:1441:35
     |
1441 |                 let result = iter.next();
     |                                   ^^^^ method not found in `std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error[E0308]: mismatched types
    --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scryer-prolog-0.8.120/src/prolog/machine/system_calls.rs:3025:29
     |
3025 | ...                   &mut parsing_stream(Stream::from(chars)),
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `prolog_parser::put_back_n::PutBackN`, found enum `std::result::Result`
     |
     = note: expected mutable reference `&mut prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>`
                found mutable reference `&mut std::result::Result<prolog_parser::put_back_n::PutBackN<unicode_reader::codepoints::CodePoints<std::io::Bytes<prolog::machine::streams::Stream>>>, prolog_parser::ast::ParserError>`

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: failed to compile `scryer-prolog v0.8.120`, intermediate artifacts can be found at `/tmp/cargo-installiiUeWv`

Caused by:
  could not compile `scryer-prolog`.

To learn more, run the command again with --verbose.
The command '/bin/sh -c cargo install scryer-prolog' returned a non-zero code: 101

P.S. I'm blown away with how much work has been done! Looking at the features, I think I'm ready to switch fully over to Scryer. Great job Mark!

Most helpful comment

To be more precise than today, say git describe

All 6 comments

Could you please show the output of cargo --version?

I have had good luck with rustup from: https://rustup.rs/

Also, it is best to build directly from source:

$> git clone https://github.com/mthom/scryer-prolog
$> cd scryer-prolog
$> cargo run --release

This always yields the latest version in target/release/scryer-prolog.

As @triska said an alternative way to cargo install scryer-prolog can be:

$ git clone https://github.com/mthom/scryer-prolog
$ cd scryer-prolog
$ cargo install --path .

The reason you have that error is due to the way dependency must be specified (documentation). A publication may solve this issue.

To be more precise than today, say git describe

Thank you all, compiling from source worked!

I managed to create a scryer-prolog Docker image based on https://hub.docker.com/_/rust

I will submit a pull request with the Dockerfile once I iron out the bugs. This is letting me run Scryer Prolog on a Windows host using Docker Desktop:

scryer-prolog> docker run -a stdin -a stdout -it scryer-prolog
?- use_module(library(reif)).
   true.
?-

Could you please show the output of cargo --version?

I have had good luck with rustup from: https://rustup.rs/

The output of cargo version is cargo 1.43.0 (2cbe9048e 2020-05-03). It's the official Rust Docker image.

Thank you for pointing this out, Aram. I published a new version of Scryer to cargo, and it should now build.

I'm flattered by your kind words! Many other people have helped Scryer get this far, this quickly, so I can't take all the credit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mkohlhaas picture mkohlhaas  路  3Comments

triska picture triska  路  4Comments

triska picture triska  路  3Comments

XVilka picture XVilka  路  3Comments

srenatus picture srenatus  路  4Comments