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

Up-to-date checks: UpToDateCheckInput and UpToDateCheckOutput #2416

Merged
merged 1 commit into from
Jun 14, 2017
Merged

Up-to-date checks: UpToDateCheckInput and UpToDateCheckOutput #2416

merged 1 commit into from
Jun 14, 2017

Conversation

panopticoncentral
Copy link
Contributor

@panopticoncentral panopticoncentral commented Jun 9, 2017

Customer scenario

In the old project system, a project file can specify UpToDateCheckInput and UpToDateCheckOutput items that add items into inputs or outputs that the fast up-to-date check uses. It's a kind of escape hatch for special project extensions that the project system is not aware of.

Bugs this fixes:

Fixes #2380

Workarounds, if any

In cases where these items would be used, the user would have to manually rebuild if their project was out of date but the project system didn't see it that way.

Risk

Low, it just adds two new item types that are only used in exotic situations.

Performance impact

Low, only impacts exotic situations.

Is this a regression from a previous update?

No.

@panopticoncentral
Copy link
Contributor Author

@davkean If you could take a look and let me know what you think. I haven't added item types before, so may have done something wonky here.

I'm seeing UpToDateCheckInput and UpToDateCheckOutput items show up in Solution Explorer, is this desired?

This also removes hard-coded item types and just works off the schema that we define.

@panopticoncentral
Copy link
Contributor Author

@dotnet-bot retest this please

{
OnProjectChanged(e.Value.Item1);
OnProjectImportsChanged(e.Value.Item2);
OnSourceItemChanged(e.Value.Item3);
OnSourceItemChanged(e.Value.Item3, e.Value.Item5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment saying what is Item3 and Item5?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is Item5 tracking the CustomInput?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do. Item5 is the project schema which we use to interrogate about what item types are used for up to date input.

{
foreach (var itemType in e.ProjectChanges.Where(changes => changes.Value.Difference.AnyChanges))
var itemTypes = new HashSet<string>(projectItemSchema.GetKnownItemTypes().Where(itemType => projectItemSchema.GetItemType(itemType).UpToDateCheckInput));
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we wont be hitting this path often, so this does not seem to be a perf hit.But would we be performant in the case of loading a project with a huge number of files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This particular line of code only iterates over the list of known item types, it isn't affected by the actual number of files. Or were you concerned about something further down?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thats true. Disregard my 'number of files' comment

@@ -168,11 +182,11 @@ private void OnOutputGroupChanged(IImmutableDictionary<string, IOutputGroup> e)
}
}

private void OnChanged(IProjectVersionedValue<Tuple<IProjectSubscriptionUpdate, IProjectImportTreeSnapshot, IProjectSubscriptionUpdate, IImmutableDictionary<string, IOutputGroup>>> e)
private void OnChanged(IProjectVersionedValue<Tuple<IProjectSubscriptionUpdate, IProjectImportTreeSnapshot, IProjectSubscriptionUpdate, IImmutableDictionary<string, IOutputGroup>, IProjectItemSchema>> e)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tuple [](start = 54, length = 5)

Is there a reason this can't be a C#7 tuple? IProjectVersionedValue<(IProjectSubscriptionUpdate subscriptionUpdate, IProjectImportTreeSnapshot importTreeSnapshot, IProjectSubscriptionUpdate otherSubscriptionUpdate)>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried but got type conversion errors. I could wrestle with the type system some more to see if there's a way around that, it's possible I missed something...

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, that sounds like it might be a tuple bug. @jcouv is there a reason C# 7 tuples cannot be used above? Is this an issue that has been fixed in 7.1?

Copy link
Member

Choose a reason for hiding this comment

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

Tuples should work, but the callers need to be updated to pass tuples/System.ValueTuple instead of System.Tuple. That may have been the problem.
I tried to stop by your office to look at the error. Ping me tomorrow when you have time to try again.


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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmarolf @jcouv Yeah, that's the problem. The API expects a Tuple. The API is in the project system, so I'll log an issue to add an overload, but for now, I guess the ugly is here to stay.

@panopticoncentral
Copy link
Contributor Author

@srivatsn Since #2414 will be a little simpler, do we want to try and put this in 15.3, or should it be retargeted to 15.6?

@srivatsn
Copy link
Contributor

Tagging @MattGertz to bring this for 15.3 - the prime reason for taking this would be that this offers an escape hatch to mark items to be considered for uptodate check for items that we don't know about (i.e when we have bugs).

@srivatsn
Copy link
Contributor

@panopticoncentral this has been approved to merge now.

@srivatsn srivatsn merged commit c4d33ee into dotnet:master Jun 14, 2017
@jcouv
Copy link
Member

jcouv commented Jun 14, 2017

Thanks!
I'll build latest project-system master and install private bits to a VM for testing. It would be cool to demo Friday if things work well enough :-)

@panopticoncentral panopticoncentral deleted the additionalfiles branch June 14, 2017 19:48
@panopticoncentral
Copy link
Contributor Author

@jcouv This isn't the support for ref assemblies, that's #2414 which I'm going to update now.

@jcouv
Copy link
Member

jcouv commented Jun 14, 2017

Thanks for the clarification. I jumped the gun ;-)

kzu added a commit to kzu/MSBuildSdkExtras that referenced this pull request Mar 15, 2018
By default, VS will not consider None files that are not copied to
output to have any effect on build, and therefore changing targets
will result in VS saying there's nothing to build.

In order for the Build/Pack to trigger anytime we make changes in
any targets file, add the @(None) to the up-to-date check input
files.

Found via dotnet/project-system#2416
kzu added a commit to kzu/MSBuildSdkExtras that referenced this pull request Apr 15, 2018
clairernovotny pushed a commit to novotnyllc/MSBuildSdkExtras that referenced this pull request Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Up to date check: UpToDateCheckInput/UpToDateCheckOutput items and properties
7 participants