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

Allow passing sqlite CFLAGS via a extconf.rb argument that is configurable by bundler #401

Closed
flavorjones opened this issue Sep 8, 2023 · 3 comments · Fixed by #402
Closed
Labels

Comments

@flavorjones
Copy link
Member

flavorjones commented Sep 8, 2023

See #400 for the discussion that ended with this feature request.

The user in this case is someone who is a sqlite professional™ and wants to set some compile-time flags for default pragma values. See https://fractaledmind.github.io/2023/09/07/enhancing-rails-sqlite-fine-tuning/ for an example use case.

Currently the only way to do this is to set a CFLAGS environment variable at gem installation time (and, separately, to ensure that you download and compile the source gem, not a precompiled gem).

It would be helpful if options were all contained within the bundler/gemfile toolchain, so that these two changes would be sufficient:

# Gemfile
gem "sqlite3", force_ruby_platform: true # needs bundler 2.3.18 or higher

And a bundler config:

bundle config build.sqlite3 --sqlite-cflags="-DSQLITE_DEFAULT_PAGE_SIZE=16300"

(or the equivalent entry in .bundler/config:

BUNDLE_BUILD__SQLITE3: "--sqlite-cflags=-DSQLITE_DEFAULT_PAGE_SIZE=16300"
@fractaledmind
Copy link
Contributor

One small note for the issue, you copy/pasted Bundler config values for Nokogiri.

That typo aside, I think this could be an amazing feature, and whatever I can do to help or test, I'm down

@flavorjones
Copy link
Member Author

LOL! Fixed the nokogiri paste error.

@flavorjones
Copy link
Member Author

PR up at #402

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

Successfully merging a pull request may close this issue.

3 participants
@flavorjones @fractaledmind and others