Skip to content

Conversation

@jonpryor
Copy link
Contributor

Context: 286b9c2
Context: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/700/testReport/

Xamarin.ProjectTools was updated in commit 286b9c2 to use msbuild
(via xabuild) when $USE_MSBUILD is not 0, and to continue
using xbuild (the historical default!) when $USE_MSBUILD is 0.

Unfortunately, nothing exports $USE_MSBUILD. Consequently, we
always use msbuild/xabuild, unless the calling environment
explicitly exports it (which isn't the case on Jenkins).

Update the RUN_NUNIT_TEST make define so that the $USE_MSBUILD
environment variable is exported to the value of the
$(USE_MSBUILD) make variable, IFF it's not the empty string.
If $(USE_MSBUILD) is the empty string, export USE_MSBUILD=0,
which will cause xbuild to be used.

With luck, this will allow the current Xamarin.Android.Build.Tests
failures -- all 20 of them -- to be "fixed" until such time as all
Xamarin.Android.Build.Tests tests actually pass w/ MSBuild.

Context: 286b9c2
Context: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/700/testReport/

`Xamarin.ProjectTools` was updated in commit 286b9c2 to use `msbuild`
(via `xabuild`) when `$USE_MSBUILD` is *not* `0`, and to continue
using `xbuild` (the historical default!) when `$USE_MSBUILD` is `0`.

Unfortunately, *nothing exports `$USE_MSBUILD`*. Consequently, we
*always* use `msbuild`/`xabuild`, unless the calling environment
explicitly exports it (which isn't the case on Jenkins).

Update the `RUN_NUNIT_TEST` make `define` so that the `$USE_MSBUILD`
environment variable is exported to the *value of* the
`$(USE_MSBUILD)` make variable, IFF it's not the empty string.
If `$(USE_MSBUILD)` *is* the empty string, export `USE_MSBUILD=0`,
which will cause `xbuild` to be used.

With luck, this will allow the current `Xamarin.Android.Build.Tests`
failures -- all 20 of them -- to be "fixed" until such time as all
`Xamarin.Android.Build.Tests` tests *actually* pass w/ MSBuild.
@dellis1972
Copy link
Contributor

This should not be needed..

RunningMSBuild = true;
if (!string.IsNullOrEmpty (useMSBuild) && useMSBuild == "0") {
    RunningMSBuild = false;
}

if the USE_MSBUILD is empty this will fail and we will continue to use msbuild which I thought was the goal? This PR will force us back to using xbuild for the tests..

@jonpryor jonpryor merged commit 8091b7d into dotnet:master Oct 24, 2017
Redth pushed a commit to Redth/xamarin-android that referenced this pull request Oct 30, 2017
Context: 8643ded
Context: 286b9c2
Context: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/700/testReport/

`Xamarin.ProjectTools` was updated in commit 8643ded to use `msbuild`
(via `xabuild`) *by default*, and commit 286b9c2 updated
`Xamarin.ProjectTools` to further use `msbuild`/`xabuild` when the
`$USE_MSBUILD` environment variable is *not* `0`, and to continue
using `xbuild` when `$USE_MSBUILD` is `0`.

Meaning before 8643ded `xbuild` was used for
`Xamarin.Android.Build.Tests` execution, and afterward `msbuild`
was used. (This change wasn't explicitly clear to some.)

"Revert" this behavior; use `xbuild` *by default* for 
`Xamarin.Android.Build.Tests` execution, by updating the
`RUN_NUNIT_TEST` make `define` so that the `$USE_MSBUILD`
environment variable is exported to the *value of* the
`$(USE_MSBUILD)` make variable, IFF it's not the empty string.
If `$(USE_MSBUILD)` *is* the empty string, export `USE_MSBUILD=0`,
which will cause `xbuild` to be used.

What his means is that a default unit test invocation:

	make run-all-tests

will use `xbuild` to run `Xamarin.Android.Build.Tests`. However,
if `msbuild` is *explicitly opted into*, then `msbuild` is used:

	$ make run-all-tests MSBUILD=msbuild
	# -or-
	$ make run-all-tests MSBUILD=some/path/to/msbuild USE_MSBUILD=1

Furthermore, if/when we change the default MSBuild engine to
`msbuild` in the future -- by altering
`build-tools/scripts/msbuild.mk` to set `MSBUILD=msbuild` and
`USE_MSBUILD=1` by default -- then `make run-all-tests` will
*implicitly* follow suit.

With luck, "reverting" to `xbuild` use will allow the
[current `Xamarin.Android.Build.Tests` failures][xa700t] -- all 20 of
them -- to be "fixed" until such time as all
`Xamarin.Android.Build.Tests` tests *actually* pass with `msbuild`.

[xa700t]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/700/testReport/
jonpryor added a commit that referenced this pull request Mar 22, 2022
Changes: dotnet/java-interop@05bfece...9760f0a

  * dotnet/java-interop@9760f0a9: [Java.Interop-MonoAndroid] Set Version after Directory.Build.props (#965)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Apr 19, 2022
Fixes: dotnet/java-interop#967

Changes: dotnet/java-interop@05bfece...05eddd9

  * dotnet/java-interop@05eddd9a: [generator] Add string cast to prevent CS1503 (dotnet#970)
  * dotnet/java-interop@37cff251: [Java.Base, generator] Bind all of package java.io (dotnet#968)
  * dotnet/java-interop@a65d6fb4: [Java.Base, generator] Bind all of package java.lang (dotnet#966)
  * dotnet/java-interop@ed9c2abf: [Java.Interop-MonoAndroid] Set Version after Directory.Build.props (dotnet#965)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Apr 19, 2022
Fixes: dotnet/java-interop#967

Changes: dotnet/java-interop@05bfece...05eddd9

  * dotnet/java-interop@05eddd9a: [generator] Add string cast to prevent CS1503 (dotnet#970)
  * dotnet/java-interop@37cff251: [Java.Base, generator] Bind all of package java.io (dotnet#968)
  * dotnet/java-interop@a65d6fb4: [Java.Base, generator] Bind all of package java.lang (dotnet#966)
  * dotnet/java-interop@ed9c2abf: [Java.Interop-MonoAndroid] Set Version after Directory.Build.props (dotnet#965)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Apr 21, 2022
Fixes: dotnet/java-interop#967

Changes: dotnet/java-interop@05bfece...2a882d2

  * dotnet/java-interop@2a882d2d: [generator] Fix xamarin-android/src/Mono.Android build (dotnet#972)
  * dotnet/java-interop@968e0f5f: [Directory.Build.props] Set dummy $(PackageVersion) to appease NuGet (dotnet#971)
  * dotnet/java-interop@05eddd9a: [generator] Add string cast to prevent CS1503 (dotnet#970)
  * dotnet/java-interop@37cff251: [Java.Base, generator] Bind all of package java.io (dotnet#968)
  * dotnet/java-interop@a65d6fb4: [Java.Base, generator] Bind all of package java.lang (dotnet#966)
  * dotnet/java-interop@ed9c2abf: [Java.Interop-MonoAndroid] Set Version after Directory.Build.props (dotnet#965)
jonpryor added a commit that referenced this pull request Apr 21, 2022
Fixes: dotnet/java-interop#967

Changes: dotnet/java-interop@05bfece...2a882d2

  * dotnet/java-interop@2a882d2d: [generator] Fix xamarin-android/src/Mono.Android build (#972)
  * dotnet/java-interop@968e0f5f: [Directory.Build.props] Set dummy $(PackageVersion) to appease NuGet (#971)
  * dotnet/java-interop@05eddd9a: [generator] Add string cast to prevent CS1503 (#970)
  * dotnet/java-interop@37cff251: [Java.Base, generator] Bind all of package java.io (#968)
  * dotnet/java-interop@a65d6fb4: [Java.Base, generator] Bind all of package java.lang (#966)
  * dotnet/java-interop@ed9c2abf: [Java.Interop-MonoAndroid] Set Version after Directory.Build.props (#965)
jonathanpeppers pushed a commit that referenced this pull request Apr 25, 2022
Fixes: dotnet/java-interop#967

Changes: dotnet/java-interop@05bfece...2a882d2

  * dotnet/java-interop@2a882d2d: [generator] Fix xamarin-android/src/Mono.Android build (#972)
  * dotnet/java-interop@968e0f5f: [Directory.Build.props] Set dummy $(PackageVersion) to appease NuGet (#971)
  * dotnet/java-interop@05eddd9a: [generator] Add string cast to prevent CS1503 (#970)
  * dotnet/java-interop@37cff251: [Java.Base, generator] Bind all of package java.io (#968)
  * dotnet/java-interop@a65d6fb4: [Java.Base, generator] Bind all of package java.lang (#966)
  * dotnet/java-interop@ed9c2abf: [Java.Interop-MonoAndroid] Set Version after Directory.Build.props (#965)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 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