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

[build] Fix the Legacy Xamarin.Android build #9255

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

jonpryor
Copy link
Member

Fixes: #9253
Fixes: #9048

Multiple reports that make prepare now errors out:

% make prepare
…
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Downloading Mono archive
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Checking if all runtime files are present
  • some files are missing, download and extraction required
Downloading Mono archive from https://xamjenkinsartifact.azureedge.net/mono-sdks/android-debug-Darwin-d9a6e8710b37cd7f16cf52eff4f772556e57cc41.7z
Failed to obtain Mono archive size. HTTP status code: BadRequest (400). Mono runtimes will be rebuilt
Downloading Mono archive from https://xamjenkinsartifact.azureedge.net/mono-sdks/android-debug-Darwin-d9a6e8710b37cd7f16cf52eff4f772556e57cc41.7z
Failed to obtain Mono archive size. HTTP status code: BadRequest (400). Mono runtimes will be rebuilt
Downloading Mono archive from https://xamjenkinsartifact.azureedge.net/mono-sdks/android-debug-Darwin-d9a6e8710b37cd7f16cf52eff4f772556e57cc41.7z
Failed to obtain Mono archive size. HTTP status code: BadRequest (400). Mono runtimes will be rebuilt
Mono archive not present

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Installing Mono runtimes
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Step Xamarin.Android.Prepare.Step_InstallMonoRuntimes failed: Unable to build mono runtimes from sources.
System.InvalidOperationException: Step Xamarin.Android.Prepare.Step_InstallMonoRuntimes failed: Unable to build mono runtimes from sources.
 ---> System.NotImplementedException: Unable to build mono runtimes from sources.
   at Xamarin.Android.Prepare.Step_InstallMonoRuntimes.Execute(Context context) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs:line 34
   at Xamarin.Android.Prepare.Step.Run(Context context) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Step.cs:line 42
   at Xamarin.Android.Prepare.Scenario.Run(Context context, Log log) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Scenario.cs:line 37
   --- End of inner exception stack trace ---
   at Xamarin.Android.Prepare.Scenario.Run(Context context, Log log) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Scenario.cs:line 48
   at Xamarin.Android.Prepare.Context.Execute() in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Context.cs:line 845
   at Xamarin.Android.Prepare.App.Run(String[] args) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Main.cs:line 174

This happens because the URL
https://xamjenkinsartifact.azureedge.net/mono-sdks no longer exists (for various sundry internal reasons), and was replaced by https://download.mono-project.com/mono-sdks.

Update Configurables.Urls.MonoArchive_BaseUri to use the new URL.

Additionally, the new URL only contains release artifacts. Update Configurables.Defaults.MonoSdksConfiguration to always be release so that the appropriate archive and extracted directories are used.

Fixes: #9253
Fixes: #9048

Multiple reports that `make prepare` now errors out:

	% make prepare
	…
	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Downloading Mono archive
	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

	Checking if all runtime files are present
	  • some files are missing, download and extraction required
	Downloading Mono archive from https://xamjenkinsartifact.azureedge.net/mono-sdks/android-debug-Darwin-d9a6e8710b37cd7f16cf52eff4f772556e57cc41.7z
	Failed to obtain Mono archive size. HTTP status code: BadRequest (400). Mono runtimes will be rebuilt
	Downloading Mono archive from https://xamjenkinsartifact.azureedge.net/mono-sdks/android-debug-Darwin-d9a6e8710b37cd7f16cf52eff4f772556e57cc41.7z
	Failed to obtain Mono archive size. HTTP status code: BadRequest (400). Mono runtimes will be rebuilt
	Downloading Mono archive from https://xamjenkinsartifact.azureedge.net/mono-sdks/android-debug-Darwin-d9a6e8710b37cd7f16cf52eff4f772556e57cc41.7z
	Failed to obtain Mono archive size. HTTP status code: BadRequest (400). Mono runtimes will be rebuilt
	Mono archive not present

	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Installing Mono runtimes
	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

	Step Xamarin.Android.Prepare.Step_InstallMonoRuntimes failed: Unable to build mono runtimes from sources.
	System.InvalidOperationException: Step Xamarin.Android.Prepare.Step_InstallMonoRuntimes failed: Unable to build mono runtimes from sources.
	 ---> System.NotImplementedException: Unable to build mono runtimes from sources.
	   at Xamarin.Android.Prepare.Step_InstallMonoRuntimes.Execute(Context context) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs:line 34
	   at Xamarin.Android.Prepare.Step.Run(Context context) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Step.cs:line 42
	   at Xamarin.Android.Prepare.Scenario.Run(Context context, Log log) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Scenario.cs:line 37
	   --- End of inner exception stack trace ---
	   at Xamarin.Android.Prepare.Scenario.Run(Context context, Log log) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Scenario.cs:line 48
	   at Xamarin.Android.Prepare.Context.Execute() in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Application/Context.cs:line 845
	   at Xamarin.Android.Prepare.App.Run(String[] args) in /Users/wangyk/Projects/Practice/xamarin-android/build-tools/xaprepare/xaprepare/Main.cs:line 174

This happens because the URL
<https://xamjenkinsartifact.azureedge.net>
no longer exists (for various sundry internal reasons), and was
replaced by <https://download.mono-project.com>.

Update `$(MonoDarwinPackageUrl)` to use the new URL.

Update `Configurables.Urls.MonoArchive_BaseUri` to use the new URL.

Additionally, the new URL only contains *release* artifacts.  Update
`Configurables.Defaults.MonoSdksConfiguration` to always be `release`
so that the appropriate archive and extracted directories are used.
@jonpryor jonpryor force-pushed the dev/jonp/jonp-fix-d17.5-build branch from cb755bb to 265be09 Compare August 28, 2024 14:50
GitHub redirects xamarin/xamarin-android to dotnet/android, causing
e.g. `AndroidHandlerTestBase.Redirect_Without_Protocol_Works()` to
fail.  Update the expected URLs so they pass as expected.
@maonaoda
Copy link

@jonpryor
thanks,I did exactly that yesterday.
image

@jonpryor jonpryor merged commit e8d4d9b into d17-5 Aug 29, 2024
11 of 22 checks passed
@jonpryor jonpryor deleted the dev/jonp/jonp-fix-d17.5-build branch August 29, 2024 11:38
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 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