-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
backends: Use POSIX paths for target paths #12194
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
backends: Use POSIX paths for target paths #12194
Conversation
|
Feel free to ignore as this is only tangentially related to your problem but i'm pretty sure that this line needs the same Path().as_posix() treatment because meson devenv will generate a vscode env file with paths like c:\folder and you will get surprises when your folder name start with a 'n'. I tested with the Path().as_posix() and it generates a correct vscode env file for windows. |
06ca5fd to
66a1728
Compare
533fe7f to
bc3f022
Compare
|
I'm a bit worried that scattering millions of Alternatively, we could make a project wide search-and-replace to ban usage of |
I could agree -- in this case, Microsoft Clang not accepting Windows-style paths. But, if you check the changes that are necessary in the unit tests, this assertion also applies to Meson itself 😃 so the proper fix would be to use one or the other consistently. But there are 300+ places where this is used, so I don't quite know which ones are for internal consumption only and which ones do are passed externally. |
bc3f022 to
df0b725
Compare
|
@eli-schwartz I just found #12564 which solves a lot of the issues I was facing. However, there are a couple spots that still needed fixing when using Microsoft clang. I've rebased and fixed them here, and rephrased the commit to clarify that. |
93c68f0 to
e3c9dc2
Compare
|
Needs rebasing, branch has conflicts. |
nirbheek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, since all these are places where we were using os.path.join and now are using as_posix().
For future reference: replacing os.path.join good, and str.replace('\\', '/') BAD BAD BAD.
This commit completes 5de09cb, ensuring that only POSIX style paths are passed to the compiler line, and thus fixing UNIX-style tools that treat single backward slashes as Unicode escaped characters. Fixes mesonbuild#12191 Completes mesonbuild#12534 Completes mesonbuild#12564
e3c9dc2 to
d139854
Compare
|
Unfortunately this had to be reverted because it was breaking projects in the wild. :( |
👋
This is a PR that fixes #12191 (at least to the extent that my local project stash could check).
It requires #12144 to fix argument detection.