comex / imaon2

Other
34 stars 10 forks source link

Error when building #5

Open conradev opened 7 years ago

conradev commented 7 years ago

I get the following when I try to build:

$ CARGO_TARGET_DIR=target cargo build --manifest-path src/yasce/Cargo.toml
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to load source for a dependency on `dis_simple_trawl`

Caused by:
  Unable to update file:///Users/conradev/Desktop/imaon2/src/dis-simple_trawl

Caused by:
  failed to read `/Users/conradev/Desktop/imaon2/src/dis-simple_trawl/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

It seems like dis-simple_trawl is missing, which fmt-macho_dsc_extraction depends on 😮

conradev commented 7 years ago

Also, the build files checked in to git use a local version of libbindgen instead of a remote version. I will submit a PR with build fixes 😄

banxian commented 7 years ago

I meet the same problem yesterday. dis-simple_trawl seems not used in code I just removed them from toml. but when change local libbindgen to remote yanked one (version="0.1.7"), I got such error like:

error: no matching package named libbindgen found (required by build_help) location searched: registry https://github.com/rust-lang/crates.io-index version required: ^0.1.7

should I use bindgen instead libbindgen? I guess the local copy in servo-bindgen/libbindgen may have some private modification, or just because can't use a yanked crate remotely. I want to know your pull request to lean how to fix it

banxian commented 7 years ago

after change libbindgen to bindgen and fix some rs I stopped at src\dis-generated_jump_dis, because build.rs is missing. (specified in Cargo.toml but not in git repo)

Luiz-Monad commented 4 years ago

lol dis-simple-straw is in the attic

Luiz-Monad commented 4 years ago

yay, I got

error[E0503]: cannot use `state` because it was mutably borrowed
   --> /Users/ohanar/Downloads/devtools/imaon2/src/bsdlike_getopts/bsdlike_getopts.rs:947:9
    |
881 |     let mut machine = |cont: &mut bool, (i, c): (usize, char)| -> bool {
    |                       ------------------------------------------------ borrow of `state` occurs here
...
893 |         state = match (state, whitespace, limit) {
    |                        ----- borrow occurs due to use of `state` in closure
...
947 |         B | C => true,
    |         ^ use of borrowed `state`
...
950 |         machine(&mut cont, (fake_i, ' '));
    |         ------- borrow later used here

error: aborting due to previous error

It was a nice try thou...

comex commented 4 years ago

yay, Rust backwards incompatibility.

I pushed a quick fix; haven't tested it though.

NSExceptional commented 4 years ago

@comex Can you commit Cargo.lock to the repo?

shinvou commented 4 years ago

I'm also trying to build and I've come very far (94/98 build tasks), but I'm getting these errors when trying to build fmt_macho. I'm not used to code in rust, so I don't know what to do here.

error[E0277]: the trait bound `macho_bind::dyld_cache_local_symbols_entry: util::Swap` is not satisfied
   --> /Users/shinvou/Desktop/imaon2/src/fmt-macho/dyldcache.rs:538:61
    |
538 |                 let entry: dyld_cache_local_symbols_entry = util::copy_from_slice(entry_slice, self.eb.endian);
    |                                                             ^^^^^^^^^^^^^^^^^^^^^ the trait `util::Swap` is not implemented for `macho_bind::dyld_cache_local_symbols_entry`
    |
   ::: /Users/shinvou/Desktop/imaon2/src/util/util.rs:126:38
    |
126 | pub fn copy_from_slice<'a, T: Copy + Swap, S: ?Sized + ROSlicePtr<u8>>(slice: &S, end: Endian) -> T {
    |                                      ---- required by this bound in `util::copy_from_slice`

Any ideas? @comex maybe?

comex commented 4 years ago

I don't know why you guys are trying to build my crappy old code. ;) Especially since I forgot to check in parts of it. Sorry.

But since you're nice enough to try, I added the missing bits, including Cargo.lock, and fixed up the build. I haven't tried running yasce since I forget how it works, but I hope that's at least somewhat helpful. :)

shinvou commented 4 years ago

I don't know why you guys are trying to build my crappy old code. ;) Especially since I forgot to check in parts of it. Sorry.

But since you're nice enough to try, I added the missing bits, including Cargo.lock, and fixed up the build. I haven't tried running yasce since I forget how it works, but I hope that's at least somewhat helpful. :)

That's very nice of you, thanks. I still got the problem, that the error persists. Is it possible to push a quick fix? I guess the error exists because macho_bind.rs is missing the Swap function for other structs.

comex commented 4 years ago

Can you post your copy of ./target/release/build/fmt_macho_bind-\<some junk>/out/out.rs?

shinvou commented 4 years ago

Sure, here you go: https://pastebin.com/vtw8DCGv

comex commented 4 years ago

Oh, I see. Yeah... it was probably a bad idea to have my build script use a regex to fix up bindgen's output. :) To be fair, none of the options available at the time were great. If I were doing it now I'd use syn...

Anyway, it seems like bindgen silently detects whether rustfmt is installed. If so, it runs its output through it and you get a readable out.rs; if not, you get the horrid formatting shown in your paste. Normally this would only be a cosmetic issue, but the aforementioned regex is whitespace-sensitive.

Maybe someday I'll fix it properly. But for now, try rustup component add rustfmt and then redoing the build (might require manually cleaning).

shinvou commented 4 years ago

Alright, thank you so much for your help! Successfully built.