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

[msbuild] Pass MONO_PATH using --path instead of an environment variable. Fixes #14904. #18810

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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