nu-ansi-term icon indicating copy to clipboard operation
nu-ansi-term copied to clipboard

Replace windows-sys dependency with generated bindings

Open djc opened this issue 2 months ago • 4 comments

This avoids the substantial churn and large downloads from the windows-sys dependency in favor of generating checked in code using the windows-bindgen crate (which ultimately also generates the windows-sys code).

I've used a similar setup successfully in chrono, and it's generally pretty low maintenance.

djc avatar Sep 28 '25 09:09 djc

Thanks. This looks cool and interesting but harder to maintain. Currently, I'm not a fan of doing it this way.

fdncred avatar Sep 28 '25 12:09 fdncred

Thanks. This looks cool and interesting but harder to maintain. Currently, I'm not a fan of doing it this way.

It does shift some complexity from your downstream users to the maintainers. Why specifically do you think it's harder to maintain?

djc avatar Sep 28 '25 12:09 djc

Why specifically do you think it's harder to maintain?

Because, to me, it seems more like a hack around the cargo pkg mgmt system that requires a separate level of knowledge of how this works. Also, I'm not sure how we guarantee MSRV by doing this.

fdncred avatar Sep 28 '25 12:09 fdncred

Why specifically do you think it's harder to maintain?

Because, to me, it seems more like a hack around the cargo pkg mgmt system that requires a separate level of knowledge of how this works.

All of the knowledge is more or less in the code generation test I posted.

Also, I'm not sure how we guarantee MSRV by doing this.

The normal way? The generated code is checked in so it's subject to your normal CI workflows. windows-bindgen itself is only a dev-dependency so there's no need for it to affect your MSRV.

djc avatar Sep 29 '25 11:09 djc