1.6 KiB
1.6 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | references | priority | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ML-154 | Add early platform detection in runtime.exs for SQLite extensions | Done | 2026-04-30 10:48 | 2026-04-30 12:37 |
|
|
low |
Description
MusicLibrary.Repo.extension_path/1 raises "Unsupported OS or platform" when run on an unrecognised OS/architecture combination. This is called at startup via config/runtime.exs to resolve paths for unicode and vec0 SQLite extensions.
Instead of silently degrading (which would cause confusing downstream failures), add early detection:
- Add
MusicLibrary.Repo.supported_platform?/0that returns a boolean - In
config/runtime.exs, check this BEFORE theload_extensionsconfig block - If unsupported, raise with a helpful message listing supported platforms and the detected OS/arch
The existing raise in extension_path/1 stays as a defensive fallback (should not be reached if runtime.exs catches it first).
Acceptance Criteria
- #1 #1
Repo.supported_platform?/0returns true/false based on OS/arch - #2 #2
config/runtime.exscheckssupported_platform?/0before loading extensions and raises with a helpful message on unsupported platforms - #3 #3 Existing supported platforms (darwin-amd64, darwin-arm64, linux-amd64, linux-arm64) continue to load extensions correctly
- #4 #4
extension_path/1raise stays as a defensive fallback