wails/v3/internal
Lea Anthony f1a4ffe72d
feat(linux): add libpath package for finding native library paths (#4847)
* feat(linux): add libpath package for finding native library paths

Add a new internal/libpath package that locates shared libraries (.so files)
on Linux systems. Supports multiple distributions and package managers.

Features:
- Multi-tier search: pkg-config -> ldconfig -> filesystem scanning
- Parallel search using goroutines for faster lookups
- Cached dynamic path discovery for Flatpak, Snap, and Nix
- Support for Debian/Ubuntu, Fedora/RHEL, Arch, openSUSE, NixOS
- Context-aware cancellation for graceful shutdown

Performance:
- Library found: ~1.4ms (parallel search)
- Library not found: ~46ms (was 84ms sequential)
- Cached path discovery: 14ns (was 15ms uncached)

* feat(libpath): add multi-library parallel search functions

Add functions to search for multiple library candidates in parallel:

- FindFirstLibrary: Search multiple libs in parallel, return first found
- FindFirstLibraryOrdered: Search in order of preference (for version priority)
- FindAllLibraries: Find all available libraries from a list

Useful when the exact library version is unknown, e.g.:
  match, _ := FindFirstLibrary("webkit2gtk-4.1", "webkit2gtk-4.0", "webkit2gtk-6.0")

Also adds findLibraryPathCtx for context-aware searching used by the
multi-library functions.

* refactor(libpath): split into separate files and fix race condition

Split libpath_linux.go into smaller, focused files:
- cache_linux.go: Path cache with thread-safe init/invalidate
- flatpak_linux.go: Flatpak runtime path discovery
- snap_linux.go: Snap package path discovery
- nix_linux.go: Nix/NixOS path discovery
- libpath_linux.go: Core search functions

Fixes:
- Fix data race between init() and invalidate() by holding mutex
  during cache writes inside sync.Once.Do (CodeRabbit review)
- Fix FindLibraryPathWithOptions not searching dynamic paths
  (Flatpak/Snap/Nix) - now uses GetAllLibPaths() (CodeRabbit review)
2026-01-04 11:59:22 +11:00
..
assetserver fix(v3): overhaul drag-and-drop for Linux reliability and simplify Windows implementation (#4848) 2026-01-04 11:08:29 +11:00
buildinfo [v3] Late service registration and error handling overhaul (#4066) 2025-02-19 09:27:41 +01:00
capabilities perf(v3): optimize JSON processing and reduce allocations in hot paths (#4843) 2026-01-02 07:03:36 +11:00
changelog Nightly release action 2025-07-17 06:28:19 +10:00
commands Improve Build Commands to Accommodate Spaces (#4845) 2026-01-02 00:21:22 +00:00
dbus [V3-Linux] Systray OnClick on initial icon click (#3907) 2024-11-24 07:46:14 +11:00
debug Run go mod tidy on project creation. Use better method of relative module location. 2023-08-12 14:32:52 +10:00
defaults feat(setup): add global defaults, light/dark mode, and UI improvements 2025-12-07 17:40:53 +11:00
doctor Add desktop environment detection on linux (#4797) 2025-12-15 18:18:48 +11:00
fileexplorer perf(v3): optimize JSON processing and reduce allocations in hot paths (#4843) 2026-01-02 07:03:36 +11:00
flags feat(v3): add cross-platform build system and signing support 2025-12-06 13:53:37 +11:00
generator fix(v3): overhaul drag-and-drop for Linux reliability and simplify Windows implementation (#4848) 2026-01-04 11:08:29 +11:00
github Fix tests 2025-01-20 19:56:03 +11:00
go-common-file-dialog [V3] Windows: fix(application): handle error and type assertion in save file dialog (#4284) 2025-08-04 19:57:53 +10:00
hash [v3] Late service registration and error handling overhaul (#4066) 2025-02-19 09:27:41 +01:00
keychain feat(v3): add cross-platform build system and signing support 2025-12-06 13:53:37 +11:00
libpath feat(linux): add libpath package for finding native library paths (#4847) 2026-01-04 11:59:22 +11:00
operatingsystem feat: Add Android support for Wails v3 2025-11-28 21:06:59 +11:00
packager [V3-Linux] Support for deb,rpm,arch linux packager packaging (#3909) 2024-11-30 13:31:56 +11:00
runtime [skip ci] Publish @wailsio/runtime v3.0.0-alpha.78 2026-01-04 00:09:35 +00:00
s Support template generation 2025-01-01 20:58:49 +11:00
service Breaking Change: Service method names 2025-01-16 07:47:23 +11:00
setupwizard feat(setup): add global defaults, light/dark mode, and UI improvements 2025-12-07 17:40:53 +11:00
signal # Conflicts: 2024-09-18 05:55:49 +10:00
sliceutil perf(v3): optimize JSON processing and reduce allocations in hot paths (#4843) 2026-01-02 07:03:36 +11:00
templates Merge Android support from v3-alpha-feature/android-support 2025-12-10 18:37:24 +11:00
term [v3] Pass build flags to binding generator (#4023) 2025-01-23 10:58:35 +00:00
version chore(v3): bump to v3.0.0-alpha.55 and update changelog [skip ci] 2026-01-02 02:46:35 +00:00