Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

enable build System.Private.Interop project#4836

Merged
luqunl merged 2 commits into
dotnet:masterfrom
luqunl:buildissue
Oct 31, 2017
Merged

enable build System.Private.Interop project#4836
luqunl merged 2 commits into
dotnet:masterfrom
luqunl:buildissue

Conversation

@luqunl
Copy link
Copy Markdown
Contributor

@luqunl luqunl commented Oct 30, 2017

verify the fix for build issue

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 30, 2017

@shrah , @MichalStrehovsky PTAL

@MichalStrehovsky
Copy link
Copy Markdown
Member

Can you confirm these two projects no longer place their build outputs in the same directory? We had build races in the official build because of that (not the CI build; the build that does signing and produces NuGet packages).

I'm still missing the broader context on these though. Are we going to ship NuGet packages of these from this repo? Or why do these project files need to build here? The build is not really set up for this - e.g. right now these libraries are going to be placed in the CoreRT SDK even though they're unused because they don't actually target CoreRT.

I'm not opposed to making changes to enable these scenarios, but it might need some broader build changes, not just hacking up OutputPath to something else.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

@MichalStrehovsky resolve two projects' build outputs in the same directory issue-- the problem is related to import a project file instead of target file.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

Are we going to ship NuGet packages of these from this repo?
// Yes, some of our customers require to use NuGet packages

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

why do these project files need to build here?
// Customer want to use open-source System.Private.Interop. To open source System.Private.Interop, there isn't many options for us.

  1. in GitHub CoreRT repro
    Pro:
    it takes less time to add/build/sign/publish/test these projects into CoreRT repro.
    Con:
    These projects doesn't 'really' belong to CoreRT.
  2. in GitHub 'new' repro
    Pro:
    These projects fits better in the 'new' repro, such as Interop Repro
    Con:
    It take much longer time to add/build/sign/publish/test these projects.

In future, We will consider Option #2.

@MichalStrehovsky
Copy link
Copy Markdown
Member

Customer want to use open-source System.Private.Interop

@luqunl There are many ways how to achieve that. E.g. the mono repo already uses the CoreRT repo as a submodule and they pick and choose files they would like to use. What's the intended consumption model here?

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

@MichalStrehovsky The consumption mode is that customers can just use nuget package generated from CoreRT branch and can submit PR for fixing S.P.Interop issues

@MichalStrehovsky
Copy link
Copy Markdown
Member

OK, so we need official builds and NuGet packaging.

This will require some broader thinking on your part. If these projects are just hooked up into whatever build configurations CoreRT repo defines, there will be issues with build matrix. Mono's and CoreCLR's build matrix is different from CoreRT. The way we have the alternate S.P.Interop projects hooked up into build.cmd right now means that you can't produce a e.g. x86 build of the S.P.Interop library without making all of CoreRT compile on x86 first (see #4589 - not even x86 is supported right now in CoreRT). Especially Mono's support matrix is huge and spans architectures and operating systems.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

System.Private.Interop for mono only works on Windows. so its matrix for using System.Private.Interop should be similar as CoreRT.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

in my mind, x86/amd64/arm build configurations for System.Private.Interop should be enough

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Oct 31, 2017

@luqunl As we have discussed during our phone call with Mono team, they are not going to consume NuGet packages from CoreRT repo. They are going to build their own binaries from CoreRT sources.

I see the Mono build flavor here just as a sanity check that things are not completely broken.

<AssemblyName>System.Private.Interop</AssemblyName>
<TargetName>$(AssemblyName)</TargetName>
<DefineConstants>$(DefineConstants);ENABLE_MIN_WINRT</DefineConstants>
<OutputType>Library</OutputType>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going to drop the binaries under sdk\mono. I would like everything under sdk to be CoreRT runtime/toolchain specific. Could you please drop these files under e.g. interop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do you mean interop folder and sdk folder are under same parent folder? like
sdk
interop

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

@jkotas, Azure Service Fabric and VS Debugger team want to consume from Nuget package

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Oct 31, 2017

Right, they are different from Mono. I would expect we will build one platform-neutral build for them.

As @MichalStrehovsky said, it will require some build plumbing to get the build and packaging right.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

@jkotas, some of interop code are architecture dependent. so neutral doesn't work for them.
such as

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Oct 31, 2017

Then you will need to choose between making this platform neutral, e.g. by using if (sizeof(int) == sizeof(IntPtr)) instead of ifdef in this case, or even more build infrastructure plumbing.

only enable mini winrt on windows OS and resolve build output folder overlap problem between CoreCLR and Mono

Please enter the commit message for your changes. Lines starting

Change output folder to {root}\interop
@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

For build infrastructure plumbing, beside support build neutral assembly, Is there anything else specific for these two projects?
In short team, In my mind, it isn't critical to enable support build neural assembly.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Oct 31, 2017

If you do not have platform neutral build, you will pay for it in the packaging and build leg complexity. Up to you where you want to pay the cost...

Either way, you may want to have separate build.cmd for the official build of the interop bits so that you do not have to build the whole corert repo just to build the interop bits.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Oct 31, 2017

Thanks for your explanation. if these two(neutral/build.cmd) becomes problem, then we can fix them one by one.

@luqunl luqunl merged commit 40d48f0 into dotnet:master Oct 31, 2017
@jkotas
Copy link
Copy Markdown
Member

jkotas commented Oct 31, 2017

@luqunl We prefer to use squash&merge option to merge regular PRs.

@luqunl
Copy link
Copy Markdown
Contributor Author

luqunl commented Nov 1, 2017

Next time, I will follow this.

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