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

When the $(DesignTimeBuild) flag changes, build.props is invalidated #1958

Closed
jonathanpeppers opened this issue Jul 12, 2018 · 0 comments
Closed
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. bug Component does not function as intended. vs-sync For internal use only; creates a VSTS "mirror" issue.
Milestone

Comments

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Jul 12, 2018

Steps to Reproduce

  1. Build
  2. Cause a Design-Time Build to occur
  3. Build again
  4. More things build than should

Context: #1933
Context: #1943

One of the issues I noticed while debugging the issue with #1933 is
that $(IntermediateOutputPath)build.props gets invalidated if
$(DesignTimeBuild) changes. build.props triggers alot of targets
to build completely again, so this is pretty bad for our build times
in an IDE...

Design-Time Builds can run quite frequently in VS Windows, and we
don't want to rebuild a bunch of things unnecessarily when the user
switches back to a regular build.

Expected Behavior

Design-time builds should not invalidate obj\Debug\build.props, and therefore:

Design-time builds should not trigger any of the following targets if there are no changes:

  • _LinkAssembliesNoShrink
  • _UpdateAndroidResgen

Actual Behavior

Design-time builds cause a future build (even with no changes) to be slower.

Version Information

Happens on master/d15-8.

VS bug #660393

@jonathanpeppers jonathanpeppers self-assigned this Jul 12, 2018
@jonathanpeppers jonathanpeppers added the vs-sync For internal use only; creates a VSTS "mirror" issue. label Jul 12, 2018
@jonathanpeppers jonathanpeppers added the bug Component does not function as intended. label Jul 12, 2018
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Jul 13, 2018
Fixes: dotnet#1958
Context: dotnet#1933
Context: dotnet#1943

One of the issues I noticed while debugging the issue with dotnet#1933 is
that `$(IntermediateOutputPath)build.props` gets invalidated if
`$(DesignTimeBuild)` changes. `build.props` triggers alot of targets
to build completely again, so this is pretty bad for our build times
in an IDE...

Design-Time Builds can run quite frequently in VS Windows, and we
don't want to rebuild a bunch of things unnecessarily when the user
switches back to a regular build.

So a solution, is to use a `obj/Debug/designtime/build.props` that
works independantly of `build.props`. This prevents some slower
targets from running when they shouldn't, such as
`_UpdateAndroidResgen`.

I added a test to validate these changes, which also verify that
`IncrementalClean` isn't deleting these files.

Other changes:
- Updated `.gitignore` for `*.binlog`
- Renamed `_AndroidDesignTimeResDirIntermediate` to
  `_AndroidIntermediateDesignTimeBuildDirectory` and declared it
  earlier in `Xamarin.Android.Common.targets`
- `CleanDependsOn` also needs to specify the
  `_CleanDesignTimeIntermediateDir` target, I updated the
  `BuildApplicationAndClean` test to verify this
@jonathanpeppers jonathanpeppers added the Area: App+Library Build Issues when building Library projects or Application projects. label Jul 13, 2018
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Jul 17, 2018
Fixes: dotnet#1958
Context: dotnet#1933
Context: dotnet#1943

One of the issues I noticed while debugging the issue with dotnet#1933 is
that `$(IntermediateOutputPath)build.props` gets invalidated if
`$(DesignTimeBuild)` changes. `build.props` triggers alot of targets
to build completely again, so this is pretty bad for our build times
in an IDE...

Design-Time Builds can run quite frequently in VS Windows, and we
don't want to rebuild a bunch of things unnecessarily when the user
switches back to a regular build.

So a solution, is to use a `obj/Debug/designtime/build.props` that
works independantly of `build.props`. This prevents some slower
targets from running when they shouldn't, such as
`_UpdateAndroidResgen`.

I added a test to validate these changes, which also verify that
`IncrementalClean` isn't deleting these files.

It also is important to point out that any files in the `designtime`
directory are not deleted during a `Clean`. Context on this here:
dotnet@34a3774

Other changes:
- Updated `.gitignore` for `*.binlog`
- Renamed `_AndroidDesignTimeResDirIntermediate` to
  `_AndroidIntermediateDesignTimeBuildDirectory` and declared it
  earlier in `Xamarin.Android.Common.targets`
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Jul 17, 2018
Fixes: dotnet#1958
Context: dotnet#1933
Context: dotnet#1943

One of the issues I noticed while debugging the issue with dotnet#1933 is
that `$(IntermediateOutputPath)build.props` gets invalidated if
`$(DesignTimeBuild)` changes. `build.props` triggers alot of targets
to build completely again, so this is pretty bad for our build times
in an IDE...

Design-Time Builds can run quite frequently in VS Windows, and we
don't want to rebuild a bunch of things unnecessarily when the user
switches back to a regular build.

So a solution, is to use a `obj/Debug/designtime/build.props` that
works independantly of `build.props`. This prevents some slower
targets from running when they shouldn't, such as
`_UpdateAndroidResgen`.

I added a test to validate these changes, which also verify that
`IncrementalClean` isn't deleting these files.

It also is important to point out that any files in the `designtime`
directory are not deleted during a `Clean`. Context on this here:
dotnet@34a3774

Other changes:
- Updated `.gitignore` for `*.binlog`
- Renamed `_AndroidDesignTimeResDirIntermediate` to
  `_AndroidIntermediateDesignTimeBuildDirectory` and declared it
  earlier in `Xamarin.Android.Common.targets`
dellis1972 pushed a commit that referenced this issue Jul 19, 2018
Fixes: #1958
Context: #1933
Context: #1943

One of the issues I noticed while debugging the issue with #1933 is
that `$(IntermediateOutputPath)build.props` gets invalidated if
`$(DesignTimeBuild)` changes. `build.props` triggers alot of targets
to build completely again, so this is pretty bad for our build times
in an IDE...

Design-Time Builds can run quite frequently in VS Windows, and we
don't want to rebuild a bunch of things unnecessarily when the user
switches back to a regular build.

So a solution, is to use a `obj/Debug/designtime/build.props` that
works independantly of `build.props`. This prevents some slower
targets from running when they shouldn't, such as
`_UpdateAndroidResgen`.

I added a test to validate these changes, which also verify that
`IncrementalClean` isn't deleting these files.

It also is important to point out that any files in the `designtime`
directory are not deleted during a `Clean`. Context on this here:
34a3774

Other changes:
- Updated `.gitignore` for `*.binlog`
- Renamed `_AndroidDesignTimeResDirIntermediate` to
  `_AndroidIntermediateDesignTimeBuildDirectory` and declared it
  earlier in `Xamarin.Android.Common.targets`
jonpryor pushed a commit that referenced this issue Aug 3, 2018
Fixes: #1958
Context: #1933
Context: #1943

One of the issues I noticed while debugging the issue with #1933 is
that `$(IntermediateOutputPath)build.props` gets invalidated if
`$(DesignTimeBuild)` changes. `build.props` triggers alot of targets
to build completely again, so this is pretty bad for our build times
in an IDE...

Design-Time Builds can run quite frequently in VS Windows, and we
don't want to rebuild a bunch of things unnecessarily when the user
switches back to a regular build.

So a solution, is to use a `obj/Debug/designtime/build.props` that
works independantly of `build.props`. This prevents some slower
targets from running when they shouldn't, such as
`_UpdateAndroidResgen`.

I added a test to validate these changes, which also verify that
`IncrementalClean` isn't deleting these files.

It also is important to point out that any files in the `designtime`
directory are not deleted during a `Clean`. Context on this here:
34a3774

Other changes:
- Updated `.gitignore` for `*.binlog`
- Renamed `_AndroidDesignTimeResDirIntermediate` to
  `_AndroidIntermediateDesignTimeBuildDirectory` and declared it
  earlier in `Xamarin.Android.Common.targets`
@xamarin-release-manager xamarin-release-manager added this to the d16-0 milestone Aug 7, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. bug Component does not function as intended. vs-sync For internal use only; creates a VSTS "mirror" issue.
Projects
None yet
Development

No branches or pull requests

2 participants