Add missing install/__init__.py so build_hostapd import resolves - #47
Open
fvsion wants to merge 1 commit into
Open
Add missing install/__init__.py so build_hostapd import resolves#47fvsion wants to merge 1 commit into
fvsion wants to merge 1 commit into
Conversation
install.py does `from install import build_hostapd`, but install/ has no
__init__.py, so it is only a namespace package. In Python's import
resolution a regular module outranks a namespace package, so `install`
resolves to install.py itself -- which has no build_hostapd attribute:
File "install.py", line 5, in <module>
from install import build_hostapd
File "install.py", line 5, in <module>
from install import build_hostapd
ImportError: cannot import name 'build_hostapd' from 'install'
install.py therefore aborts at import time, before doing any work, on
every platform. Adding the empty __init__.py makes install/ a regular
package, which then takes precedence and resolves correctly. This also
matches the existing convention: ., core/ and core/libs/ all ship one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
install.pyaborts at import time on every platform at master HEAD, before doing any work:Note the traceback hits line 5 twice —
install.pyis importing itself.Cause
install.py:5doesfrom install import build_hostapd, butinstall/ships no__init__.py, so it is only a namespace package. In Python's import resolution a regular module outranks a namespace package, soinstallresolves toinstall.py, which has nobuild_hostapdattribute.Introduced in ceaeae0, which added the import together with
install/build_hostapd.py.Why CI didn't catch it
.github/workflows/install.ymltriggers onpull_requesttomaster(plusworkflow_dispatch). ceaeae0 landed directly onmaster, so the install job never ran against it.Fix
Add an empty
install/__init__.py, makinginstall/a regular package — which then outranksinstall.pyand resolves correctly. This matches the existing convention:.,core/andcore/libs/all ship one.Verification
Built on Kali rolling (arm64) and ran the same three steps as
install.yml:python3 install.py— apt deps, pip deps, hostapd-wpe v2.11 compiled from source tocore/vendor/bin/hostapd-wpe, runtime dirs createdpython3 rogue.py --help— v3.5.1 launchespython3 rogue.py --cert-wizard— full CA chain generated,server.pem: OKKARMA patch confirmed applied in the built binary (
rogue_karmasymbol present,-kadded to the getopt string).🤖 Generated with Claude Code