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

Pin sqlite3 version to 1.* #389

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

sato11
Copy link
Contributor

@sato11 sato11 commented Jul 24, 2024

This commit addresses the CI failure.

It is Rails 7.2 that allows sqlite3 version 2.0. Previous versions of Rails are conventionally configured to require sqlite3 "~> 1.4" (meaning it excludes 2.*), which the development dependency can naturally follow.

cf.
https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14

This stops "bundle exec rake" from causing such failure like this, copied from GitHub Action's log:

>> BUNDLE_GEMFILE=/home/runner/work/public_activity/public_activity/gemfiles/rails_7.1.gemfile bundle exec rake
/opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundler/rubygems_integration.rb:237:in `block (2 levels) in replace_gem': can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.1-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:14:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /home/runner/work/public_activity/public_activity/test/test_helper.rb:26:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /home/runner/work/public_activity/public_activity/test/test_activist.rb:3:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in <main>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `<main>'
rake aborted!
Command failed with status (1)
/opt/hostedtoolcache/Ruby/3.3.1/x64/bin/bundle:25:in `load'
/opt/hostedtoolcache/Ruby/3.3.1/x64/bin/bundle:25:in `<main>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
Error: Process completed with exit code 1.

Source: https://github.com/public-activity/public_activity/actions/runs/9204987054/job/25319683065

This commit addresses the CI failure.

It is Rails 7.2 that allows sqlite3 version 2.0.
Previous versions of Rails are conventionally configured to
require sqlite3 "~> 1.4" (meaning it excludes 2.*), which
the development dependency can naturally follow.

cf.
https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14

This stops "bundle exec rake" from causing such failure like this,
copied from GitHub Action's log:

```
>> BUNDLE_GEMFILE=/home/runner/work/public_activity/public_activity/gemfiles/rails_7.1.gemfile bundle exec rake
/opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundler/rubygems_integration.rb:237:in `block (2 levels) in replace_gem': can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.1-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:14:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /home/runner/work/public_activity/public_activity/test/test_helper.rb:26:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /home/runner/work/public_activity/public_activity/test/test_activist.rb:3:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in <main>'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select'
	from /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `<main>'
rake aborted!
Command failed with status (1)
/opt/hostedtoolcache/Ruby/3.3.1/x64/bin/bundle:25:in `load'
/opt/hostedtoolcache/Ruby/3.3.1/x64/bin/bundle:25:in `<main>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
Error: Process completed with exit code 1.
```

Source: https://github.com/public-activity/public_activity/actions/runs/9204987054/job/25319683065
@pokonski
Copy link
Member

Thank you @sato11 !

@pokonski pokonski merged commit 9358515 into public-activity:main Jul 24, 2024
9 checks passed
@sato11 sato11 deleted the pin-sqlite3 branch July 24, 2024 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants