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

[bug] MSBuildDeps path handling #17895

Closed
sct2010 opened this issue Mar 5, 2025 · 3 comments · Fixed by #17901
Closed

[bug] MSBuildDeps path handling #17895

sct2010 opened this issue Mar 5, 2025 · 3 comments · Fixed by #17901
Milestone

Comments

@sct2010
Copy link

sct2010 commented Mar 5, 2025

Describe the bug

Hi All

The MSBuildDeps generates the conan_xxx_vars_debug_x64.props and conan_xxx_vars_release_x64.props files. The paths in these files are normalized and all \ are replaced with /. This works in most cases. There is one case where it does't work as expected. If there is an executable in the <ConanxxxBinaryDirectories> directory and I would like to open the application with the ShellExecuteEx an error occurred.

Image

If I replace the / with \ in the props file, the application starts properly.

Why do you replace the \ with / in the first place? is it really needed? In all my other files, I use the \ for paths and I never faced any issue.

How to reproduce it

Drop an executable to the binary folder of any dependencies. Start the program with the following code snippet:

SHELLEXECUTEINFO ShExecInfo;

ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_DOENVSUBST;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = L"open";
ShExecInfo.lpFile = L"testapplication.exe";
ShExecInfo.lpParameters = args;
ShExecInfo.lpDirectory = currentDir;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;

auto res = ShellExecuteEx(&ShExecInfo);
@memsharded
Copy link
Member

Hi @sct2010

Thanks for your report.

The paths are normalized, because they are traditionally more problematic with the \\ than with /, and most build systems like CMake actually needs / in different places.
So it is possible that the MSBuild integrations have inherited that from those other integrations.
I have tried today to avoid the replacement, and it seems most of the tests work.
I am still a bit concerned this might be breaking unexpectedly some other users, I think I'll open the PR and discuss over it.

@memsharded
Copy link
Member

Lets see what happens with #17901

@memsharded
Copy link
Member

#17901 has been merged, fixing this issue, it will be in next Conan 2.14.
Thanks again for your feedback.

@memsharded memsharded added this to the 2.14.0 milestone Mar 10, 2025
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

Successfully merging a pull request may close this issue.

2 participants