`Database#load_extensions` is not enabled on Windows when using native gems or compiling vendored source code (sqlite 3.48.0+)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- github-actions, ruby, sqlite
- Área
- build-system, ci-cd, databases
Línea de trabajo
Comienza con el registro fallido de Windows GitHub Actions y el extconf.rb de la gema; después, compara su configuración con los scripts relevantes del directorio autosetup de SQLite. Investiga cómo el runner de Windows resuelve dlopen y las bibliotecas relacionadas al compilar el código fuente de SQLite incluido. Se considera terminado cuando load-extension se compila y las pruebas se ejecutan correctamente en Windows sin requerir una biblioteca SQLite del sistema.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Ruby
- Estrellas
- 845
- Forks
- 220
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sparklemotion/sqlite3-ruby
-
needs-more-info
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
sparklemotion/sqlite3-ruby#653 · 3 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
sparklemotion/sqlite3-ruby#639 · 4 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
sparklemotion/sqlite3-ruby#628 · 10 comentarios · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
sparklemotion/sqlite3-ruby#573 · 2 comentarios ·
-
Incomplete PRAGMA supportAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
sparklemotion/sqlite3-ruby#559 · 10 comentarios ·
Todos los issues de sparklemotion/sqlite3-ruby
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
FreeCAD/homebrew-freecad#870 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
OSCON 2016Abiertocontent
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
rubyevents/rubyevents#2148 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
we-promise/sure#3838 · 2 comentarios ·
Los mantenedores suelen responder en 1 día