Summary
The fb-idb 1.1.7 package on PyPI ships idb/common/companion_spawner.py which imports IDB_LOCAL_TARGETS_FILE from idb/common/constants.py. However, constants.py in the same package does not define this constant, causing an ImportError at module load time. This completely breaks idb's ability to auto-start idb_companion daemons for simulators.
Steps to Reproduce
pip install fb-idb==1.1.7
python3 -c "from idb.common.companion_spawner import CompanionSpawner"
Result:
ImportError: cannot import name 'IDB_LOCAL_TARGETS_FILE' from 'idb.common.constants'
Expected: Module loads successfully.
In practice, this means any idb command that needs to auto-start a companion (e.g., idb ui describe-all --udid <UDID>) fails with:
Failed to connect to companion at address DomainSocketAddress(path='/tmp/idb/<UDID>_companion.sock'): [Errno 2] No such file or directory
Root Cause
The repo and PyPI package are out of sync:
- Aug 2021 —
companion_spawner.py was removed from the repo (277a197a "Flatten CompanionSpawner into Companion")
- Sept 2021 —
IDB_LOCAL_TARGETS_FILE was removed from constants.py (a4159c8e "Remove dependence on local state file")
- March 2022 —
fb-idb 1.1.7 was published to PyPI — this is the latest release
The repo changes are internally consistent (both the file and the constant were removed together), but the PyPI package appears to have been built from a state where constants.py was updated but companion_spawner.py was not yet removed.
Workaround
We patch constants.py after installing fb-idb to add the missing constant:
IDB_CONSTANTS=".venv/lib/python3.12/site-packages/idb/common/constants.py"
if [ -f "$IDB_CONSTANTS" ] && ! grep -q 'IDB_LOCAL_TARGETS_FILE' "$IDB_CONSTANTS"; then
echo 'IDB_LOCAL_TARGETS_FILE: str = f"{BASE_IDB_FILE_PATH}/local_targets"' >> "$IDB_CONSTANTS"
fi
Suggested Fix
Publish a new PyPI release from the current repo state. The repo code is consistent — companion_spawner.py no longer exists and constants.py no longer references IDB_LOCAL_TARGETS_FILE. A fresh build from main would resolve this for all users.
The release process is straightforward — setup.py just needs FB_IDB_VERSION set:
FB_IDB_VERSION=1.1.8 python setup.py sdist bdist_wheel
twine upload dist/*
This was also raised in #858 ("Are there any plans to release a new version?").
Environment
- macOS 26.2 (Apple Silicon)
- Python 3.12
- fb-idb 1.1.7 (latest on PyPI)
- idb-companion 1.1.8 (Homebrew)
Summary
The
fb-idb1.1.7 package on PyPI shipsidb/common/companion_spawner.pywhich importsIDB_LOCAL_TARGETS_FILEfromidb/common/constants.py. However,constants.pyin the same package does not define this constant, causing anImportErrorat module load time. This completely breaks idb's ability to auto-startidb_companiondaemons for simulators.Steps to Reproduce
pip install fb-idb==1.1.7 python3 -c "from idb.common.companion_spawner import CompanionSpawner"Result:
Expected: Module loads successfully.
In practice, this means any
idbcommand that needs to auto-start a companion (e.g.,idb ui describe-all --udid <UDID>) fails with:Root Cause
The repo and PyPI package are out of sync:
companion_spawner.pywas removed from the repo (277a197a "Flatten CompanionSpawner into Companion")IDB_LOCAL_TARGETS_FILEwas removed fromconstants.py(a4159c8e "Remove dependence on local state file")fb-idb1.1.7 was published to PyPI — this is the latest releaseThe repo changes are internally consistent (both the file and the constant were removed together), but the PyPI package appears to have been built from a state where
constants.pywas updated butcompanion_spawner.pywas not yet removed.Workaround
We patch
constants.pyafter installingfb-idbto add the missing constant:Suggested Fix
Publish a new PyPI release from the current repo state. The repo code is consistent —
companion_spawner.pyno longer exists andconstants.pyno longer referencesIDB_LOCAL_TARGETS_FILE. A fresh build frommainwould resolve this for all users.The release process is straightforward —
setup.pyjust needsFB_IDB_VERSIONset:FB_IDB_VERSION=1.1.8 python setup.py sdist bdist_wheel twine upload dist/*This was also raised in #858 ("Are there any plans to release a new version?").
Environment