CasualX / pelite

Lightweight, memory-safe, zero-allocation library for reading and navigating PE binaries.
MIT License
280 stars 42 forks source link

Sample does not work since last pull (master) #235

Closed olibanjoli closed 4 years ago

olibanjoli commented 4 years ago

just pulled all updates on master. sample does not work anymore.

F:\git\pelite>cargo run --example readme --verbose
       Fresh rand_core v0.4.2
       Fresh derive_pod v0.1.0
   Compiling pelite-macros v0.1.0 (F:\git\pelite\src\proc-macros)
       Fresh lde v0.3.0
       Fresh format_xml v0.1.4
     Running `rustc --edition=2018 --crate-name pelite_macros src\proc-macros\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C debuginfo=2 -C metadata=151799de88e00789 -C extra-filename=-151799de88e00789 --out-dir F:\git\pelite\target\debug\deps -C incremental=F:\git\pelite\target\debug\incremental -L dependency=F:\git\pelite\target\debug\deps`
       Fresh winapi v0.3.8
       Fresh rand_core v0.3.1
       Fresh dataview v0.1.1
       Fresh rand v0.5.6
warning: Hard linking files in the incremental compilation cache failed. Copying files instead. Consider moving the cache directory to a file system which supports hard linking in session dir `\\?\F:\git\pelite\target\debug\incremental\pelite_macros-2q51qzau2rdk2\s-foffd03rb1-1m2wgq5-working`

error[E0432]: unresolved import `proc_macro`
 --> src\proc-macros\lib.rs:1:5
  |
1 | use proc_macro::*;
  |     ^^^^^^^^^^ use of undeclared type or module `proc_macro`

error[E0412]: cannot find type `TokenStream` in this scope
  --> src\proc-macros\lib.rs:15:33
   |
15 | pub fn pattern_attribute(_args: TokenStream, input: TokenStream) -> TokenStream {
   |                                 ^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `TokenStream` in this scope
  --> src\proc-macros\lib.rs:15:53
   |
15 | pub fn pattern_attribute(_args: TokenStream, input: TokenStream) -> TokenStream {
   |                                                     ^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `TokenStream` in this scope
  --> src\proc-macros\lib.rs:15:69
   |
15 | pub fn pattern_attribute(_args: TokenStream, input: TokenStream) -> TokenStream {
   |                                                                     ^^^^^^^^^^^ not found in this scope

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0412, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `pelite-macros`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name pelite_macros src\proc-macros\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C debuginfo=2 -C metadata=151799de88e00789 -C extra-filename=-151799de88e00789 --out-dir F:\git\pelite\target\debug\deps -C incremental=F:\git\pelite\target\debug\incremental -L dependency=F:\git\pelite\target\debug\deps` (exit code: 1)
CasualX commented 4 years ago

Hey, thanks for taking interest in pelite!

Unfortunately I cannot reproduce your error. The error itself is odd and comes from being unable to find proc_macros crate in a proc macro. I don't get how this is possible. Perhaps you're using a weird or old version of rustc?

Can you include the output of rustc -vV && cargo -vV? Eg. for me this outputs:

rustc 1.44.0 (49cae5576 2020-06-01)
binary: rustc
commit-hash: 49cae55760da0a43428eba73abcb659bb70cf2e4
commit-date: 2020-06-01
host: x86_64-pc-windows-msvc
release: 1.44.0
LLVM version: 9.0
cargo 1.44.0 (05d080faa 2020-05-06)
release: 1.44.0
commit-hash: 05d080faa4f2bc1e389ea7c4fd8f30ed2b733a7f
commit-date: 2020-05-06
olibanjoli commented 4 years ago

i really like pelite :)

yeah something was wrong with my local installation. i did rustup and it didnt work with stable and unstable channels. after a complete reinstall everything works again. sorry for bothering u.