-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
MSVS: Erroneous solution file generation with MSVSSolution and variant_dir #4612
Comments
Addressed in PR #4610 Tests results:
|
There are seemingly endless cases of mishandling of files that aren't actual build products (put in the wrong places and/or not tracked properly) when variantdir is involved - see Fortran module files, msvc PDB files, etc. And now you're telling us that when it's behaving as designed (variantdir means everything goes there) that's not correct either? |
The msvs tool for MSVSProject and MSVSSolution are designed to generate the solution and project files in the source directory (presumably with the c/c++ files) and placeholder files in the build directory. In terms of solution file generation locations, the following should be equivalent when using a variantdir:
However, the results are not the same. Current results:
When using However, using Basically, a parallel implementation for detecting the locations was missing for the "standalone" MSVSSolution invocation. |
If that's how they're designed, then that's a flaw when using variant dirs.. |
The problem is we're writing those files for something external to consume, and they have to go where it makes sense for that tool. To visual studio, it would make no sense for the solution/project files to go into the variant dir. |
Why? isn't it just a cd xyz, run scons? I'm not sure I get why it matters where this file is. |
I suspect it is because the project files are generated assuming the source files are in the same directory. I was under the impression that the solution/project files were for code-browsing via Visual Studio and that building would simply have python call SCons. Maybe? A full example from the test suite follows. Perhaps it will be illuminating. Sample: SConstruct:
Sample SConscript:
Generated
Generated
I can't quicky test a "real" example. |
if you build a project file, it's for vs to use and includes how it calls scons to build. tbh I don't know what restrictions it has, but we do have to live by them. I'm out of my depth here. does variantdir even make sense in this context? or is this "don't do that"? |
(raising and waving hand) Me too. Mongodb appears to be generating their own project file. The banner indicates it is used as a code browser and for debugging. I think they use a variantdir for builds, but didn't look. https://github.com/mongodb/mongo/blob/master/buildscripts/make_vcxproj.py Locally, I'm trying to get a hello world example to build with no joy. Tomorrow is another day... |
What follows is a minimal example of building a simple "hello, world" program and generating solution/project files for Visual Studio using a variantdir build. It appears that the MSVSProject It is configured to generate the solution file in the "root" next to the SConstruct file and the project file in the src folder next to the hello.c source file. See the project layout below. Maybe tomorrow I'll try generating the solution file in the src folder as well. It almost makes sense to me now. Almost. Complete Example:
|
When using MSVSSolution with a variant build directory, the actual solution file is generated in the build directory instead of the source directory.
The expected result is that a placeholder solution file is generated in the build directory and the actual solution file is generated in the source directory.
Test configuration:
Layout
SConstruct File
src\SConscript File
Test results:
Output Layout
Build\Test.sln Fragment:
Build\Test.vcxproj Fragment:
src\Test.vcxproj Fragment:
Notes:
{813AB1DC-1B07-56AA-A473-DEA1E63B968A}
{E0C70307-259D-5A4A-B1B3-FB5220DB38F3}
Required information:
n/a
4.8.1 Master (SHA-1: fc36781)
3.11.3
WinPython
filesystem git repository master branch
Win 10
See above
python PathToSconsRoot/scripts/scons.py from test folder root
The text was updated successfully, but these errors were encountered: