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

Improve dependency gating on objdiff-core #126

Merged
merged 5 commits into from
Oct 21, 2024

Conversation

AngheloAlf
Copy link
Contributor

Mark as many dependencies as optional as I could without actually touching the code.

The way I tested this was to mark every dependency as optional and then try to build objdiff-core with each individual feature, and then added each dependency as the build complained about missing stuff.

A remarkable thing I noted is that I wasn't able to build any of the architectures on its own besides ppc because of this error:

error[E0599]: no method named `ppc` found for reference `&dyn ObjArch` in the current scope
  --> objdiff-core/src/obj/read.rs:68:10
   |
67 |       if arch
   |  ________-
68 | |         .ppc()
   | |         -^^^ method not found in `&dyn ObjArch`
   | |_________|
   |

For more information about this error, try `rustc --explain E0599`.

So to test every other architecture I had to enable ppc too. Because of this any-arch can't be built on its own either (kinda makes sense, but weird either way).

Finally, I used the dep: syntax when listing dependencies on the features out of habit. I can remove those if you prefer.

AngheloAlf and others added 5 commits October 20, 2024 18:04
Removes dependency on tsify-next / wasm-bindgen unless
compiling with the wasm feature by using `#[cfg_attr]`
@encounter
Copy link
Owner

Thanks a ton!

@encounter encounter merged commit 5ef3416 into encounter:main Oct 21, 2024
18 checks passed
@AngheloAlf AngheloAlf deleted the reduce_dependencies branch October 21, 2024 02:10
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

Successfully merging this pull request may close these issues.

2 participants