Skip to content

Extract Rebuild library#51709

Merged
RikkiGibson merged 8 commits intodotnet:mainfrom
RikkiGibson:rebuild-lib
Mar 8, 2021
Merged

Extract Rebuild library#51709
RikkiGibson merged 8 commits intodotnet:mainfrom
RikkiGibson:rebuild-lib

Conversation

@RikkiGibson
Copy link
Member

No description provided.

@ghost ghost added the Area-Compilers label Mar 6, 2021
@RikkiGibson RikkiGibson marked this pull request as ready for review March 6, 2021 01:58
@RikkiGibson RikkiGibson requested review from a team as code owners March 6, 2021 01:58
@RikkiGibson
Copy link
Member Author

I added the new project to the solution via dotnet sln add and BuildBoss gives me the following failure:

Processing Solution D:\workspace\_work\1\s\Compilers.sln ... FAILED
Processed 71 projects
Project Rebuild.csproj should have GUID 9a19103f-16f7-4668-be54-9a1e7a4f7556 but has fae04ec0-301f-11d3-bf4b-00c04f79efbc

Processing Solution D:\workspace\_work\1\s\Roslyn.sln ... FAILED
Processed 197 projects
Project Rebuild.csproj should have GUID 9a19103f-16f7-4668-be54-9a1e7a4f7556 but has fae04ec0-301f-11d3-bf4b-00c04f79efbc

I don't know what this means, but I guess I might need to try again to add the project from Visual Studio. @jaredpar

@jaredpar
Copy link
Member

jaredpar commented Mar 8, 2021

I don't know what this means, but I guess I might need to try again to add the project from Visual Studio.

It just means that the GUID used in the SLN file is incorrect. The line which declares the project , and likely the subsetquent consupmions, use the wrong GUID.

<OutputType>Library</OutputType>
<TargetFrameworks>netcoreapp3.1;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<Nullable>enable</Nullable>
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? Think it should just come from the Directory.Build.props file

Copy link
Member Author

Choose a reason for hiding this comment

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

BuildValidator also does this. I'll remove both entries in a subsequent PR.

/// An abstraction for building from a MetadataReaderProvider
/// </summary>
internal class BuildConstructor
public class BuildConstructor
Copy link
Contributor

Choose a reason for hiding this comment

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

public [](start = 4, length = 6)

Should the types in this assembly be kept as internal with InternalsVisibleTo() access added for BuildValidator?

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 do intend for external users to be able to consume this library. I want to punt on the decision of which members to reduce to internal accessibility until we get closer to the point where the public API is ready for review.

Copy link
Contributor

Choose a reason for hiding this comment

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

We do intend for external users to be able to consume this library.

If these types will be public, we should also review the namespace names when the public API is reviewed.


In reply to: 589681272 [](ancestors = 589681272)

/// An abstraction for building from a MetadataReaderProvider
/// </summary>
internal class BuildConstructor
public class BuildConstructor
Copy link
Contributor

Choose a reason for hiding this comment

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

class [](start = 11, length = 5)

sealed

Copy link
Member Author

Choose a reason for hiding this comment

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

Will address in follow-up.

}

internal class CompilationOptionsReader
public class CompilationOptionsReader
Copy link
Contributor

Choose a reason for hiding this comment

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

class [](start = 11, length = 5)

sealed

Copy link
Member Author

Choose a reason for hiding this comment

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

Will address in follow-up.

var methodSymbols = typeSymbol
.GetMembers(mainMethodName)
.OfType<IMethodSymbol>();
return methodSymbols.FirstOrDefault();
Copy link
Contributor

Choose a reason for hiding this comment

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

FirstOrDefault [](start = 45, length = 14)

Do we need to handle the case where there are multiple "Main" methods in the type? Could we simply use producedCompilation.GetEntryPoint() instead (and avoid looking at optionsReader as well)?

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'm interested in looking more closely at this, as I believe it is buggy, however in this PR I will just migrate this as-is.

var parseResult = JsonConvert.DeserializeAnonymousType(Encoding.UTF8.GetString(sourceLinkUTF8), new { documents = (Dictionary<string, string>?)null });
var sourceLinks = parseResult.documents.Select(makeSourceLink).ToImmutableArray();

if (sourceLinks.IsDefault)
Copy link
Contributor

Choose a reason for hiding this comment

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

sourceLinks.IsDefault [](start = 16, length = 21)

Does ToImmutableArray() ever return default?

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 do not think so.

@RikkiGibson RikkiGibson merged commit f7f683a into dotnet:main Mar 8, 2021
@RikkiGibson RikkiGibson deleted the rebuild-lib branch March 8, 2021 20:47
@allisonchou allisonchou added this to the Next milestone Mar 12, 2021
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants