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

Detect winpty presence more reliably #38

Open
fghzxm opened this issue Jul 3, 2022 · 1 comment
Open

Detect winpty presence more reliably #38

fghzxm opened this issue Jul 3, 2022 · 1 comment

Comments

@fghzxm
Copy link

fghzxm commented Jul 3, 2022

winpty-rs currently detects winpty library's presence by trying to run winpty-agent.exe from PATH. Some software on Windows, for example Neovim, ships with this executable; if the user puts such software on PATH, the build script is tricked into thinking the library exists where it may not.

I think to detect winpty's usability more reliably we just have to try to link something with winpty and see if it fails.

@jakob-ledermann
Copy link

Linking is probably the most reliable way to detect it. That linking should use the same linker the rest of the build is using.
It seems like the msvc linker link.exe does not care about the PATH while searching for libraries. https://learn.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath?view=msvc-170#remarks

I had to specify LIB and make sure it pointed to the folder containing winpty.lib.

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

No branches or pull requests

2 participants