[BUG]: Defer home path resolution - #7661
Open
wiliyam wants to merge 1 commit into
Open
Conversation
Avoid resolving the process home directory while importing Chroma. This keeps imports usable for dynamic users and containers without a passwd entry while preserving path overrides.
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
This fixes #1962. A plain
import chromadbcurrently raises when the process has no resolvable home directory, as can happen with systemd dynamic users and distroless containers, even when neither the ONNX embedding function nor telemetry storage is used.Test plan
RuntimeError: no homeand passes with this patch.pytest -q chromadb/test/test_import.py(1 passed)black==23.3.0 --checkon the three changed filespython -m compileallon the three changed filesThe initial editable build could not run in this environment because its Rust build requires a system
cclinker. The focused test was run against the source tree with the Python dependencies installed separately.Migration plan
No migration or compatibility action is required. Explicit
DOWNLOAD_PATHandUSER_ID_PATHoverrides continue to take precedence.Observability plan
No new runtime instrumentation is needed; this only moves path resolution from import time to first use.
Documentation Changes
None. No user-facing API changes.
This contribution was AI-assisted and manually reviewed. The reproduction and reported test results were run locally.