-
Couldn't load subscription status.
- Fork 891
Restructuring codebase #113
Conversation
- Updated solution filters/folders to match the layout of the future layout of the repository {core. platforms, tests}.
- Disabled JustMyCode from Debug configurations of driver-related projects to address an issue existing in Visual Studio 15.8:
https://developercommunity.visualstudio.com/content/problem/302014/dirver-build-debugmode-checkfordebuggerjustmycode.html
Signed-off-by: Alexandro Sanchez Bach <[email protected]>
- Removed makefiles related to the legacy WDK 7.1 build system used in earlier HAXM releases. This has been replaced with WDK 10, whose Nmake2MsBuild tool generated the .props files. Since these files are no longer consumed by the current build system, they have been removed. - Removed `darwin\hax_driver\com_intel_hax\readme` file, since its description of the codebase no longer matches the actual state of the codebase. Signed-off-by: Alexandro Sanchez Bach <[email protected]>
784efbf to
86ebde2
Compare
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.
Thanks, this is a great PR!
We'll test building the new .sln using VS2017 and EWDK after you fix the $(OutDir) setting. The build instructions will also need to be updated due to the new directory layout. If you want to help update it, that would be great, or you can leave it to us.
| <OutDir>$(SolutionDir)build\out\$(DDKSpec)\</OutDir> | ||
| <IntDir>$(SolutionDir)temp\$(ProjectName)\$(Platform)\$(ConfigurationName)\</IntDir> | ||
| </PropertyGroup> | ||
| <!-- The WrappedTaskItems label is used by the conversion tool to identify the location where items |
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.
nit: Remove this redundant comment.
platforms/windows/haxm-core.vcxproj
Outdated
| </ImportGroup> | ||
| <PropertyGroup Label="UserMacros" /> | ||
| <PropertyGroup Label="Configuration"> | ||
| <OutDir>$(SolutionDir)build\core\$(DDKPlatform)\</OutDir> |
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.
- Use separate
OutDirs for Debug and Release by appending$(ConfigurationName)\ - nit: Use
$(Platform)instead of$(DDKPlatform). I think they differ only in the naming of 32-bit x86:Win32vs.x86. I'm fine with either, but I'd like to be consistent with what we use for$(IntDir).
platforms/windows/haxm-core.vcxproj
Outdated
| <PropertyGroup Label="UserMacros" /> | ||
| <PropertyGroup Label="Configuration"> | ||
| <OutDir>$(SolutionDir)build\core\$(DDKPlatform)\</OutDir> | ||
| <IntDir>$(SolutionDir)temp\$(ProjectName)\$(Platform)\$(ConfigurationName)\</IntDir> |
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.
nit: I think this is for build intermediates. Shall we also put them in build\, perhaps build\intermediates\$(ProjectName)\$(Platform)\$(ConfigurationName)\? The Darwin build does something similar:
build/{Debug, Release}/for final productbuild/intelhaxm.build/{Debug, Release}/for intermediates
| </ImportGroup> | ||
| <PropertyGroup Label="UserMacros" /> | ||
| <PropertyGroup Label="Configuration"> | ||
| <OutDir>$(SolutionDir)build\out\$(DDKSpec)\</OutDir> |
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.
$(DDKSpec) seems to map to win7. As with haxm-core.vcxproj, we should use separate OutDirs for Debug/Release, x64/Win32, etc.:
$(SolutionDir)build\out\$(Platform)\$(ConfigurationName)\
We don't have to include win7 in the path.
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.
That makes much more sense, thanks for the hint! I was trying to resemble the old paths (obj\out\Win7), but I agree that build\out\$(Platform)\$(ConfigurationName is much more convenient.
| <PropertyGroup Label="UserMacros" /> | ||
| <PropertyGroup Label="Configuration"> | ||
| <OutDir>$(SolutionDir)build\out\$(DDKSpec)\</OutDir> | ||
| <IntDir>$(SolutionDir)temp\$(ProjectName)\$(Platform)\$(ConfigurationName)\</IntDir> |
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.
nit: Replace temp\ with build\intermediates\ (see my comment on haxm-core.vcxproj).
platforms/windows/version.rc
Outdated
| #define VER_LEGALCOPYRIGHT_YEARS "2013" | ||
| #define VER_LEGALCOPYRIGHT_STR "Copyright© " VER_LEGALCOPYRIGHT_YEARS " Intel Corporation" | ||
| #define VER_LEGALTRADEMARKS_STR "Copyright© 2013 Intel Corporation" | ||
| #define VER_LEGALCOPYRIGHT_STR "Copyright� " VER_LEGALCOPYRIGHT_YEARS " Intel Corporation" |
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.
These two lines were probably changed by accident. The copyright symbol (U+00A9) doesn't look right now. Please revert, or maybe use an escape sequence instead (\xa9? I'm not sure).
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.
Thanks for doing the revert. It seems this file is not encoded correctly, and opening it in VS2017 results in an error. But I don't think that has anything to do with this PR. We'll try to fix the encoding later.
include/hax_types.h
Outdated
| #include "darwin/hax_types_mac.h" | ||
| // Windows | ||
| #elif defined(__WINNT__) | ||
| #elif defined(WINNT) |
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.
Do you know where the WINNT macro is defined? Maybe we should use the more common _WIN32 macro instead:
https://stackoverflow.com/questions/142508/how-do-i-check-os-with-a-preprocessor-directive
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.
I found it among the "inherited values" for the project's preprocessor definitions. This likely means that some internal Visual Studio .props file defines it. I just chose WINNT due to the similarity to __WINNT__ (which was by the way manually defined in sources.props).
I agree we should use the more common _WIN32 macro, so I will change it.
platforms/windows/.gitignore
Outdated
| @@ -0,0 +1,11 @@ | |||
| # Objects | |||
| build/ | |||
| temp/ | |||
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.
nit: Remove this if you change the $(IntDir) prefix to build\intermediates\.
| <PropertyGroup Label="Globals"> | ||
| <ProjectGuid>{BC80D1E0-5738-4048-A742-8A20949A6587}</ProjectGuid> | ||
| <RootNamespace>$(MSBuildProjectName)</RootNamespace> | ||
| <WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> |
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.
nit: Is this autogenerated by Visual Studio? I'm not sure if it implies the use of Windows 10 SDK and breaks support for Windows 7 and 8.x (maybe not, since we have <TargetVersion>Windows7</TargetVersion> below). I'd remove it.
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.
Is this autogenerated by Visual Studio?
Yes. I'm not entirely sure about the implications of that line.
| <PropertyGroup Label="Globals"> | ||
| <ProjectGuid>{BA777056-A57E-492D-A821-68D08A2DACE6}</ProjectGuid> | ||
| <RootNamespace>$(MSBuildProjectName)</RootNamespace> | ||
| <WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> |
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.
nit: Is this autogenerated by Visual Studio? I'm not sure if it implies the use of Windows 10 SDK and breaks support for Windows 7 and 8.x (maybe not, since we have Windows7 below). I'd remove it.
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.
Is this autogenerated by Visual Studio?
Yes. I'm not entirely sure about the implications of that line.
- Moved `{darwin,windows}/` to `platforms/{darwin,windows}/`. This is meant to reduce root-folder pollution, specially if support for more platforms (e.g. Linux) is added.
- Removed WDK 10 makefiles: There is no need of having one extra layer of indirection in our build systems: both VS and EWDK consume only .sln/.vcxproj files which are already checked in the repository. The additions to .vcxproj's are not significantly more verbose.
- Reorganized .gitignore files: One root-level .gitignore file with general rules that affect the entire source tree (e.g.: .DS_Store for macOS), and platform/compiler-specific rules at platforms/*/.gitignore to deal with build-related files (e.g.: *.vcxproj.user for Visual Studio, build/ for Xcode).
- Renamed `darwin/hax_driver/com_intel_hax` to `darwin` (to maintain consistent folder depth).
- Renamed Windows build directory from `obj` to `build` (to maintain consistent naming with macOS).
Signed-off-by: Alexandro Sanchez Bach <[email protected]>
Moved API.md to docs/api.md, and added platform-specific usage instructions in docs/manual-{darwin,windows}.md to avoid polluting README.md, specially if support for more platforms (e.g. Linux) is added.
Signed-off-by: Alexandro Sanchez Bach <[email protected]>
35bf3d3 to
89857de
Compare
|
All done! I've also taken the opportunity to add extra changes:
|
|
Thanks, the new source tree layout looks so neat and clean! nit: In
We have started testing this PR, and have found one issue so far: the |
Signed-off-by: Alexandro Sanchez Bach <[email protected]>
By canonical you mean they are not relative to the current file? If so, I've just fixed it. The reason it worked is that the project (and the source.props file before), has several added include directories.
This was seemingly caused my the last PR, since the emulator tests include emulate.h, which relies on HAX_ARCH* macros, which are included from include/hax_types.h if Since In the future we probably should make a clear cut between kernel and userspace: maybe by defining macros HAX_KERNEL and HAX_USER (instead of HAX_TESTS) that lets us separate code better. |
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.
Thanks!
Right. I noticed that you had updated most relative
I see. I thought we had tested the Win32 build before merging #110, but perhaps we overlooked the
I agree. Maybe this can help us solve another problem (#9): that |
Yes, my thoughts exactly. :-) |
DISCLAIMER: These are quite deep changes to the repository, we should probably make sure everyone agrees in the proposed changes down to the finest detail.
Goal is simply make the platform-specific changes consistent with each other, and keeping the root-level and source folders clean of platform-specific files.
This builds correctly under Windows+VS2017 and macOS+Xcode. Testing on Windows+EWDK is pending.
There's no functionality changes, so there should be no run-time regressions.
Changes
Generic changes:
{darwin,windows}/toplatforms/{darwin,windows}/, to avoid polluting the root folder. This is meant to reduce root-folder pollution, specially if support for more platforms (e.g. Linux) is added.API.mdtodocs/api.md, and added platform-specific usage instructions indocs/manual-{darwin,windows}.mdto avoid pollutingREADME.md, specially if support for more platforms (e.g. Linux) is added..gitignorefile with general rules that affect the entire source tree (e.g.: .DS_Store for macOS), and platform/compiler-specific rules atplatforms/*/.gitignoreto deal with build-related files (e.g.: *.vcxproj.user for Visual Studio, build/ for Xcode).darwin/hax_driver/com_intel_haxtodarwin(consistent folder depth).objtobuild(consistent naming with macOS).Changes on Windows:
Changes on macOS:
darwin\hax_driver\com_intel_hax\readme, since its description of the codebase no longer matched the state of the codebase.