DynamoRIO / DynamoRIO/dynamorio
Mixed-mode Windows tests need 32-bit build from 64-bit job
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
We have a number of mixed-mode Windows tests where we run a 32-bit app on WOW64 from our 64-bit suite build:
+ win32.mixedmode_late
+ win32.mixedmode
+ win32.x86_to_x64
+ win32.x86_to_x64_ibl_opt
However, with the move to Github Actions in #4131 with parallel jobs, we now run a 64-bit build without first running a 32-bit build and so we cannot use the already-built 32-bit test binary.
Plus, with #803 cross-arch injection, we will want more tests of one bitwidth launching a different bitwidth child.
What we want is to do what UNIX does and have a build-and-test test that goes and creates what we need using a different toolchain config from the current. For Windows this is a lot more complicated since the @($*&@% compiler doesn't have a nice flag like `-m32`, but we can share our env var swapping from runsuite_common_pre.cmake.
Here is a list of ways to do the switch including env vars:
1) Generalize the env var setting code in runsuite_common_pre.cmake and
set test ENVIRONMENT properties like we do for -m32 for the unix
build-and-test. Hopefully escaping the ;'s in Windows PATH, etc. will work.
2) Try -DCMAKE_GENERATOR_PLATFORM=x64
Similarly there's the -A switch.
This is cmake 3.13+ which separates out the arch part.
And "--build-generator-platform Win32".
But: that doesn't work w/ Ninja.
And if the outer is Ninja: how figure out which VS generator to use?
3) Use different generator for different dir:
https://cmake.org/pipermail/cmake/2011-November/047221.html
Build that subdirectory not using add_subdirectory(), but using
externalproject_add() and use the -G switch in the command line there.
4) Make a toolchain file to set a whole bunch of stuff
5) Just check in a 32-bit mixedmode.exe! But that's not good enough for
forthcoming #803 cross-arch injection where we need dynamorio.dll.
For now, these tests just fail every time and are on the ignore list.
Contributor guide
Research direction
Start with runsuite_common_pre.cmake and the existing UNIX build-and-test handling for alternate toolchains. Trace how the mixed-mode tests win32.mixedmode_late, win32.mixedmode, win32.x86_to_x64, and win32.x86_to_x64_ibl_opt are configured and ignored. Done means the 64-bit job can build the required 32-bit artifacts and run these tests rather than ignoring them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake
- Domain
- build-system, operating-systems, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100