Skip to content

Conversation

jonathanpeppers
Copy link
Member

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10431207&view=ms.vss-test-web.build-test-results-tab&runId=114098346&resultId=100000&paneView=debug

The FastDeployEnvironmentFiles(false) test fails on PRs from forks, because the "Fast Deployment" feature is not included in OSS builds.

The problem appears to be related to target ordering:

  • _GetGenerateJavaStubsInputs : uses @(AndroidEnvironment) to set @(_EnvironmentFiles)

  • _GetGenerateJavaStubs : must have same Inputs as _GeneratePackageManagerJava

  • _GeneratePackageManagerJava: actually uses @(_EnvironmentFiles)

  • _GenerateEnvironmentFiles : creates a new @(AndroidEnvironment) file, that won't be used!

But when using either a Release build or Debug build with FastDev enabled, everything works fine.

To fix this, we can rework the target ordering:

  • _GetGenerateJavaStubsInputs depends on _GenerateEnvironmentFiles

  • Unfortunately, this is now a circular dependency that causes an MSBuild error.

  • _GenerateEnvironmentFiles no longer depends on _ReadAndroidManifest to break the cycle.

I does not appear that _ReadAndroidManifest is needed, as no properties created there are used.

…FastDev is off

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10431207&view=ms.vss-test-web.build-test-results-tab&runId=114098346&resultId=100000&paneView=debug

The `FastDeployEnvironmentFiles(false)` test fails on PRs from forks,
because the "Fast Deployment" feature is not included in OSS builds.

The problem appears to be related to target ordering:

* `_GetGenerateJavaStubsInputs` : uses `@(AndroidEnvironment)` to set
  `@(_EnvironmentFiles)`

* `_GetGenerateJavaStubs` : must have same `Inputs` as
  `_GeneratePackageManagerJava`

* `_GeneratePackageManagerJava`: actually uses `@(_EnvironmentFiles)`

* `_GenerateEnvironmentFiles` : creates a new `@(AndroidEnvironment)`
  file, that won't be used!

But when using either a `Release` build or `Debug` build with
`FastDev` enabled, everything works fine.

To fix this, we can rework the target ordering:

* `_GetGenerateJavaStubsInputs` depends on `_GenerateEnvironmentFiles`

* Unfortunately, this is now a circular dependency that causes an
  MSBuild error.

* `_GenerateEnvironmentFiles` no longer depends on
  `_ReadAndroidManifest` to break the cycle.

I does not appear that `_ReadAndroidManifest` is needed, as no
properties created there are used.
@jonpryor
Copy link
Contributor

[Xamarin.Android.Build.Tasks] $DOTNET_MODIFIABLE_ASSEMBLIES & FastDev (#9451)

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10431207&view=ms.vss-test-web.build-test-results-tab&runId=114098346&resultId=100000&paneView=debug

The `FastDeployEnvironmentFiles(false)` test fails on PRs from forks,
because the "Fast Deployment" feature is not included in OSS builds:

	The Environment variable "DOTNET_MODIFIABLE_ASSEMBLIES" was not set.
	Expected: String containing "DOTNET_MODIFIABLE_ASSEMBLIES=Debug"
	But was:  "--------- beginning of main …

The problem appears to be related to target ordering:

  * `_GetGenerateJavaStubsInputs` : uses `@(AndroidEnvironment)` to
    set `@(_EnvironmentFiles)`

  * `_GetGenerateJavaStubs` : must have same `Inputs` as
    `_GeneratePackageManagerJava`

  * `_GeneratePackageManagerJava`: actually uses `@(_EnvironmentFiles)`

  * `_GenerateEnvironmentFiles` : creates a new
    `@(AndroidEnvironment)` file that won't be used!

But when using either a `Release` build or `Debug` build with
`FastDev` enabled, everything works fine.

To fix this, rework the target ordering:

  * `_GetGenerateJavaStubsInputs` depends on
    `_GenerateEnvironmentFiles`

    Unfortunately, this is now a circular dependency that causes an
    MSBuild error.

  * Break the cycle by updating `_GenerateEnvironmentFiles` to no
    longer depend upon `_ReadAndroidManifest`.

    It does not appear that `_ReadAndroidManifest` is needed by
    `_GenerateEnvironmentFiles`, as no properties created there are
    used.

@jonpryor jonpryor merged commit ee7c73e into main Oct 25, 2024
56 of 58 checks passed
@jonpryor jonpryor deleted the dev/peppers/FastDeployEnvironmentFiles branch October 25, 2024 17:04
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants