ephem
package fails to install correctly for non-x86 architectures
#395
Labels
ephem
package fails to install correctly for non-x86 architectures
#395
🐛 Summary
The
ephem
Python package does not install correctly for non-x86 architectures (e.g.,arm64
,arm/v6
,arm/v7
,ppc64le
,s390x
) when building the WeeWX Docker container. This issue occurs because the package relies on a compiled C extension (_libastro
), which is built forx86_64
by default during cross-compilation.This isn't a breaking bug, as WeeWX will detect catch the import error, and figure the package is not installed.
See:
To reproduce
Steps to reproduce the behavior:
docker buildx build --platform linux/arm64 -t weewx-arm64 .
ephem
module:python -c "import ephem"
Expected behavior
The
ephem
module should import successfully without errors, and the_libastro
shared object should be compiled for the target architecture.Any helpful log output or screenshots
Paste the results here:
Add any screenshots of the problem here.
Proposed Fix
The issue was resolved by modifying the Dockerfile to ensure that the
ephem
package is compiled from source during the build process. The following changes were made:Added build tools and dependencies to the
build-stage
:RUN apt-get update && apt-get install -y build-essential python3-dev libffi-dev gcc
Forced the
ephem
package to compile from source using pip:RUN pip install --no-cache --no-binary :all: ephem
These changes ensure that the
_libastro
shared object is built correctly for the target architectures, resolving the import issue.The text was updated successfully, but these errors were encountered: