-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Unixify paths for more cases #70
Conversation
@mstorsjo It is worth unit testing these changes. Could you please add a basic test for |
(Sorry I don't have time to actually review this one right now, I'll have to get back to it later.)
Hmm, what would be a good kind of test here? The practical tests would be of the form to just build something with e.g. ninja, and then rebuilding and making sure that it works (doesn't error out due to references to unknown paths), doesn't rebuild things needlessly, and actually does rebuild files as necessary if e.g. touching a header. But many of these aspects are hard and messy to verify in a test... I guess what you have in mind is to manually run |
Yes, this is what in my mind. For example, run
Save the output to a file as reference. The test just runs the same command, captures the outputs, compares to references byte-wise. |
Ok, does db57d18 seem reasonable? |
I realized we definitely should run the same kind of test on macOS too. There are too many subtle differences in how |
Yes. I think we should write some source files, some reference files, and some scripts to test it. |
Yes, that sounds reasonable - feel free to try to build something such! |
I am thinking that, we can move the postprocesses to their corresponding wrappers. And export two environment variables |
I guess that sounds reasonable. |
056c551
to
2491b10
Compare
I added tests for each commit and switched to ERE (Extended Regular Expression). Quote from https://www.gnu.org/software/sed/manual/html_node/BRE-vs-ERE.html#BRE-vs-ERE:
The reason I made the switch is that I want to use
Definitely right. There is a great answer https://stackoverflow.com/a/24276470 for reference. Things I learnt and applied:
|
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.
This looks really good to me now, thanks! Just a couple details for discussion.
2491b10
to
02ed29e
Compare
LGTM, thanks! |
Unixify paths for cl /showIncludes only. Otherwise outputs may be partially converted, e.g.
Unixify paths for dumpbin /PDBPATH also. Otherwise outputs were also partially converted, e.g.
Vcpkg use it to implement the script
vcpkg_copy_pdbs
: https://github.com/microsoft/vcpkg/blob/662dbb50e63af15baa2909b7eac5b1b87e86a0aa/scripts/cmake/vcpkg_copy_pdbs.cmake#L24Unixify paths for cl /P /Fi. There are three cases of
cl /P
:i: A output file is specified by
/Fi
. This PR handles this case and resolves Work with ccache: Problem with MSVC /P (Preprocess to a File) option #69 .ii. & ii: One or more source files are given to
cl /P
and an optional output directory can be specified by/Fi
(default to CWD).cl
will generate{output directory}/{basename of a source file without extension}.i
for each source file. This PR does NOT address these cases.