fictiveworks / CalyxSharp

Generative text processing for C# and Unity applications
Other
0 stars 0 forks source link

Problems running msbuild on macOS/Mono #3

Closed maetl closed 2 years ago

maetl commented 2 years ago

Not sure if this is to do with a recent upgrade to Monterey, missing CLR/Mono stuff or a poorly written csproj.

Expected

Running -t:Test should compile the debug and testing DLL, execute all the unit tests for the library and generate an XML log of the results.

Actual

The following command works and runs all the tests correctly:

mono Libraries/nunitlite-runner.exe Build/Debug/Calyx.dll --work:'Build/'

But when run via the msbuild tool, the Test command fails due to a series of errors:

msbuild Calyx.csproj -t:Test

Result:

Test:
  Libraries/nunitlite-runner.exe Build/Debug/Calyx.dll --work:'Build/'
  /var/folders/q5/k94p0c3963bb47kt0rcxmq7w0000gn/T/tmp6f124313059b49a99d64c71d7e48a7b3.exec.cmd: line 1: setlocal: command not found
  /var/folders/q5/k94p0c3963bb47kt0rcxmq7w0000gn/T/tmp6f124313059b49a99d64c71d7e48a7b3.exec.cmd: line 4: Libraries/nunitlite-runner.exe: cannot execute binary file
  /var/folders/q5/k94p0c3963bb47kt0rcxmq7w0000gn/T/tmp6f124313059b49a99d64c71d7e48a7b3.exec.cmd: line 5: exit: %errorlevel%: numeric argument required

/Users/maetl/Projects/fictive/calyxsharp/Calyx.csproj(54,3): error MSB3073: The command "Libraries/nunitlite-runner.exe Build/Debug/Calyx.dll --work:'Build/'" exited with code 255.
Done Building Project "/Users/maetl/Projects/fictive/calyxsharp/Calyx.csproj" (Test target(s)) -- FAILED.
maetl commented 2 years ago

I’m investigating using nuget as a possible way around this that also potentially simplifies the build process.

maetl commented 2 years ago

Looks like the problem above was Homebrew corruption of mono after OS upgrades. Not sure what I did but it seems to be working as expected now.

Will close this, and make a separate issue/feature around nuget and GitHub Actions.