-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
windows/msvc/paths.props: Dont add variant path for mpy-cross build. #11717
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
base: master
Are you sure you want to change the base?
Conversation
Is that an issue? |
Here's the command line from msbuild:
Which results in
It should be fairly easy to repro. |
Hmm I cannot reproduce it on a fresh clone and after updating to the same version of the build tools you seem to have so something must be different. Can you explain what exactly you're doing? Tried in VS, in Powershell and in cmd. I noticed that all of your Anyway, thing is: most win APIs should simply ignore double slashes so I have no idea what is wrong in your case. For reference this is one of the things which work ok for me, using cmd:
Relevant pieces of output:
|
I can't reproduce it either. It just built for me without any adjustments. |
I was testing something else on Windows and took another look at this. The problem only happens for me when I download the repo zip from GitHub. It works fine from a Git checkout. (!!!) The only obvious thing I could think of that might be different was maybe line endings but that doesn't appear to be the case. |
Ok, so the issue is somehow triggered when putting micropython in a path with a dash like your I'd prefer the fix to be more literally what the commit subject says though: 'Dont add variant path for mpy-cross build.' by following the pattern of 'if building mpy-cross then do not consider any of the variant stuff' already present in paths.props:
Could create a separate PR for this if you want but seems better to keep this contained into one issue. |
This file is shared by mpy-cross.vcxproj, where PyVariant will be not set (because common.props explicitly doesn't set it when building mpy-cross). Update common.props to only add the variant path to PyIncDirs if not building mpy-cross. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
8f4a6d5
to
fc9a276
Compare
@stinos Thank you! I have no idea why the dash causes this and how you figured that out...! I've updated the PR with your suggested diff. |
I'm sure there's a reason somewhere to be found but didn't go looking for it so also no idea. After making 100% sure the content of the 2 micropython directories was exactly the same, I figured it could only be external, so first thing which came to mind was the dash because the sole difference seemed to be the path (even though 'mpy-cross' itself also has a dash!). |
If you try and build mpy-cross.vcxproj from Visual Studio (tested both 2017 and 2022), it expected the PyVariant property to be set, and without it ends up with an invalid include path, which results in a double-backslash in the cl.exe command line.
Same goes for using
msbuild
. It's easy to add/p:PyVariant=standard
there but it should not be necessary.paths.props is shared by mpy-cross.vcxproj, but in the mpy-cross build, PyVariant will be not set (because common.props explicitly doesn't set it when building mpy-cross).
However, paths.props will attempt to default PyVariantDir to
variants\$(PyVariant)\
which will end up asvariants\\
and the double backslash breaks the cl.exe command line.This appears to work, but I wonder if all uses of PyVariantDir should also now have a
Condition
added?cc @stinos