`Database#load_extensions` is not enabled on Windows when using native gems or compiling vendored source code (sqlite 3.48.0+)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- github-actions, ruby, sqlite
- 領域
- build-system, ci-cd, databases
調査の方向性
失敗している Windows GitHub Actions のログと gem の extconf.rb から始め、次にその設定を SQLite の autosetup ディレクトリにある関連スクリプトと比較します。vendored SQLite ソースをビルドする際に、Windows runner が dlopen と関連ライブラリをどのように解決するかを調査します。load-extension が Windows 上でシステム SQLite ライブラリを必要とせずにビルドされ、テストに成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Ruby
- スター
- 845
- フォーク
- 220
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sparklemotion/sqlite3-ruby のほかの issue
-
needs-more-info
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
sparklemotion/sqlite3-ruby#653 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
sparklemotion/sqlite3-ruby#639 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
sparklemotion/sqlite3-ruby#628 · コメント 10 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
sparklemotion/sqlite3-ruby#573 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
sparklemotion/sqlite3-ruby#559 · コメント 10 件 ·
メンテナーはふだん 2 日以内に返信
sparklemotion/sqlite3-ruby の issue をすべて見る
似ている issue
-
ETQ admin, le select de condition d'une annotation répétable liste les champs publics deux foisオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
demarche-numerique/demarche.numerique.gouv.fr#14301 ·
メンテナーはふだん 1 日以内に返信
-
needs verification
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 6 日以内に返信
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
dependabot/dependabot-core#16547 ·
メンテナーはふだん 1 日以内に返信
-
Properties named open and close collide with query delimiter tokens対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 8 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信