Skip to content

Need to move OS dependency checks & installation out of MSBuild #2562

@jonpryor

Description

@jonpryor

Consider: https://jenkins.mono-project.com/job/xamarin-android-debug/85/console

This was a bot that had an (ancient!) Mono 5.4.1.7 installed, and make prepare fails:

14:17:12 nuget restore Xamarin.Android.sln
...
14:17:57 msbuild /p:Configuration=Debug /p:AutoProvision=True /p:AutoProvisionUsesSudo=True /p:IgnoreMaxMonoVersion=False /v:d /restore "build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj"
...
14:17:57 MSBUILD : error MSB1001: Unknown switch.
14:17:57 Switch: /restore

The problem is that make prepare calls nuget restore Xamarin.Android.sln, and -- depending on NuGet version -- this may call msbuild /restore. The msbuild included with Mono 5.4.1.7 didn't support msbuild /restore, hence the failure.

The "funny" thing is, we need to get past make prepare-external in order to get to make prepare-reps, which will build build-tools/dependencies/dependencies.csproj, check the installed mono version, and update the system mono if necessary.

Except this causes a circular dependency: we can't build dependencies.csproj until after we've run nuget restore, and we can't (necessarily) run nuget restore until we've gotten an updated Mono install.

We need to break this circular dependency, and the sanest way to do that is to move the current dependency checking logic out of MSBuild (sigh), and into something that doesn't depend on mono.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions