Skip to content
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

Consider collapsing libraries reference and source projects #37961

Closed
ViktorHofer opened this issue Jun 16, 2020 · 6 comments
Closed

Consider collapsing libraries reference and source projects #37961

ViktorHofer opened this issue Jun 16, 2020 · 6 comments

Comments

@ViktorHofer
Copy link
Member

ViktorHofer commented Jun 16, 2020

Reference assemblies can be generated by roslyn via the RefOut feature. Even though the RefOut feature would handle most of the requirements, there are other ways to accomplish this.

Collapsing our ref and source projects together would help us make progress on different developer productivity asks:

  • Add a Libraries.sln that contains all the source and test projects.
  • Make F12 (Go to definition) work by not jumping to ref project's source code. //presumably refout only
  • Potentially (not measured yet!) save costs by eliminating the additional project evaluation and project restore for the ref project. //refout only

dotnet/project-system#6069 tracks reducing project load times inside VS when using nuget msbuild resolvers, which I see as a precursor to add a Libraries.sln to the repo.

Related issues that would be fixed by this:

cc @ericstj @joperezr @jaredpar @safern @Anipik

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Jun 16, 2020
@ghost
Copy link

ghost commented Jun 16, 2020

Tagging subscribers to this area: @safern, @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@joperezr
Copy link
Member

While I totally agree that this would give us a lot of benefits, it is also worth noting some of the drawbacks of this:

  • How do we plan on running ApiCompat after this? Specifically how do we make sure that we don't break ApiCompat across different TFMs?
  • Today we don't have coverage for breaking ApiCompat from previous releases, but this may be something we want to consider now.
  • It has been said in the past from regular code reviewers in the team that having a checked-in ref helps detecting PRs that have API changes which results in different review tactics or the need to go through API Review first. How do we plan to tackle that without a checked in source?

@ViktorHofer
Copy link
Member Author

In addition to what @joperezr expressed above, here are some of the concerns that @ericstj expressed around the RefOut feature:

  • resources are compiled into the ref assembly
  • internals aren't stripped
  • typedefs from dependencies aren't resolvable (i.e. System.Runtime -> System.Private.CoreLib)
  • reference for runtime specific assembly (which reference would be picked if the project multi-targets on runtimes)
  • different configurations/tfms between ref and src

@ViktorHofer
Copy link
Member Author

How do we plan on running ApiCompat after this? Specifically how do we make sure that we don't break ApiCompat across different TFMs?

That's TBD. Presumably the same way we do today by comparing the generated reference assembly with the source one (which might or might not be beneficial, ie refout might already guarantee that). We would still generate the reference and the source assemblies so ApiCompat would be able to compare them.

Today we don't have coverage for breaking ApiCompat from previous releases, but this may be something we want to consider now.

AFAIK we already do: https://github.com/dotnet/runtime/blob/master/src/libraries/shims/ApiCompat.proj#L102-L119.

It has been said in the past from regular code reviewers in the team that having a checked-in ref helps detecting PRs that have API changes which results in different review tactics or the need to go through API Review first. How do we plan to tackle that without a checked in source?

Agree. We could still check-in a generated reference file for such purpose.

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2020
@Anipik Anipik added this to the Future milestone Jul 8, 2020
@ViktorHofer ViktorHofer modified the milestones: Future, 6.0.0 Sep 26, 2020
@ViktorHofer
Copy link
Member Author

ViktorHofer commented Oct 4, 2020

Related issue: #28888 that we might want to address if we decide to use the linker to trim down produced reference assemblies.

@ViktorHofer
Copy link
Member Author

Closing as dup of #58163

@ghost ghost locked as resolved and limited conversation to collaborators Nov 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants