Skip to content

fix: compile before search_docs HTTP lookups in mix projects#72

Closed
serpent213 wants to merge 1 commit into
ash-project:mainfrom
serpent213:main
Closed

fix: compile before search_docs HTTP lookups in mix projects#72
serpent213 wants to merge 1 commit into
ash-project:mainfrom
serpent213:main

Conversation

@serpent213
Copy link
Copy Markdown
Contributor

Does not seem to hurt, and solved my issue in a complex Mix setup. See commit message for details.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@serpent213
Copy link
Copy Markdown
Contributor Author

Or might it break workflows in case the project does not compile...?

@zachdaniel
Copy link
Copy Markdown
Contributor

Yeah this wouldn't be ideal to compile. We could however do an ensure loaded on the ssl module specifically?

@serpent213
Copy link
Copy Markdown
Contributor Author

Will experiment some more... 👍🏻

When usage_rules.search_docs was invoked directly as a Mix task inside a project, the HTTPS request path could fail before the docs lookup ran with:

    ** (UndefinedFunctionError) function :ssl.versions/0 is undefined

The failure site is in Mint's SSL transport setup, but the behavior pointed more strongly at the direct Mix task boot path than at a general Req/Mint/OTP SSL problem. The same logic worked via mix run, and forcing a compile also avoided the crash, which suggested the task needed proper project loadpath setup before starting Req.

Use Mix loadpaths bootstrapping here instead of forcing mix compile. That keeps the HTTP client startup on the normal Mix project loadpath path while avoiding a regression where search_docs would fail early in projects that do not currently compile cleanly.

This keeps the fix scoped to task startup and avoids papering over the issue by explicitly starting :ssl or requiring a full project compile before an online docs search can run.
@serpent213
Copy link
Copy Markdown
Contributor Author

Definitely a heisenbug. Closing for now to avoid noise.

@serpent213 serpent213 closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants