rodrigocfd / winsafe

Windows API and GUI in safe, idiomatic Rust.
https://crates.io/crates/winsafe
MIT License
520 stars 30 forks source link

Exit code 127 on startup after upgrading to v0.0.21 #133

Closed charliermarsh closed 3 months ago

charliermarsh commented 4 months ago

We use winsafe in uv, and saw a regression when upgrading from v0.0.19 to v0.0.21 whereby our executable is erroring immediately on startup, but only on the i686 build.

Here's the successful v0.0.19 build: https://github.com/astral-sh/uv/actions/runs/10014237587/job/27683558577.

And the failing v0.0.21 build: https://github.com/astral-sh/uv/actions/runs/10015576654/job/27687218123.

Unfortunately, the only output there is: Error: Process completed with exit code 127. I don't know much more right now and haven't compiled an MRE but thought I would share what I have in case it rings any bells.

Thanks for your work!

rodrigocfd commented 4 months ago

Does it work with v0.0.20?

samypr100 commented 4 months ago

Just tried it, works with v0.0.20 but not v0.0.21 (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)

Maybe related https://github.com/microsoft/windows-rs/issues/1294?

charliermarsh commented 4 months ago

Thank you so much @samypr100.

rodrigocfd commented 3 months ago

@samypr100 not related to https://github.com/microsoft/windows-rs/issues/1294, it seems to be related to raw-dylib linking, which I enabled by default.

Despite raw-dylib being stabilized, I'm still finding some hiccups here and there... so I just pushed a commit to make raw-dylib opt-in through a Cargo feature. So, in order to enable it, now you need to be explicit:

[dependencies]
winsafe = { version = "0.0.21", features = ["raw-dylib"] }

In your case, just don't use raw-dylib. Does it work now?

samypr100 commented 3 months ago

Thanks, just tried winsafe = { git = "https://github.com/rodrigocfd/winsafe", rev = "37b04725d8c68eec735ca6ab44a4eb6ebfb75368", features = ["kernel"] } and it worked.

To verify, once I enabled "raw-dylib" via features = ["kernel", "raw-dylib"] it fails.

rodrigocfd commented 3 months ago

Thanks for the feedback.

Version 0.0.22 is likely to be out in August 1st.

charliermarsh commented 3 months ago

🙏 Thank you both!