Azure / Azure/bicep

Azure.Bicep.MSBuild trying to use win-x64 bicep.exe on Mac

Open
#15,228 7 comments 0 reactions 1 assignee Claimed by @majastrz View on GitHub
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

We lock or dependencies and would like `dotnet build -t:BicepCompile` to work on Windows, Linux, and Mac. We are restoring all three native executable packages. It is just a little more disk space. The problem is that when I run it on my Mac, it is trying to run the `win-x64` build of `bicep.exe`. Seems like a bug.

```
~/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates> dotnet build -t:BicepCompile
Determining projects to restore...
All projects are up-to-date for restore.
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: The specified task executable "/Users/cataggar/.nuget/packages/azure.bicep.commandline.win-x64/0.30.23/build/../tools/bicep.exe" could not be run. System.ComponentModel.Win32Exception (8): An error occurred trying to start process '/Users/cataggar/.nuget/packages/azure.bicep.commandline.win-x64/0.30.23/build/../tools/bicep.exe' with working directory '/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates'. Exec format error [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.StartToolProcess(Process proc) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]

Build FAILED.

/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: The specified task executable "/Users/cataggar/.nuget/packages/azure.bicep.commandline.win-x64/0.30.23/build/../tools/bicep.exe" could not be run. System.ComponentModel.Win32Exception (8): An error occurred trying to start process '/Users/cataggar/.nuget/packages/azure.bicep.commandline.win-x64/0.30.23/build/../tools/bicep.exe' with working directory '/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates'. Exec format error [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.StartToolProcess(Process proc) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
/Users/cataggar/.nuget/packages/azure.bicep.msbuild/0.30.23/build/Azure.Bicep.MSBuild.targets(66,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [/Users/cataggar/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates/Templates.proj]
0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.59
~/ms/avs/src/avs-releases/ev2/ev2/ServiceGroupRoot/Templates> dotnet --info
.NET SDK:
Version: 8.0.401
Commit: 811edcc344
Workload version: 8.0.400-manifests.56cd0383
MSBuild version: 17.11.4+37eb419ad

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.0
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.401/
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.