-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable loading composite r2r images from a singlefile bundle #53739
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
908c9b9
to
17bc4ed
Compare
rebased to pick P4 toolset |
Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov Issue DetailsIn progress. Needs tests.
|
@agocke - According to @trylek analysis the reasons why the new test fails are nontrivial and on SDK side and a fix may not be simple and even when fixed we may not be able to rely on the fix in runtime repo for a long time (possibly not before we use preview 7 toolset. The suggestion is to accept the change without a test and rely on testing in SDK repo. The integration frequency to SDK is about once a day, which might be sufficient to guard against regressions. |
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.
Looks great to me, thank you for fixing composite R2R images in bundled mode!
3a42059
to
17f9ce3
Compare
@@ -143,59 +143,69 @@ NativeImage *NativeImage::Open( | |||
|
|||
NewHolder<PEImageLayout> peLoadedImage; | |||
|
|||
EX_TRY | |||
BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(fullPath, /*pathIsBundleRelative */ true); | |||
if (bundleFileLocation.IsValid()) |
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.
It looks like the bundler also records the file type of everything in the bundle. Is there any reason why we would want to add a new "R2R composite" file type?
It doesn't really look like we'll need it, as long as we assume that the bundle-relative path is constructed properly at the beginning.
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 do not think we have concrete reasons to distinguish and propagate the distinction for composite r2r files vs. regular r2r assemblies. The main difference is that composite r2r file may contain native code for more than one assembly, which is opaque to the host/bundle. Also it does not seem to contain any IL (I am not sure if it actually can, but it would make no difference either).
As things are now, a separate classification for composite r2r at bundle level would not add much benefit. I think we can wait until/if we have a use case for that.
Change LGTM but it would be good to have the SDK test created and linked here before we merge, to make sure that there's some eventual validation of the change. |
Hi Vlad! I have finally managed to shed some light on the bundled test failures using live SDK bits. I disproved my yesterday theory that the bug was somehow introduced by David Wrighton’s refactoring of composite build in the SDK. After I became able to build the failing tests using a live-built SDK with additional instrumentation, I have found out that there are several bugs involved:
I believe I know how to fix (1) and probably (4). For (2) and (3), these are closely tied to the host test build infrastructure and I’m less familiar with fixing these. Thanks Tomas /cc @dotnet/crossgen-contrib |
OK, some slight corrections - (1) is actually fine in current SDK main, I was looking at a slightly older clone of the repo that didn't include the script fix. In light of this I believe the only remaining SDK problem is potentially (4) and it's a small issue. I believe the tests should be fixable by just fixing (3) and possibly (2) depending on when the property was fixed in the SDK repo. |
OK, so the commit that added this fix, is from 6 days ago. This likely means that it's not part of Preview4 so that the bullet point (2) still holds for now. |
I will add the SDK test. I suggest to go ahead and merge this change. |
I have staged a PR in SDK repo with a simple acceptance test for a singlefile app with a composite R2R - a testcase similar to what we would have here. I think this responds to all the concerns and I will merge this PR. |
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.
LGTM, merge whenever you're ready
Thanks!! |
I expect that with complete extraction the SDK test will pass even without this change. I am curious if that is indeed the outcome on the SDK side, so have not merged this yet. |
The baseline behavior on SDK side was exactly as expected - composite r2r worked with forced extraction, and failed without extraction. |
The main part of the change is making
NativeImage::Open
to probe forr2r.dll
in the bundle and if available load it using the same codepath as for regular r2r assemblies.Other changes are to make the checks in PE decoder to accept COR header shape is it is produced by crossgen for
r2r.dll
.