Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Port all managed product binaries to use SDK style projects#24285

Merged
AaronRobinsonMSFT merged 21 commits intodotnet:masterfrom
AaronRobinsonMSFT:port_spcl_to_sdk
May 6, 2019
Merged

Port all managed product binaries to use SDK style projects#24285
AaronRobinsonMSFT merged 21 commits intodotnet:masterfrom
AaronRobinsonMSFT:port_spcl_to_sdk

Conversation

@AaronRobinsonMSFT
Copy link
Member

This PR is not complete. The optprof scenario will be broken. @jkoritzinsky suggestions are welcome.

Much of this work was ported from #23988. Note that this work does not upgrade to 3.0, but merely moves the product projects to SDK project types.

cc @RussKeldorph @jashook @jkoritzinsky @jeffschwMSFT

@AaronRobinsonMSFT AaronRobinsonMSFT added area-Infrastructure-coreclr * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) labels Apr 27, 2019
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 3.0 milestone Apr 27, 2019
Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

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

Lgtm thank you for the work!

<BuiltBinary Include="$(TargetPath)" />
</ItemGroup>

<!-- Target used to consolidate all PDBs into a single location -->
Copy link

Choose a reason for hiding this comment

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

Can we expand on this comment further?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know what you would like to see. All product PDBs go into a specific location. The reasoning seems to be to help packaging. I don't really know what else to say other than the present comment. I don't want the litter the code with policy only functionality.

Copy link
Member

Choose a reason for hiding this comment

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

Could you clarify why we need custom logic to move symbols? I expected that arcade would put them in the right place if we use it as designed.

Copy link
Member Author

Choose a reason for hiding this comment

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

We are only using arcade to build assets, not rely on arcades output paths at the moment. That is a second pass.

<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
Copy link

Choose a reason for hiding this comment

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

Can we add a condition on ArcadeBuild=="" on the import?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand why in this case. It was present before and is needed regardless of Arcade or not.

@AaronRobinsonMSFT
Copy link
Member Author

cc @sbomer @echesakovMSFT

@AaronRobinsonMSFT
Copy link
Member Author

There is something awry here. I am not observing these issues locally. Will merge with master tomorrow and see if I can reproduce locally.

@AaronRobinsonMSFT
Copy link
Member Author

I was finally able to reproduce this locally. After rebasing and doing a clean build, the issue went away. Pushing a fully rebased branch.

Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

Thank you for doing this!

<BuiltBinary Include="$(TargetPath)" />
</ItemGroup>

<!-- Target used to consolidate all PDBs into a single location -->
Copy link
Member

Choose a reason for hiding this comment

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

Could you clarify why we need custom logic to move symbols? I expected that arcade would put them in the right place if we use it as designed.

@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Windows_NT x64 Release CoreFX Tests please

1 similar comment
@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Windows_NT x64 Release CoreFX Tests please

@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Ubuntu x64 Checked CoreFX Tests please

@AaronRobinsonMSFT
Copy link
Member Author

The failures appear to be a a real issue in tests\src\Interop\PInvoke\SafeHandles\Interface\InterfaceTest.cs - see SH_MAIntf.

@AaronRobinsonMSFT
Copy link
Member Author

AaronRobinsonMSFT commented May 1, 2019

@jkoritzinsky Any thoughts on why the SH_MAIntf test is consistently failing? I see the comment, but am unsure why this would all of sudden start working. I think I remember talking to you about this functionality, but really can't remember the specifics. I can accept that I am missing some #define or configuration during the build. Any thoughts? If not I will just debug it tomorrow, but if you know what setting I might be missing that would be appreciated. Thanks.

//NOTE: SafeHandle is now ComVisible(false)...QIs for IDispatch or the class interface on a
// type with a ComVisible(false) type in its hierarchy are no longer allowed; so calling
// the DW ctor with a SH subclass causes an invalidoperationexception to be thrown since
// the ctor QIs for IDispatch
Console.WriteLine("Testing SH_MAIntf...");
Assert.Throws<InvalidOperationException>(() => SH_MAIntf(sh, shVal, shfld1Val, shfld2Val), "Did not throw InvalidOperationException!");

@AaronRobinsonMSFT
Copy link
Member Author

I discovered the issue. There are missing assembly level attributes (e.g. ComVisible(false)).

@AaronRobinsonMSFT
Copy link
Member Author

@jkotas I need to add the following attributes to SPCL because the built-in method for SDK projects doesn't permit supplying attributes that have constructors taking non-string arguments. I am adding a new file to this project called AssemblyAttributes.cs with these specific attributes:

[assembly:System.Runtime.InteropServices.ComVisible(false)]
[assembly:System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute(System.Runtime.InteropServices.DllImportSearchPath.AssemblyDirectory | System.Runtime.InteropServices.DllImportSearchPath.System32)]

Do you have any preference where this file is located or if I should place this in an existing file?

@AaronRobinsonMSFT
Copy link
Member Author

AaronRobinsonMSFT commented May 1, 2019

Correction. I found existing assembly level attributes in SPCL and moved these attributes there as well.

[assembly: DefaultDependencyAttribute(LoadHint.Always)]
// mscorlib would like to have its literal strings frozen if possible
[assembly: System.Runtime.CompilerServices.StringFreezingAttribute()]

@AaronRobinsonMSFT
Copy link
Member Author

The CoreFX AppDomainTests.AssemblyResolve_IsNotCalledForCoreLibResources test is probably failing due to something in this PR.

@jkotas
Copy link
Member

jkotas commented May 1, 2019

test is probably failing due to something in this PR.

Are the assembly attributes same before / after the change? The resource culture lookup is controlled via another bunch of attributes.

@AaronRobinsonMSFT
Copy link
Member Author

Are the assembly attributes same before / after the change? The resource culture lookup is controlled via another bunch of attributes.

@jkotas Good question. I am looking into that now. It seems that assembly attributes come from a myriad of places so it makes tracking them down a bit difficult in the build system. I will check that out though.

@AaronRobinsonMSFT
Copy link
Member Author

@jkotas Looks like the following attributes are different between the two:

new vs old

- System.CLSCompliantAttribute
- System.Reflection.AssemblyMetadataAttribute
- System.Reflection.AssemblyDefaultAliasAttribute
+ System.Resources.NeutralResourcesLanguageAttribute

I would assume the last one is related. I am unsure if the others are legacy or needed at all anymore. The CLSCompliantAttribute is weird that it isn't present, but that could have simply been a default value whenever the assembly info was generated in the previous system. I will need to dig through some more code in build tools to understand what it was doing. Thanks for the suggestion.

@AaronRobinsonMSFT
Copy link
Member Author

AaronRobinsonMSFT commented May 2, 2019

This change will update the AssemblyFileVersion for System.Private.CoreLib and is related to https://github.com/dotnet/coreclr/issues/22844.

@AaronRobinsonMSFT
Copy link
Member Author

/azp help

@azure-pipelines
Copy link

Supported commands
     help:
          Get descriptions, examples and documentation about supported commands
          Example: help "command_name"
     list:
          List all pipelines for this repository using a comment.
          Example: "list"
     run:
          Run all pipelines or a specific pipeline for this repository using a comment. Use
          this command by itself to trigger all related pipelines, or specify a pipeline
          to run.
          Example: "run" or "run pipeline_name"
     where:
          Report back the Azure DevOps orgs that are related to this repository and org
          Example: "where"

See additional documentation.

@AaronRobinsonMSFT
Copy link
Member Author

/azp list

@azure-pipelines
Copy link

CI/CD Pipelines for this repository:
coreclr-outerloop
coreclr-ci
dotnet-coreclr-nullablefeature

@AaronRobinsonMSFT
Copy link
Member Author

/azp run coreclr-outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 099177b into dotnet:master May 6, 2019
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the port_spcl_to_sdk branch May 6, 2019 17:19
@gbalykov gbalykov mentioned this pull request May 22, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…oreclr#24285)

Convert managed product binary to use SDK project system.
 - Uses Arcade for versions strings
 - Overrides Arcade defined output paths - should change in the future
 

Commit migrated from dotnet/coreclr@099177b
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.

4 participants