-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix Rails 7 build #2523
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
Merged
Merged
Fix Rails 7 build #2523
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using rack from git opens up opportunities to fail due to unreleased rack issues, e.g. rack/rack#1768 No need to explicitly depend on rack, Rails does that https://github.com/rails/rails/blob/c2b083df913f44e664576aafe24c41ec657f8eb5/actionpack/actionpack.gemspec#L37
Arel was swallowed by Rails back in 2018
> This gem was merged on Rails 4.0 and will only receive security fixes
Depending on i18n's latest git version opens up opportunities to: 1. fail due to i18n's unstable changes 2. fail due to version conflict (their `master` can flip to 2.0, while `rails` would depend on `< 2`) Rails explicitly depend on `i18n` anyway: https://github.com/rails/rails/blob/c2b083df913f44e664576aafe24c41ec657f8eb5/activesupport/activesupport.gemspec#L36
Rails went with double quotes: ```ruby gem "rails", "~> 7.0.0.alpha2" ``` and this was causing Bundler to complain: ``` [!] There was an error parsing `Gemfile`: [!] There was an error parsing `Gemfile-rails-dependencies`: You cannot specify the same gem twice with different version requirements. You specified: rails (~> 7.0.0.alpha2) and rails (>= 0). Bundler cannot continue. # from /Users/pirj/source/rspec-dev/repos/rspec-rails/Gemfile-rails-dependencies:5 # ------------------------------------------- # when /master/ > gem "rails", :git => "https://github.com/rails/rails.git" # gem "activerecord-deprecated_finders", :git => "https://github.com/rails/activerecord-deprecated_finders.git" # ------------------------------------------- . Bundler cannot continue. # from /Users/pirj/source/rspec-dev/repos/rspec-rails/tmp/example_app/Gemfile:63 # ------------------------------------------- # eval_gemfile '/Users/pirj/source/rspec-dev/repos/rspec-rails/Gemfile-rspec-dependencies' > eval_gemfile '/Users/pirj/source/rspec-dev/repos/rspec-rails/Gemfile-rails-dependencies' # ------------------------------------------- ```
``` gem "debug", ">= 1.0.0", platforms: %i[ mri mingw x64_mingw ] ```
It conflicts with the one from `Gemfile-rails-dependencies` ``` [!] There was an error parsing `Gemfile`: [!] There was an error parsing `Gemfile-rails-dependencies`: You cannot specify the same gem twice with different version requirements. You specified: selenium-webdriver (>= 4.0.0.rc1) and selenium-webdriver (>= 0). Bundler cannot continue. # from /Users/pirj/source/rspec-dev/repos/rspec-rails/Gemfile-rails-dependencies:13 # ------------------------------------------- # gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby] > gem 'selenium-webdriver', require: false # when /stable$/ # ------------------------------------------- . Bundler cannot continue. # from /Users/pirj/source/rspec-dev/repos/rspec-rails/tmp/example_app/Gemfile:63 # ------------------------------------------- # eval_gemfile '/Users/pirj/source/rspec-dev/repos/rspec-rails/Gemfile-rspec-dependencies' > eval_gemfile '/Users/pirj/source/rspec-dev/repos/rspec-rails/Gemfile-rails-dependencies' # ------------------------------------------- ```
28a5aa4
to
81196dd
Compare
https://github.com/rails/sprockets/blob/070fc01947c111d35bb4c836e9bb71962a8e0595/UPGRADING.md#manifestjs Otherwise ``` ** Invoke generate:stuff (first_time) ** Execute generate:stuff bin/rake app:template LOCATION='../../example_app_generator/generate_stuff.rb' rake aborted! Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file in `app/assets/config/manifest.js` But did not, please create this file and use it to link any assets that need to be rendered by your app: Example: //= link_tree ../images //= link_directory ../javascripts .js //= link_directory ../stylesheets .css and restart your server ``` This, however, fails on Rails < 7: ``` # --- Caused by: --- # Sprockets::Rails::Helper::AssetNotPrecompiled: # application.css ``` Without `application.css`: ``` Failure/Error: <%= stylesheet_link_tag "application" %> ActionView::Template::Error: The asset "application.css" is not present in the asset pipeline. ``` Without content in `manifest.js`: ``` Failures: 1) Welcomes GET /index returns http success Failure/Error: <%= stylesheet_link_tag "application" %> ActionView::Template::Error: Asset `application.css` was not declared to be precompiled in production. Declare links to your assets in `app/assets/config/manifest.js`. //= link application.css ```
81196dd
to
acaa4f3
Compare
Removing mainline dependencies on |
JonRowe
approved these changes
Oct 1, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change:
i18n
,rack
)journey
,arel
)tmp/example_app/Gemfile
generation to avoid conflicts withGemfile-rails-dependencies
These changes only affect our build, and only against Rails'
main
.See #2521 (comment) and https://github.com/rspec/rspec-rails/pull/2521/checks?check_run_id=3757830550
rack
Using rack from git opens up opportunities to fail due to unreleased rack issues, e.g. rack/rack#1768
No need to explicitly depend on rack, Rails does that: https://github.com/rails/rails/blob/c2b083df913f44e664576aafe24c41ec657f8eb5/actionpack/actionpack.gemspec#L37
i18n
Depending on i18n's latest git version opens up opportunities to:
master
can flip to 2.0, whilerails
would depend on< 2
)Rails explicitly depend on
i18n
anyway: https://github.com/rails/rails/blob/c2b083df913f44e664576aafe24c41ec657f8eb5/activesupport/activesupport.gemspec#L36journey
https://github.com/rails/journey
arel
https://github.com/rails/arel
Arel was swallowed by Rails back in 2018