Skip to content

Propagate native references to merged project wrapper outputs#65592

Merged
trylek merged 2 commits intodotnet:mainfrom
trylek:PropagateNativeReferences
Feb 19, 2022
Merged

Propagate native references to merged project wrapper outputs#65592
trylek merged 2 commits intodotnet:mainfrom
trylek:PropagateNativeReferences

Conversation

@trylek
Copy link
Member

@trylek trylek commented Feb 18, 2022

When building tests in merged mode, we need to copy the native
references along with the component test dlls to the output folder
to make them discoverable by the OS loader.

Thanks

Tomas

When building tests in merged mode, we need to copy the native
references along with the component test dlls to the output folder
to make them discoverable by the OS loader.

Thanks

Tomas
@trylek trylek added this to the 7.0.0 milestone Feb 18, 2022
@trylek trylek requested a review from jkoritzinsky February 18, 2022 22:09
@ghost ghost assigned trylek Feb 18, 2022
@ghost
Copy link

ghost commented Feb 18, 2022

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

When building tests in merged mode, we need to copy the native
references along with the component test dlls to the output folder
to make them discoverable by the OS loader.

Thanks

Tomas

Author: trylek
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: 7.0.0

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer that we'd rather hook into the GetCopyToOutputDirectoryItems infrastructure instead of this design, but I'm okay with this design for now as it's simple and will get us off the ground.

Comment on lines +120 to +122
<PropertyGroup>
<CopyMergedWrapperReferencesHasRun>true</CopyMergedWrapperReferencesHasRun>
</PropertyGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this property is used. Do we need to set it?

Suggested change
<PropertyGroup>
<CopyMergedWrapperReferencesHasRun>true</CopyMergedWrapperReferencesHasRun>
</PropertyGroup>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jeremy for spotting, I have removed the superfluous property I originally used as local instrumentation when debugging the change in 2nd commit on this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer triggering this action off another build target or rolling in into an existing one, I have no problems with it whatsoever, I have actually only started testing this change on a larger scale and I have mostly randomly put the code next to the existing logic for publishing native product items.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Just for context, this accounts for the two remaining failures apart from the six ones caused by the ilproj rename logic.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think leaving it as-is for this change just to get us off the ground is reasonable.

We have a lot of complexity around how we support copying the native binaries around (due to the fact that we can do the copy as a separate step from the build), so I'm fine holding off doing a more invasive change and just getting in something simple to unblock.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, thanks for clarifying. I originally tried to add this logic to CopyNativeProjectBinaries but that's also a Pandora's box including the special casing for the VS. We can / should tackle this later but hopefully it's not detrimental towards our current efforts.

@trylek trylek merged commit 79d478a into dotnet:main Feb 19, 2022
@trylek trylek deleted the PropagateNativeReferences branch February 19, 2022 13:52
@ghost ghost locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants