endjin / dotnet-adr

A cross platform .NET Global Tool for creating and managing Architectural Decision Records (ADRs).
https://endjin.com
Apache License 2.0
86 stars 11 forks source link

Linux compatibility? #203

Closed chrissimon-au closed 9 months ago

chrissimon-au commented 9 months ago

Hey there,

Thanks for this great tool - I've been using it for a while with the pre-release version inside a linux-based vscode devcontainer, but recently upgraded to 1.1.6 and now I get the following error for almost all adr commands:

Error: The parameter pathString is not an absolute directory path because it doesn't have a drive letter syntax (like "C:\") nor a URN path syntax (like "\\server\share\"). (Parameter 'pathString')

I've taken a look through the source and it seems this error is coming from the forked NDepend.Path dependency, but it's not 100% clear what code path is getting to the error, or which path needs fixing.

My suspicion was that it's the use of System.Environment.SpecialFolder.ApplicationData as an input to the NDepend.Path's ToAbsoluteDirectoryPath - so I've tried setting XDG_CONFIG_HOME explicitly as this is the env var used on linux to define that special folder. (It defaults to $HOME/.config) But it doesn't affect the outcome either way.

Looking at the source of NDepend.Path, it's not clear to me if it actually supports linux-style paths? All the test cases are for windows or UNC style paths, and indeed there is a test case that seems to explicitly suggest it doesn't support them, because it asserts that / is not a valid absolute path, but on linux of course it is the valid absolute root path.

Any thoughts? Would love to be able to use the updated version, otherwise I'll have to abandon this project because of a chain of dependency conflicts in my devcontainer (the prerelease version depends on dotnet 3.1, which depends on libssl1.1 which is not available in the debian/ubuntu versions that are avilable for .net 7.0).

Thanks!