dotnet / iot

This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.
MIT License
2.16k stars 580 forks source link

Improve library detection algorithm in LibGpiodDriverFactory #2271

Open pgrawehr opened 8 months ago

pgrawehr commented 8 months ago

The current detection algorithm in LibGpidDriver factory is somewhat risky, in that it assumes certain default paths for libraries. A more standard approach would be to just try to use PInvoke and catch the error. Note that this is also a bit tricky since the V1 driver internally also tries various .so files.

Other related work:

krwq commented 5 months ago

[Triage] We want to repeat logic from System.DirectoryServices.Protocols in dotnet/runtime: https://github.com/dotnet/runtime/blob/ff3c5314badbb0952bc86325baf12f2dd6255f6f/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs#L70-L99

krwq commented 5 months ago

we should also look at https://github.com/dotnet/iot/issues/2272 as part of this issue as that code might not be needed anymore