Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32 bit arch used for arm64 #159

Open
lukehinds opened this issue Dec 27, 2024 · 3 comments · May be fixed by #160
Open

32 bit arch used for arm64 #159

lukehinds opened this issue Dec 27, 2024 · 3 comments · May be fixed by #160

Comments

@lukehinds
Copy link

I have not been able to nail down why this is yet, but I am finding any time sqlite-vec is pip installed on a arm64 machine, it fails from using the 32 bit library

I built this as a replication of the issue:

https://github.com/lukehinds/sqlite-vec-test/actions/runs/12515467806/job/34913076780#step:6:506

You can see here, this is during the arm64 build stage:

#28 [linux/arm64 stage-1 6/8] RUN file /usr/local/lib/python3.12/site-packages/sqlite_vec/vec0.so
#28 0.108 /usr/local/lib/python3.12/site-packages/sqlite_vec/vec0.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=126100873b8858013bd396b329eccfa35f27acf5, not stripped
#28 DONE 0.1s

#29 [linux/arm64 stage-1 7/8] RUN python -c "import sqlite3; print(sqlite3.sqlite_version)"
#29 0.676 3.40.1
#29 DONE 0.7s

#30 [linux/arm64 stage-1 8/8] RUN python -c "import sqlite3; conn = sqlite3.connect(':memory:'); conn.enable_load_extension(True); conn.load_extension('/usr/local/lib/python3.12/site-packages/sqlite_vec/vec0'); print('sqlite_vec loaded successfully')"
#30 0.361 Traceback (most recent call last):
#30 0.362   File "<string>", line 1, in <module>
#30 0.363 sqlite3.OperationalError: /usr/local/lib/python3.12/site-packages/sqlite_vec/vec0.so: wrong ELF class: ELFCLASS32
#30 ERROR: process "/bin/sh -c python -c \"import sqlite3; conn = sqlite3.connect(':memory:'); conn.enable_load_extension(True); conn.load_extension('/usr/local/lib/python3.12/site-packages/sqlite_vec/vec0'); print('sqlite_vec loaded successfully')\"" did not complete successfully: exit code: 1
------
 > [linux/arm64 stage-1 8/8] RUN python -c "import sqlite3; conn = sqlite3.connect(':memory:'); conn.enable_load_extension(True); conn.load_extension('/usr/local/lib/python3.12/site-packages/sqlite_vec/vec0'); print('sqlite_vec loaded successfully')":
0.361 Traceback (most recent call last):
0.362   File "<string>", line 1, in <module>
0.363 sqlite3.OperationalError: /usr/local/lib/python3.12/site-packages/sqlite_vec/vec0.so: wrong ELF class: ELFCLASS32

I will update when I figure out why this is happening.

@lukehinds
Copy link
Author

lukehinds commented Dec 27, 2024

Right, CI is packing a 32bit lib into the aarch64 wheel

curl -O https://files.pythonhosted.org/packages/f2/48/dbb2cc4e5bad88c89c7bb296e2d0a8df58aab9edc75853728c361eefc24f/sqlite_vec-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  101k  100  101k    0     0  1099k      0 --:--:-- --:--:-- --:--:-- 1150k
tar zxvf sqlite_vec-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
x sqlite_vec/__init__.py
x sqlite_vec/vec0.so
x sqlite_vec-0.1.6.dist-info/METADATA
x sqlite_vec-0.1.6.dist-info/WHEEL
x sqlite_vec-0.1.6.dist-info/top_level.txt
x sqlite_vec-0.1.6.dist-info/RECORD
cd sqlite_vec
file vec0.so
vec0.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=126100873b8858013bd396b329eccfa35f27acf5, not stripped
cd sqlite_vec-0.1.6.dist-info/

cat WHEEL
Wheel-Version: 1.0
Generator: sqlite-dist 0.0.1-alpha.17
Root-Is-Purelib: false
Tag: py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64%

lukehinds added a commit to lukehinds/sqlite-vec that referenced this issue Dec 27, 2024
- Switched to the correct compiler (gcc-aarch64-linux-gnu) for linux-aarch64 builds to ensure 64-bit binaries are generated.
- Removed duplicate artifact upload for sqlite-vec-android-armv7a-extension in the dist job.

Resolves: asg017#159
@lukehinds
Copy link
Author

This is a breaking bug @asg017 if you could please review #160

lukehinds added a commit to stacklok/codegate that referenced this issue Dec 28, 2024
Upstream sqlite-vec is currently compiling the wrong arch

Use this until fixed upstream

asg017/sqlite-vec#159
@tommitytom
Copy link

tommitytom commented Jan 5, 2025

I'm having a similar issue with nodejs on windows with yarn, it seems to try to download the linux arm64 build:

> yarn add sqlite-vec
➤ YN0000: · Yarn 4.5.1
➤ YN0000: ┌ Resolution step
➤ YN0035: │ sqlite-vec-linux-arm64@npm:0.1.6: Package not found
➤ YN0035: │   Response Code: 404 (Not Found)
➤ YN0035: │   Request Method: GET
➤ YN0035: │   Request URL: https://registry.yarnpkg.com/sqlite-vec-linux-arm64
➤ YN0000: └ Completed in 0s 777ms
➤ YN0000: · Failed with errors in 0s 788ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants