Closed ps-pe closed 9 months ago
I found the same issue, using version 12.2.0
It should be possible to find the correct path both in Linux and OSX using something like
var executableName = "chmod";
var command = $"which {executableName}";
var process = new Process();
process.StartInfo.FileName = "/bin/sh";
process.StartInfo.Arguments = $"-c \"{command}\"";
process.StartInfo.RedirectStandardInput = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.Start();
var fullPath = process.StandardOutput.ReadToEnd().Trim();
process.WaitForExit();
Alternatively, in the docker image you can ln -s /bin/chmod /usr/bin/chmod
Using the official (linux-based) .NET SDK docker image (mcr.microsoft.com/dotnet/sdk:7.0, https://hub.docker.com/_/microsoft-dotnet-sdk) to build a project using dotnet CLI fails.
Error: ANT02: Cannot find Java executable''
The docker image does contain a "chmod" binary, but is is located in "/bin" not "/user/bin". The Problem seems to be that "/bin" is only searched on OSX (not Linux).
https://github.com/kaby76/Antlr4BuildTasks/blob/9a8f23cfb13b0403e3cfff82c5bf71f766a8eab8/Antlr4BuildTasks/Tasks/RunAntlrTool.cs#L1402