Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

Generate reference assemblies for lowest common denominator between platforms

Open PathogenDavid opened this issue 3 years ago • 2 comments

Easiest way to do this will probably be to (for example):

  1. Translate library as x86
  2. Translate library as x64
  3. Translate library as ARM64
  4. Use transformation to find API union of all three (and maybe generate a report of what's missing)
  5. Generate reference assembly from what remains

PathogenDavid avatar Sep 10 '20 02:09 PathogenDavid

This issue is somewhat at odds with the fact that for some libraries we have the following pattern:

  1. Run InlineExportHelper
  2. Rebuild the native components
  3. Run LinkImportsTransformation

The strategy presented in the original issue does not jive super well with this strategy since cross-compiling quickly becomes non-trivial for step 2. (Using off-platform target triplets in Clang is already somewhat problematic for this reason as well.)

It might be better to instead recommend that people only do this as a packaging step and have the reference assembly generator run independently of the transformation pipeline. (Although this does not work super well with workflows which have generation live in-solution.)

(An added major downside of that is the fact that you might not know there's a major API that's platform-specific until CI runs.)

PathogenDavid avatar Jul 29 '21 16:07 PathogenDavid

Another possibility is recommend people who need this capability do their main development on Windows and provide support for the native rebuild happening in WSL.

-- The WSL components are installed on GitHub Actions Windows runners, but no distro is provisioned. I saw this third party action recommended for installation: https://github.com/marketplace/actions/setup-wsl

PathogenDavid avatar Jul 29 '21 16:07 PathogenDavid