cathaypacific8747 / am4

Discord bot and various utilities for the game Airline Manager 4
https://cathaypacific8747.github.io/am4/
MIT License
10 stars 3 forks source link

Docker build fails for Linux aarch64 #9

Closed askl56 closed 5 months ago

askl56 commented 7 months ago

When I try to git clone the repo, I get the following error:

error: unable to create symlink docs/assets/img/hangar-10.svg: File name too long

From terminal or github desktop. I'm on OSX latest if that helps.

Even if I download the zip, when I run docker build -t am4 ., I get the following output:

195.2 Successfully built am4
195.5 Installing collected packages: typing-extensions, sniffio, six, shellingham, ruff, pyparsing, pygments, pybind11-stubgen, pybind11, pluggy, Pillow, packaging, orjson, numpy, multidict, mdurl, loguru, kiwisolver, iniconfig, idna, h11, frozenlist, fonttools, cycler, click, certifi, attrs, annotated-types, yarl, uvicorn, python-dateutil, pytest, pyproj, pydantic-core, pyarrow, markdown-it-py, httpcore, contourpy, anyio, aiosignal, starlette, rich, pytest-asyncio, pydantic, matplotlib, httpx, aiohttp, typer, fastapi, discord.py, cmocean, am4
200.3 Successfully installed Pillow-10.3.0 aiohttp-3.9.3 aiosignal-1.3.1 am4-0.1.8a1 annotated-types-0.6.0 anyio-4.3.0 attrs-23.2.0 certifi-2024.2.2 click-8.1.7 cmocean-4.0.3 contourpy-1.2.1 cycler-0.12.1 discord.py-2.3.2 fastapi-0.110.1 fonttools-4.51.0 frozenlist-1.4.1 h11-0.14.0 httpcore-1.0.5 httpx-0.27.0 idna-3.6 iniconfig-2.0.0 kiwisolver-1.4.5 loguru-0.7.2 markdown-it-py-3.0.0 matplotlib-3.8.4 mdurl-0.1.2 multidict-6.0.5 numpy-1.26.4 orjson-3.10.0 packaging-24.0 pluggy-1.4.0 pyarrow-15.0.2 pybind11-2.12.0 pybind11-stubgen-2.5.1 pydantic-2.6.4 pydantic-core-2.16.3 pygments-2.17.2 pyparsing-3.1.2 pyproj-3.6.1 pytest-8.1.1 pytest-asyncio-0.23.6 python-dateutil-2.9.0.post0 rich-13.7.1 ruff-0.3.5 shellingham-1.5.4 six-1.16.0 sniffio-1.3.1 starlette-0.37.2 typer-0.12.2 typing-extensions-4.11.0 uvicorn-0.29.0 yarl-1.9.4
200.3 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
200.8 Traceback (most recent call last):
200.8   File "<string>", line 1, in <module>
200.8 ImportError: /usr/local/lib/python3.11/site-packages/am4/utils.cpython-311-aarch64-linux-gnu.so: undefined symbol: _ZN6duckdb15BaseQueryResult8GetErrorEv
------
Dockerfile:10
--------------------
   9 |
  10 | >>> RUN python3 -m pip install ".[dev,api,bot]" && \
  11 | >>>     python3 -c "from am4.utils.db import init; init()" && \
  12 | >>>     python3 -c "from src.am4.db import ensure_pb_exists; ensure_pb_exists()"
  13 |
--------------------
ERROR: failed to solve: process "/bin/sh -c python3 -m pip install \".[dev,api,bot]\" &&     python3 -c \"from am4.utils.db import init; init()\" &&     python3 -c \"from src.am4.db import ensure_pb_exists; ensure_pb_exists()\"" did not complete successfully: exit code: 1
cathaypacific8747 commented 7 months ago

First issue was caused by a symlink pointing to a non-existent file: removed it (fixed).

Reopening this issue because the second issue is not yet resolved. The issue appears to be specific to Linux aarch64 docker builds (cannot reproduce on Linux amd64 and macos arm64).

The project uses duckdb to read parquet files and is dynamically linked to a precompiled binary: https://github.com/cathaypacific8747/am4/blob/b706a562904e90d0d4320201ffff8c21e12f55ed/src/am4/utils/cpp/include/ext/libduckdb/CMakeLists.txt

For some reason, the duckdb::BaseQueryResult::GetError() symbol (public) exists in some versions of the binaries but not in some.

cathaypacific8747 commented 5 months ago

Future versions will migrate away from bundling the entire duckdb binary and use libparquet-dev instead.