imaon2 icon indicating copy to clipboard operation
imaon2 copied to clipboard

Error when building

Open conradev opened this issue 7 years ago • 14 comments

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 avatar Feb 25 '17 01:02 conradev

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 😄

conradev avatar Feb 25 '17 07:02 conradev

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 avatar Mar 15 '17 07:03 banxian

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)

banxian avatar Mar 15 '17 11:03 banxian

lol dis-simple-straw is in the attic

Luiz-Monad avatar Nov 04 '19 17:11 Luiz-Monad

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...

Luiz-Monad avatar Nov 04 '19 18:11 Luiz-Monad

yay, Rust backwards incompatibility.

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

comex avatar Nov 05 '19 03:11 comex

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

NSExceptional avatar Mar 08 '20 19:03 NSExceptional

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?

shinvou avatar Apr 15 '20 12:04 shinvou

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. :)

comex avatar Apr 16 '20 07:04 comex

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.

shinvou avatar Apr 16 '20 08:04 shinvou

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

comex avatar Apr 16 '20 08:04 comex

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

shinvou avatar Apr 16 '20 08:04 shinvou

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).

comex avatar Apr 16 '20 08:04 comex

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

shinvou avatar Apr 16 '20 09:04 shinvou