Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

Add verification step to check whether the inline reference file is necessary

Open PathogenDavid opened this issue 3 years ago • 2 comments

Right now Biohazrd requires the generator author to manually invoke InlineReferenceFileGenerator when a library contains inline methods which aren't exported.

Right now there isn't anything indicating to the generator author that they need to do this, the library simply won't work (you'll get missing export failures.) This is obviously not ideal and we should automatically detect this scenario and inform the generator author they need to create the inline reference file.

Alternatively/additionally, we could automatically build the inline reference file when necessary: https://github.com/InfectedLibraries/Biohazrd/issues/85

Although we still need to make sure we communicate to the generator author that this file needs to be distributed. (I briefly looked into having Biohazrd generate a mixed assembly, but it seems there's 0 support for these outside of Windows since the feature is really only meant to support C++/CLI.

PathogenDavid avatar Nov 07 '20 08:11 PathogenDavid

LinkImportsTransformation makes this significantly less important as it will emit errors that it can't resolve the inline methods. It'd still be nice if we emitted an actionable error with a link to documentation about dealing with inline functions.

PathogenDavid avatar Feb 21 '21 08:02 PathogenDavid

InlineExportHelper also handles the edge case of a non-inline non-method static function found in a header file. These are never found in well-formed C++ libraries, but we should emit a similar warning for them.

PathogenDavid avatar Feb 21 '21 11:02 PathogenDavid