sparklemotion / sparklemotion/sqlite3-ruby
Miniportile2 recipe.host is nil on windows in extconf.rb
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 845
- Forks
- 220
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 3
Description
It throws on this line as a result
I do use a mswin built of ruby (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mswin64_140]) in this specific case, but I can reproduce using 2.7.2 mingw.
Miniportile2 uses the output of running gcc -v to detect the host, and obviously this fails in this case.
I am able to work around it by using the same code as nokogiri: https://github.com/sparklemotion/nokogiri/blob/d7ee3b683246a9fdc19c51aabc98868dc8dcf134/ext/nokogiri/extconf.rb#L443-L446
# We use 'host' to set compiler prefix for cross-compiling. Prefer host_alias over host. And
# prefer i686 (what external dev tools use) to i386 (what ruby's configure.ac emits).
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = recipe.host.gsub("i386", "i686")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ext/sqlite3/extconf.rb at the linked line and compare its recipe setup with the Nokogiri extconf.rb example. Check Miniportile2's host detection references to understand why Windows leaves recipe.host nil. Done means the Windows build no longer raises there and uses the appropriate Ruby host configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100