-
Notifications
You must be signed in to change notification settings - Fork 163
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
features = ["std", "elf32"]
doesn't build
#348
Comments
Yes this is a bug. Looks like we only tested for both elfs and std Line 34 in c81ebdb
Would you be interested in pushing a fix ? :) |
I took a brief look, but it seems like there's not an obvious fix: most of the code is written assuming Maybe the fix is to remove the (I also realized that my code is using |
Yea I had a feeling it was something like that :/ I wonder if we can enable both if you select either to preserve additivity? Perhaps a single elf is better as you suggest but there are some use cases only involving just one, but I think this only works without std ? Otherwise I’m not sure why there are both. |
Also hit this issue for |
Perhaps one possible backwards compatible fix could be: --- Cargo.toml
+++ Cargo.toml
@@ -42,8 +42,8 @@ default = ["std", "elf32", "elf64", "mach32", "mach64", "pe32", "pe64", "te", "a
std = ["alloc", "scroll/std"]
alloc = ["scroll/derive", "log"]
endian_fd = ["alloc"]
-elf32 = []
-elf64 = []
+elf32 = ["elf64"]
+elf64 = ["elf32"]
# for now we will require mach and pe to be alloc + endian_fd
mach32 = ["alloc", "endian_fd", "archive"]
mach64 = ["alloc", "endian_fd", "archive"] Given that no additional dependencies are being pulled in, just compiling a few additional code paths is probably okay and at least there is no build failure. Yes, a few "unintentional" types will be available to users, but I'd say that is outside of semver guarantees. |
While trimming down my dependencies, I noticed that building Goblin with
default-features = false, features = ["std", "elf32"]
fails:This isn't a big deal – I can add
elf64
to the feature list – but the Rust Book advises against it:The text was updated successfully, but these errors were encountered: