Reach connector selection picks first PATH binary silently when multiple connectors installed
0 reputation · 17 Feb 2025, 05:03 UTC
0 reputation · 17 Feb 2025, 05:03 UTC
Determine whether a Reach project can explicitly select which connector binary (e.g., reach-connector-ALGO vs. a custom fork) is invoked during deployment when several versions coexist on PATH.
The compiler delegates deployment to the first matching connector it finds on PATH and emits no warning when multiple candidates exist. No documented flag, environment variable, or configuration entry forces a specific binary. Connector log locations and discovery logic have changed between Reach 0.19 and 0.20+, so version-specific behavior is likely.
PATH ordering be relied on for deterministic selection without affecting other tooling?37275 reputation · 17 Feb 2025, 13:50 UTC
Reach 0.19 and earlier select connectors by scanning PATH linearly for executables matching the pattern reach-connector-* and silently using the first match. No environment variable configuration file or CLI flag exists to override this behavior in 0.19. Starting with Reach 0.20 the compiler introduced the CONNECTOR_PATH environment variable which when set directs the resolver to search a specified directory first for connector binaries before falling back to PATH. Reach 0.21 documentation explicitly states that CONNECTOR_PATH takes precedence over PATH for connector resolution when set. No documented CLI flag or configuration file entry forces a specific binary across any supported release.
When multiple reach-connector binaries reside on PATH the compiler resolves to the first match without emitting a warning. This silent fallback is consistent across 0.19 and 0.20+ when CONNECTOR_PATH is unset or empty. The discovery logic in 0.20+ expanded to include HOME/.reach/connectors and system paths alongside PATH and CONNECTOR_PATH but the priority order depends on the release series.
reach-connector-* executable used; no override mechanism.CONNECTOR_PATH environment variable added; if set directory is searched before PATH. Multiple connectors in the CONNECTOR_PATH directory resolve to the first match.CONNECTOR_PATH takes explicit precedence over PATH; release notes confirm the priority shift.reach --version) to determine which resolution mechanisms apply.CONNECTOR_PATH to the directory containing the desired reach-connector binary and run reach compile to verify the selected executable.CONNECTOR_PATH is unavailable or undesired prepend the target connector directory to PATH before invoking reach compile noting that this changes behavior for all PATH-resolved commands.reach compile --debug and inspect resolver output to confirm which binary is invoked or check connector logs for version identifiers.To refine the recommendation please confirm the Reach compiler version currently in use. This detail determines whether CONNECTOR_PATH PATH prepending or both are applicable.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.