You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When inline: true is added to the rails_command the command is executed recursively and doesn't break. It invokes the generator again and goes into a loop.
To reproduce this issue, please either remove capture: true option from here:
bundle exec rails new latest-master --dev
cd latest-master
bundle exec rails action_text:install
To my curiosity, I noticed, webpack:install command also has inline: true yet it doesn't fail. I debugged it and found that webpack:install task comes from webpacker and adding inline: true option is never accepted nor affect in any way. We can remove it.
Rake stores the current top-level task and arguments in global state.
Invoking another top-level task within the same process requires
overwriting this state. Doing so indiscriminately can cause incorrect
behavior, such as infinitely repeating the original task. In
particular, this is a problem when running one task from another via
`rails_command "...", inline: true`.
The solution is to save and restore the global state in each call to
`RakeCommand.perform` using the `Rake.with_application` method.
Fixesrails#39128.
Steps to reproduce
I was working on my PR: #37824 where I noticed that ActionText install command goes into a recursive loop.
@jonathanhefner I can see an issue with the changes added in the commit: f6f5163 and PR: #37516
When
inline: true
is added to therails_command
the command is executed recursively and doesn't break. It invokes the generator again and goes into a loop.To reproduce this issue, please either remove
capture: true
option from here:rails/actiontext/lib/generators/action_text/install/install_generator.rb
Line 16 in cea27af
To my curiosity, I noticed,
webpack:install
command also hasinline: true
yet it doesn't fail. I debugged it and found thatwebpack:install
task comes fromwebpacker
and addinginline: true
option is never accepted nor affect in any way. We can remove it.Similarly, for
active_storage:update
here(https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/app_generator.rb#L319) is marked asremove_task
so it should not be executed for Rails 6 applications. This can be also reverted.Please do let me know if I can help in any way.
FYI, removing
inline: true
makes everything work as it was previously but fails the intend of addition of that option I guess.Expected behavior
The task should be completed and should not go in a recursive loop
Actual behavior
The task goes in a recursive loop
System configuration
Rails version: master
Ruby version: 2.6.3
The text was updated successfully, but these errors were encountered: