Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find btree_map in alloc #94

Closed
gz opened this issue Jul 17, 2018 · 2 comments
Closed

Could not find btree_map in alloc #94

gz opened this issue Jul 17, 2018 · 2 comments

Comments

@gz
Copy link

gz commented Jul 17, 2018

Hmm ok filing an issue since I don't quite understand the interaction here...
If I compile goblin 8bbbcf5 directly with cargo +nightly build --no-default-features --features alloc it works fine.

If I try to compile the object crate with the goblin dependency declared as follows:

[dependencies.goblin]
git = "https://github.com/m4b/goblin"
default-features = false
features = ["alloc", "endian_fd", "elf32", "elf64", "mach32", "mach64", "pe32", "pe64", "archive"]

Using cargo +nightly build --no-default-features or cargo +nightly build -v --no-default-features --features goblin/alloc, I get:

   Compiling goblin v0.0.16 (https://github.com/m4b/goblin#8bbbcf5d)
error[E0432]: unresolved import `alloc::btree_map`==========>          ] 10/12: goblin
  --> /Users/gz/.cargo/git/checkouts/goblin-d0c041c0a85ca4ca/8bbbcf5/src/archive/mod.rs:15:12
   |
15 | use alloc::btree_map::BTreeMap;
   |            ^^^^^^^^^ Could not find `btree_map` in `alloc`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `goblin`.

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

The following diff gz@a6369ac fixes the problem.

@philipc
Copy link
Collaborator

philipc commented Jul 17, 2018

You need to enable more features when building goblin to trigger the error, since there's individual features for the various file formats too, ie you need the archive feature in particular for this error. See the nightly_api target in the top level Makefile for a convenient way to test all the feature combinations.

@m4b m4b closed this as completed in #95 Jul 17, 2018
m4b added a commit that referenced this issue Jul 17, 2018
Update path to BTreeMap in alloc crate. fixes #94, #96
@m4b
Copy link
Owner

m4b commented Jul 17, 2018

@gz 0.0.17 should be available for your no-std pleasure; i'm not sure if object has to update its goblin dep explicitly (probably). Please raise another issue if you encounter any other errors! Thanks for your help here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants