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

Feature request: riddle lib interface #2593

Closed
Yuri6037 opened this issue Jul 31, 2023 · 4 comments · Fixed by #2609
Closed

Feature request: riddle lib interface #2593

Yuri6037 opened this issue Jul 31, 2023 · 4 comments · Fixed by #2609
Labels
enhancement New feature or request

Comments

@Yuri6037
Copy link

Motivation

I have a low-level crate which uses currently windows-sys but imports a great set of features and uses only about 1 function for each of these features, I'm searching to optimize the bindings to only exactly what I'm using based on what feature the user enabled on the lib crate itself.

I've looked into the riddle tool which looks like it could help me but there's one big drawback of using it: it's absolute pain to setup. What I need is a way to install the riddle tool as part of build.rs script in order to generate the bindings in dev only. Forcing other people to install globally this tool is unacceptable. So the current setup will force me to make some hacky code to download (or use submodule), build and run the tool manually from build.rs.

Could you provide a simple lib interface so that I can import this tool in dev and use it from build.rs?

Drawbacks

No response

Rationale and alternatives

No response

Additional context

No response

@Yuri6037 Yuri6037 added the enhancement New feature or request label Jul 31, 2023
@kennykerr
Copy link
Collaborator

I've had a few suggestions for a lib. That should be doable.

@riverar
Copy link
Collaborator

riverar commented Aug 1, 2023

Related: rust-lang/cargo#9096 (allow artifact dependencies on bin, cdylib, and staticlib crates), just adding a link for tracking purposes.

@riverar
Copy link
Collaborator

riverar commented Aug 1, 2023

Some dev discussion notes to refresh our memory later:

  • Look at windows-bindgen crate as possible deployment vehicle
  • Shipping without metadata (add winmds to consuming crate) won't satisfy folks asking for turnkey solution
    • Dependency on winmd files needs to be added (e.g., windows-metadata default function)
    • Metadata itself is still very unstable; breakage is almost guaranteed between releases
    • May be easier to punt and explore riddle bootstrapping first

@kennykerr
Copy link
Collaborator

We could hide the default winmd files behind a crate feature, so they're not included if not desired. Mainly, it doesn't make sense for riddle.exe to include them but lib dependents may appreciate that it's all included.

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

Successfully merging a pull request may close this issue.

3 participants