KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.45k stars 196 forks source link

Works on Linux? #616

Open lonix1 opened 2 years ago

lonix1 commented 2 years ago

There are instructions for Windows and Mac.

Does someone know how to use this on Linux?

Thanks!

(PS: I see there's an online tool, but I can't use that - I'm interested in a desktop app like for Win/Mac.)

KirillOsenkov commented 2 years ago

Try the Avalonia version?

lonix1 commented 2 years ago

@KirillOsenkov Some feedback:

I followed these instructions for the Mac/Avalonia version:

dotnet build MSBuildStructuredLog.Avalonia.sln
dotnet publish MSBuildStructuredLog.Avalonia.sln --self-contained -o ../dist

And I got publish errors:

/usr/share/dotnet/sdk/6.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.CrossTargeting.targets(27,5): error NETSDK1129: The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, you must specify the framework for the published application. [/tmp/msbuildlog/MSBuildStructuredLog/src/TaskRunner/TaskRunner.csproj]

/usr/share/dotnet/sdk/6.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(154,5): error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false. [/tmp/msbuildlog/MSBuildStructuredLog/src/StructuredLogViewer.Avalonia/StructuredLogViewer.Avalonia.csproj]

However I managed to run ../dist/StructuredLogViewer.Avalonia.

Can I ignore those errors, or will they affect the running of the programme somehow?

BTW: I'm using gnome / ubuntu 20.04; dotnet 6

KirillOsenkov commented 2 years ago

@dsplaisted do you know how to fix the publish errors above? Thx!

lonix1 commented 2 years ago

PS another (minor) piece of feedback for linux: it doesn't have a (gnome) toolbar icon.

Otherwise it seems to work, so far. It may be a good idea to add a linux section to the install docs and point users to the link above. It seems to be stable enough for general use.

Very impressive piece of software, thank you so much for making it!

dsplaisted commented 2 years ago

Try publishing the StructuredLogViewer.Avalonia.csproj project directly instead of the whole solution:

dotnet publish StructuredLogViewer.Avalonia.csproj --self-contained --runtime ubuntu.14.04-x64

A different runtime identifier might work (better), I'm just going off of what is listed in the project itself.

lonix1 commented 2 years ago

Thanks! Unsure what the implications are given that I'm using ubuntu 20, not 14 - but it compiled without error.

I suggest this for the linux docs, which works for me:

build:

git clone https://github.com/KirillOsenkov/MSBuildStructuredLog
cd MSBuildStructuredLog
dotnet build MSBuildStructuredLog.Avalonia.sln --configuration Release
dotnet publish src/StructuredLogViewer.Avalonia --configuration Release --self-contained --runtime ubuntu.14.04-x64 -o <output_directory>
chmod -x /output_directory_from_above/*
chmod +x /output_directory_from_above/StructuredLogViewer.Avalonia

create script $HOME/.local/bin/structured-log-viewer (or wherever is in PATH):

#!/bin/sh
exec /output_directory_from_above/StructuredLogViewer.Avalonia "$@"

Then the GUI can be opened as usual by running that app, or like this:

structured-log-viewer MyProject.binlog