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

Ability to prevent linking of dlls #2640

Closed
wmmc88 opened this issue Aug 31, 2023 · 6 comments
Closed

Ability to prevent linking of dlls #2640

wmmc88 opened this issue Aug 31, 2023 · 6 comments
Labels
question Further information is requested

Comments

@wmmc88
Copy link

wmmc88 commented Aug 31, 2023

Suggestion

I wanted to be able to only import NTSTATUS values from this crate, but doing so pulls in many dlls. The way in which the dlls are imported actually breaks my build because it forces some of my own ffi bindings to try to link against ntdll instead of my own dlls.

@wmmc88 wmmc88 added the enhancement New feature or request label Aug 31, 2023
@kennykerr kennykerr added the question Further information is requested label Aug 31, 2023
@kennykerr
Copy link
Collaborator

That's not something the windows or windows-sys crates support.

You could experiment with setting windows_raw_dylib which would prevent the lib crates from being included.

# "--cfg", "windows_raw_dylib",

Alternatively, you might want to consider using the windows-bindgen crate to generate just the constants you need.

@kennykerr kennykerr removed the enhancement New feature or request label Aug 31, 2023
@wmmc88
Copy link
Author

wmmc88 commented Sep 1, 2023

enabling windows_raw_dylib does prevent the linking issue! When might windows_raw_dylib become the default?

@kennykerr
Copy link
Collaborator

raw-dylib is finally stabilized so it's just a matter of time before the MSRV can handle it. Not sure yet when that will be.

@wmmc88
Copy link
Author

wmmc88 commented Sep 1, 2023

Im not sure what you mean by "the MSRV can handle it". According to rust-lang/rust#58713, it looks like the feature was stabilized for 1.65, so isn't it just a matter of when you decide to increase the msrv to >= 1.65? What is the policy for increasing msrv in windows-rs crates?

Aside: It looks like the msrvs listed in the docs don't match with the ones defined in the cargo.tomls

@kennykerr
Copy link
Collaborator

I just bumped it to 1.56.0 - it will likely be a while until it gets bumped to 1.65, but your scenario is a little different so I wouldn't worry about that.

Yes, I need to update the docs.

@kennykerr
Copy link
Collaborator

I have updated the docs at https://kennykerr.ca/

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

No branches or pull requests

2 participants