Skip to content

Commit

Permalink
[msbuild] Pass MONO_PATH using --path instead of an environment varia…
Browse files Browse the repository at this point in the history
…ble. Fixes #14904. (#18810)

Fixes #14904.
  • Loading branch information
rolfbjarne committed Aug 25, 2023
1 parent 4ddee61 commit da7d3d1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompileTaskBase.cs
Expand Up @@ -186,10 +186,6 @@ public override bool Execute ()
var aotAssemblyFiles = new List<ITaskItem> ();
var processes = new Task<Execution> [assembliesToAOT.Count];

var environment = new Dictionary<string, string?> {
{ "MONO_PATH", Path.GetFullPath (InputDirectory) },
};

var globalAotArguments = AotArguments?.Select (v => v.ItemSpec).ToList ();
for (var i = 0; i < assembliesToAOT.Count; i++) {
var asm = assembliesToAOT [i];
Expand All @@ -215,6 +211,7 @@ public override bool Execute ()
Log.LogError (MSBStrings.E7071, /* Unable to parse the AOT compiler arguments: {0} ({1}) */ processArguments, ex2!.Message);
return false;
}
arguments.Add ($"--path={Path.GetFullPath (InputDirectory)}");
arguments.Add ($"{string.Join (",", parsedArguments)}");
if (globalAotArguments?.Any () == true)
arguments.Add ($"--aot={string.Join (",", globalAotArguments)}");
Expand All @@ -224,7 +221,7 @@ public override bool Execute ()
else
arguments.Add (input);

processes [i] = ExecuteAsync (AOTCompilerPath, arguments, environment: environment, sdkDevPath: SdkDevPath, showErrorIfFailure: false /* we show our own error below */)
processes [i] = ExecuteAsync (AOTCompilerPath, arguments, sdkDevPath: SdkDevPath, showErrorIfFailure: false /* we show our own error below */)
.ContinueWith ((v) => {
if (v.Result.ExitCode != 0)
Log.LogError (MSBStrings.E7118 /* Failed to AOT compile {0}, the AOT compiler exited with code {1} */, Path.GetFileName (input), v.Result.ExitCode);
Expand Down

6 comments on commit da7d3d1

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.