`Database#load_extensions` is not enabled on Windows when using native gems or compiling vendored source code (sqlite 3.48.0+)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- github-actions, ruby, sqlite
- Lĩnh vực
- build-system, ci-cd, databases
Hướng nghiên cứu
Bắt đầu với log Windows GitHub Actions bị lỗi và extconf.rb của gem, sau đó so sánh cấu hình của nó với các script liên quan trong thư mục autosetup của SQLite. Điều tra cách Windows runner phân giải dlopen và các thư viện liên quan khi build mã nguồn SQLite được vendored. Hoàn tất khi load-extension build và các bài kiểm thử chạy thành công trên Windows mà không yêu cầu thư viện SQLite của hệ thống.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Loading extensions is not available on Windows when using the precompiled native gems or compiling the vendored sqlite library from source, starting with sqlite3-ruby v2.6.0.
We are asking for help from Windows users who want or need this feature.
Context
Sqlite 3.48.0 and later have dramatically changed the "autoconf amalgamation" that is vendored in
this gem. Specifically, the configuration is no longer actually autoconf, but some scripts that
emulate autoconf's interface and behavior.
Although this mostly "just worked", we're having a problem resolving the libraries necessary for
loading extensions. As a result, starting with sqlite3-ruby v2.6.0, extensions cannot be loaded on Windows when using precompiled native gems or when compiling the vendored sqlite library.
Workarounds
If you are a Windows user and need to load extensions, you have options.
- use a version of sqlite3-ruby
< 2.6.0 - compile from source, and link against a system sqlite library (not the vendored version). See https://github.com/sparklemotion/sqlite3-ruby/blob/main/INSTALLATION.md#avoiding-the-precompiled-native-gem for help doing this.
Request
If you are a windows user, and you want or need this feature, we need your help.
- If you can figure out how to make this build properly, please comment below, I'd like to work with you to update this gem's extconf.rb to link properly.
- If you know a lot about the Windows runner for Github Actions, or about how setup-ruby configures the runner, then please think and/or comment to let me know what I should be trying.
I have not started a thread in the upstream forum because I'm pretty sure this can be solved with the right set of configure options/compiler flags/linker flags, I just can't figure out what that combination is and I can't afford to spend more time on it right now.
Details
A good example of the failure in question is here: https://github.com/sparklemotion/sqlite3-ruby/actions/runs/13420426491/job/37491733507#step:5:368
Here's the full log: 44_test (windows, 3.4, disable).txt
Some of the relevant snippets from that log:
Configuring SQLite version 3.49.1
Warning: Failed to find x86_64-w64-mingw32-ld, falling back to ld which may be incorrect
Warning: Failed to find x86_64-w64-mingw32-ar, falling back to ar which may be incorrect
Looking for install ... c:/msys64/usr/bin/install
Checking for int8_t...ok
Checking for int16_t...ok
Checking for int32_t...ok
Checking for int64_t...ok
Checking for intptr_t...ok
Checking for uint8_t...ok
Checking for uint16_t...ok
Checking for uint32_t...ok
Checking for uint[64](https://github.com/sparklemotion/sqlite3-ruby/actions/runs/13420426491/job/37491733507#step:5:65)_t...ok
Checking for uintptr_t...ok
Checking for gmtime_r...not found
Checking for isnan...ok
Checking for localtime_r...not found
Checking for localtime_s...not found
Checking for malloc_usable_size...not found
Checking for strchrnul...not found
Checking for usleep...ok
Checking for utime...ok
Checking for pread...not found
Checking for pread64...not found
Checking for pwrite...not found
Checking for pwrite64...not found
Checking libs for fdatasync...no
Checking libs for nanosleep...none needed
Checking for sys/types.h...ok
Checking for sys/stat.h...ok
Checking for dlfcn.h...not found
Checking for unistd.h...ok
Checking for stdlib.h...(cached) ok
Checking for malloc.h...ok
Checking for memory.h...ok
Checking for string.h...ok
Checking for strings.h...ok
Checking for inttypes.h...ok
Checking for zlib.h...ok
Checking libs for deflate...-lz
Checking whether the C compiler accepts -rpath C:/hostedtoolcache/windows/Ruby/3.4.2/x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.test.2025.0219.1912/ports/x[86](https://github.com/sparklemotion/sqlite3-ruby/actions/runs/13420426491/job/37491733507#step:5:87)_64-w64-mingw32/sqlite3/3.49.1/lib...no
Checking whether the C compiler accepts -Wl,-rpath,C:/hostedtoolcache/windows/Ruby/3.4.2/x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.test.2025.0219.1[91](https://github.com/sparklemotion/sqlite3-ruby/actions/runs/13420426491/job/37491733507#step:5:92)2/ports/x86_64-w64-mingw32/sqlite3/3.49.1/lib...yes
SQLITE_DEBUG build? no
Support threadsafe operation? Checking for libs...
Checking libs for pthread_create...none needed
Checking libs for pthread_mutexattr_init...none needed
Checking for line-editing capability...
WARNING: Skipping check for readline.h because we're cross-compiling.
Line-editing support for the sqlite3 shell: none
Checking libs for dlopen...no
--enable-load-extension was provided but dlopen()
not found. Use --disable-load-extension to bypass this
check.
and
============
Failed: gcc -fPIC -O2 -fvisibility=hidden -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_URI=1 conftest__.c -o conftest__
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\RUNNER~1\AppData\Local\Temp\ccAsr52L.o:conftest__.c:(.text.startup+0xa): undefined reference to `dlopen'
collect2.exe: error: ld returned 1 exit status
child process exited abnormally
============
The failed code was:
extern void dlopen(void);
int main(void) {
dlopen();
return 0;
}
============
Failed: gcc -fPIC -O2 -fvisibility=hidden -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_URI=1 conftest__.c -o conftest__ -ldl
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldl: No such file or directory
collect2.exe: error: ld returned 1 exit status
child process exited abnormally
============
The failed code was:
extern void dlopen(void);
int main(void) {
dlopen();
return 0;
}
============
Relevant configure scripts are in https://github.com/sqlite/sqlite/tree/master/autosetup
cc @larskanis in case you have any ideas
- Ngôn ngữ chính
- Ruby
- Star
- 845
- Fork
- 220
- Merge trung bình
- 4 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sparklemotion/sqlite3-ruby
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
sparklemotion/sqlite3-ruby#751 ·
-
needs-more-info
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
sparklemotion/sqlite3-ruby#653 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
sparklemotion/sqlite3-ruby#639 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
sparklemotion/sqlite3-ruby#628 · 10 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
sparklemotion/sqlite3-ruby#573 · 2 bình luận ·
Tất cả issue của sparklemotion/sqlite3-ruby
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 7 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 7 ngày
-
NoMethodError in auth#createĐang mởbugsnag
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
JoeMcB/improvcoaches#827 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
TheOdinProject/curriculum#31465 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs eco: ruby good first issue help wanted lane: free-agent roadmap size: XS type: docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
arminazimi/evergreen#465 ·
Maintainer thường phản hồi trong vòng 1 ngày