NOP0 / rustmatic

PLC programming in Rust!
Apache License 2.0
35 stars 2 forks source link

Cannot compile #45

Closed hanusek closed 3 years ago

hanusek commented 3 years ago

Hello. I have a problem with compile.

Log 1:

mhanusek@EtHanusek:~/work/VersionControl/rustmatic$ cargo +1.49.0 b
   Compiling proc-macro2 v1.0.9
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.16
   Compiling cfg-if v0.1.10
   Compiling semver-parser v0.7.0
   Compiling libc v0.2.67
   Compiling autocfg v1.0.0
   Compiling maybe-uninit v2.0.0
   Compiling serde v1.0.104
   Compiling lazy_static v1.4.0
   Compiling scopeguard v1.1.0
   Compiling ryu v1.0.2
   Compiling log v0.4.8
   Compiling getrandom v0.1.14
   Compiling itoa v0.4.5
   Compiling failure_derive v0.1.6
   Compiling cranelift-entity v0.44.0
   Compiling cc v1.0.50
   Compiling byteorder v1.3.4
   Compiling cranelift-codegen-shared v0.44.0
   Compiling rayon-core v1.7.0
   Compiling bitflags v1.2.1
   Compiling arrayvec v0.5.1
   Compiling either v1.5.3
   Compiling typenum v1.11.2
   Compiling arrayref v0.3.6
   Compiling constant_time_eq v0.1.5
   Compiling nix v0.15.0
   Compiling proc-macro2 v0.4.30
   Compiling void v1.0.2
   Compiling wasmparser v0.39.3
   Compiling unicode-xid v0.1.0
   Compiling autocfg v0.1.7
   Compiling ucd-trie v0.1.2
   Compiling hex v0.3.2
   Compiling syn v0.15.44
   Compiling ppv-lite86 v0.2.6
   Compiling maplit v1.0.2
   Compiling arrayvec v0.4.12
   Compiling nodrop v0.1.14
   Compiling mopa v0.2.2
   Compiling atom v0.3.5
   Compiling slotmap v0.4.0
   Compiling quick-error v1.2.3
   Compiling anymap v0.12.1
   Compiling anyhow v1.0.26
   Compiling unicode-segmentation v1.6.0
   Compiling tuple_utils v0.3.0
   Compiling shrev v1.1.1
   Compiling remove_dir_all v0.5.2
   Compiling semver v0.9.0
   Compiling crossbeam-utils v0.6.6
   Compiling lock_api v0.3.3
   Compiling crossbeam-utils v0.7.2
   Compiling crossbeam-epoch v0.8.2
   Compiling indexmap v1.3.2
   Compiling cranelift-bforest v0.44.0
   Compiling cranelift-codegen-meta v0.44.0
   Compiling rustmatic-iec-std v0.1.0 (/home/mhanusek/work/VersionControl/rustmatic/iec-std)
   Compiling blake2b_simd v0.5.10
   Compiling pest v2.1.3
   Compiling hashbrown v0.6.3
   Compiling c2-chacha v0.2.3
   Compiling humantime v1.3.0
   Compiling codespan v0.5.0
   Compiling rustc_version v0.2.3
   Compiling crossbeam-queue v0.1.2
   Compiling pest_meta v2.1.3
   Compiling quote v1.0.2
   Compiling memoffset v0.5.3
   Compiling parking_lot_core v0.6.2
   Compiling raw-cpuid v6.1.0
   Compiling parking_lot v0.9.0
   Compiling wasmer-runtime-core v0.11.0 (https://github.com/wasmerio/wasmer?rev=8a13917ec5b327d47b302c4002553d279536db54#8a13917e)
   Compiling smallvec v0.6.13
   Compiling num_cpus v1.12.0
   Compiling errno v0.2.4
   Compiling page_size v0.4.2
   Compiling memmap v0.7.0
   Compiling rustmatic-core v0.1.0 (/home/mhanusek/work/VersionControl/rustmatic/core)
warning: unused import: `AdressNumber`
 --> core/src/process_image.rs:1:38
  |
1 | use crate::{DeviceID, DeviceManager, AdressNumber};
  |                                      ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `slotmap::DenseSlotMap`
 --> core/src/process_image.rs:3:5
  |
3 | use slotmap::DenseSlotMap;
  |     ^^^^^^^^^^^^^^^^^^^^^

warning: unused `std::result::Result` that must be used
   --> core/src/process_image.rs:199:29
    |
199 | ...                   devices.write::<bool>(device_id, <bool>::read(self, (byte, bit)));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_must_use)]` on by default
    = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
   --> core/src/process_image.rs:202:29
    |
202 | ...                   devices.write::<u8>(device_id, <u8>::read(self, offset));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
   --> core/src/process_image.rs:205:29
    |
205 | ...                   devices.write::<u16>(device_id, <u16>::read(self, offset));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
   --> core/src/process_image.rs:208:29
    |
208 | ...                   devices.write::<u32>(device_id, <u32>::read(self, offset));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled

   Compiling generic-array v0.12.3
   Compiling quote v0.6.13
warning: 6 warnings emitted

   Compiling rand_core v0.5.1
   Compiling crossbeam-queue v0.2.1
   Compiling rustmatic-dummy-input v0.1.0 (/home/mhanusek/work/VersionControl/rustmatic/dummy-input)
   Compiling digest v0.8.1
   Compiling rand_chacha v0.2.1
   Compiling cranelift-codegen v0.44.0
   Compiling rand v0.7.3
   Compiling synstructure v0.12.3
   Compiling pest_generator v2.1.2
   Compiling crossbeam-deque v0.7.3
   Compiling tempfile v3.1.0
   Compiling derivative v1.0.3
   Compiling rayon v1.3.0
   Compiling serde_derive v1.0.104
   Compiling proc-macro-hack v0.5.11
   Compiling thiserror-impl v1.0.11
   Compiling pest_derive v2.1.0
   Compiling specs-derive v0.4.1
   Compiling hibitset v0.6.3
   Compiling failure v0.1.6
   Compiling const-random-macro v0.1.8
   Compiling rustmatic-structured-text v0.1.0 (/home/mhanusek/work/VersionControl/rustmatic/structured-text)
error: proc-macro derive panicked
 --> structured-text/src/parser.rs:5:10
  |
5 | #[derive(pest_derive::Parser)]
  |          ^^^^^^^^^^^^^^^^^^^
  |
  = help: message: error parsing 
            --> 51:56
             |
          51 | duration                    = { ("TIME" | "T") ~ "#" ~ } ␊
             |                                                        ^---
             |
             = expected term

error[E0432]: unresolved import `crate::parser::Rule`
 --> structured-text/src/ast.rs:2:25
  |
2 |     parser::{RawParser, Rule},
  |                         ^^^^ no `Rule` in `parser`

error[E0432]: unresolved import `crate::parser::Rule`
 --> structured-text/src/error.rs:1:5
  |
1 | use crate::parser::Rule;
  |     ^^^^^^^^^^^^^^^^^^^ no `Rule` in `parser`

error[E0432]: unresolved import `crate::parser::Rule`
  --> structured-text/src/lib.rs:24:32
   |
24 | use crate::parser::{RawParser, Rule};
   |                                ^^^^ no `Rule` in `parser`

error[E0599]: no function or associated item named `parse` found for struct `RawParser` in the current scope
  --> structured-text/src/lib.rs:29:25
   |
29 |     let _p = RawParser::parse(Rule::program, src)?;
   |                         ^^^^^ function or associated item not found in `RawParser`
   | 
  ::: structured-text/src/parser.rs:7:1
   |
7  | pub struct RawParser;
   | --------------------- function or associated item `parse` not found for this
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `parse`, perhaps you need to implement it:
           candidate #1: `Parser`

error[E0599]: no function or associated item named `parse` found for struct `RawParser` in the current scope
   --> structured-text/src/ast.rs:732:48
    |
732 |                       let mut pairs = RawParser::parse(Rule::$rule, src)?;
    |                                                  ^^^^^ function or associated item not found in `RawParser`
...
741 | / impl_from_str! {
742 | |     Identifier => identifier,
743 | |     Assignment => assignment,
744 | |     VariableDeclaration => variable_decl,
...   |
758 | |     Conditional => conditional,
759 | | }
    | |_- in this macro invocation
    | 
   ::: structured-text/src/parser.rs:7:1
    |
7   |   pub struct RawParser;
    |   --------------------- function or associated item `parse` not found for this
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `parse`, perhaps you need to implement it:
            candidate #1: `Parser`
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed for `ErrorVariant<R>`
  --> structured-text/src/error.rs:22:23
   |
22 |         let variant = ErrorVariant::CustomError {
   |             -------   ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `R` declared on the enum `ErrorVariant`
   |             |
   |             consider giving `variant` the explicit type `ErrorVariant<R>`, where the type parameter `R` is specified

warning: unused import: `Parser`
 --> structured-text/src/ast.rs:6:29
  |
6 | use pest::{iterators::Pair, Parser};
  |                             ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `pest::Parser`
  --> structured-text/src/lib.rs:25:5
   |
25 | use pest::Parser as _;
   |     ^^^^^^^^^^^^

error: aborting due to 7 previous errors; 2 warnings emitted

Some errors have detailed explanations: E0282, E0432, E0599.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `rustmatic-structured-text`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
mhanusek@EtHanusek:~/work/VersionControl/rustmatic$ 

Log 2:

mhanusek@EtHanusek:~/work/VersionControl/rustmatic$ cargo +1.54.0 b
warning: unused import: `AdressNumber`
 --> core/src/process_image.rs:1:38
  |
1 | use crate::{DeviceID, DeviceManager, AdressNumber};
  |                                      ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `slotmap::DenseSlotMap`
 --> core/src/process_image.rs:3:5
  |
3 | use slotmap::DenseSlotMap;
  |     ^^^^^^^^^^^^^^^^^^^^^

warning: unused `Result` that must be used
   --> core/src/process_image.rs:199:29
    |
199 | ...                   devices.write::<bool>(device_id, <bool>::read(self, (byte, bit)));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_must_use)]` on by default
    = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `Result` that must be used
   --> core/src/process_image.rs:202:29
    |
202 | ...                   devices.write::<u8>(device_id, <u8>::read(self, offset));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `Result` that must be used
   --> core/src/process_image.rs:205:29
    |
205 | ...                   devices.write::<u16>(device_id, <u16>::read(self, offset));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `Result` that must be used
   --> core/src/process_image.rs:208:29
    |
208 | ...                   devices.write::<u32>(device_id, <u32>::read(self, offset));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled

warning: 6 warnings emitted

   Compiling serde v1.0.104
   Compiling thiserror v1.0.11
   Compiling const-random v0.1.8
   Compiling rustmatic-structured-text v0.1.0 (/home/mhanusek/work/VersionControl/rustmatic/structured-text)
error: proc-macro derive panicked
 --> structured-text/src/parser.rs:5:10
  |
5 | #[derive(pest_derive::Parser)]
  |          ^^^^^^^^^^^^^^^^^^^
  |
  = help: message: error parsing 
            --> 51:56
             |
          51 | duration                    = { ("TIME" | "T") ~ "#" ~ } ␊
             |                                                        ^---
             |
             = expected term

error[E0432]: unresolved import `crate::parser::Rule`
 --> structured-text/src/ast.rs:2:25
  |
2 |     parser::{RawParser, Rule},
  |                         ^^^^ no `Rule` in `parser`

error[E0432]: unresolved import `crate::parser::Rule`
 --> structured-text/src/error.rs:1:5
  |
1 | use crate::parser::Rule;
  |     ^^^^^^^^^^^^^^^^^^^ no `Rule` in `parser`

error[E0432]: unresolved import `crate::parser::Rule`
  --> structured-text/src/lib.rs:24:32
   |
24 | use crate::parser::{RawParser, Rule};
   |                                ^^^^ no `Rule` in `parser`

   Compiling ahash v0.2.18
error[E0599]: no function or associated item named `parse` found for struct `RawParser` in the current scope
  --> structured-text/src/lib.rs:29:25
   |
29 |     let _p = RawParser::parse(Rule::program, src)?;
   |                         ^^^^^ function or associated item not found in `RawParser`
   | 
  ::: structured-text/src/parser.rs:7:1
   |
7  | pub struct RawParser;
   | --------------------- function or associated item `parse` not found for this
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `parse`, perhaps you need to implement it:
           candidate #1: `Parser`

error[E0599]: no function or associated item named `parse` found for struct `RawParser` in the current scope
   --> structured-text/src/ast.rs:732:48
    |
732 |                       let mut pairs = RawParser::parse(Rule::$rule, src)?;
    |                                                  ^^^^^ function or associated item not found in `RawParser`
...
741 | / impl_from_str! {
742 | |     Identifier => identifier,
743 | |     Assignment => assignment,
744 | |     VariableDeclaration => variable_decl,
...   |
758 | |     Conditional => conditional,
759 | | }
    | |_- in this macro invocation
    | 
   ::: structured-text/src/parser.rs:7:1
    |
7   |   pub struct RawParser;
    |   --------------------- function or associated item `parse` not found for this
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `parse`, perhaps you need to implement it:
            candidate #1: `Parser`
    = note: this error originates in the macro `impl_from_str` (in Nightly builds, run with -Z macro-backtrace for more info)

   Compiling hashbrown v0.6.3
error[E0282]: type annotations needed for `ErrorVariant<R>`
  --> structured-text/src/error.rs:22:23
   |
22 |         let variant = ErrorVariant::CustomError {
   |             -------   ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `R` declared on the enum `ErrorVariant`
   |             |
   |             consider giving `variant` the explicit type `ErrorVariant<R>`, where the type parameter `R` is specified

warning: unused import: `Parser`
 --> structured-text/src/ast.rs:6:29
  |
6 | use pest::{iterators::Pair, Parser};
  |                             ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `pest::Parser`
  --> structured-text/src/lib.rs:25:5
   |
25 | use pest::Parser as _;
   |     ^^^^^^^^^^^^

error: aborting due to 7 previous errors; 2 warnings emitted

Some errors have detailed explanations: E0282, E0432, E0599.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `rustmatic-structured-text`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
mhanusek@EtHanusek:~/work/VersionControl/rustmatic$ 
NOP0 commented 3 years ago

@hanusek Hi, I'm not actively working on this repo at the moment, I believe the scope was maybe too big, with structured text, wasm and everything. What do you think about this?

hanusek commented 3 years ago

@hanusek Hi, I'm not actively working on this repo at the moment, I believe the scope was maybe too big, with structured text, wasm and everything. What do you think about this?

I think the project is very cool. But now I have a problem with compile. I would like to develop and use him for my targets.

hanusek commented 3 years ago

@NOP0 @Michael-F-Bryan Can you help me?

NOP0 commented 3 years ago

@hanusek , could you please try again now. There was an error in the grammar file. Thanks.

hanusek commented 3 years ago
cargo test

...

error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `arrayvec`

To learn more, run the command again with --verbose.
test wasm_poll ... FAILED

failures:

---- wasm_poll stdout ----
thread 'wasm_poll' panicked at 'called `Result::unwrap()` on an `Err` value: Unable to compile the WASM

Caused by:
    Compilation failed', runtime/tests/wasm-program.rs:38:71
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    wasm_poll

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '-p rustmatic-runtime --test wasm-program'
Michael-F-Bryan commented 3 years ago
error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed      <-----

You forgot to install the WebAssembly target.

$ rustup target add wasm32-unknown-unknown
hanusek commented 3 years ago

@Michael-F-Bryan thank you.