-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
(Fix) Asset pipeline unexpectedly removes digest assets - 3.1.1.rc2 #3199
Conversation
/cc @spastorino |
@mjtko what about --trace? |
While I agree that it would be great to support Putting that to one side, I have found a related issue - with the I think perhaps a less trivial fix is required for this issue. My feeling is that we should:
Will take a look to see what I can do and update my fork shortly. While we need to patch up this task for 3.1.1, this is certainly smelling more and more like it should be some kind of rewrite very soon! |
Hrm, maybe --trace was/is not going to work because the output of the |
Caught between a rock and a hard place - we have to exit or enhancements are run multiple times; we can't exit because then later tasks are either (before this patch) run in the wrong environment or (after this patch) not run at all. I guess we're left with either:
or:
Do you have a preference or another suggestion? |
I would emit a warning. If we try to be smart and detect tasks we are going to get bitten by it eventually. |
@josevalim --trace works if I manually add it to the argument list - it's just not present in ARGV fsr. On further investigation it seems that rake uses I was briefly concerned about --dry-run, but luckily that's ok. :) I've found a way of determining the I'll open up an additional pull request containing the alternative approach so we can consider it during post 3.1.1 refactoring. |
I also have a proposal that may solve many of the issues we are describing now. Let me prepare a patch as well. |
…d on the rake command line; support --trace for re-invocations
Here is a gist that should solve #3198 and still handle the exit problem properly: |
Well, there's my attempt. I'm sure yours will be significantly better. :-) |
Ah, nice idea! Still the slight (existing :-)) problem with the environment being chewed up for subsequent tasks, but I guess this is pretty much a corner case and it should be relatively trivial to do a save/restore as appropriate anyway. |
@mjtko @spohlenz @guilleiguaran can you guys confirm that this 2db49c5 is ok for you guys? |
I'm a bit concerned about precompile relying on clean as that's a change in behaviour (reasonable though it sounds). Perhaps bump that for now? Willing to defer to rails-core's better judgement on that though of course! :) |
You could choose to pull in the test from 6759a88 too... :) Edit: LOL - just noticed @josevalim already did that - please ignore me. =] |
@spastorino It's a little worse as now the enhance block runs in the wrong environment (i.e. the initializers have been run before I can work around that using an extra rake task and the ruby re-invocation dance though. |
I've done a bit more testing this morning and there are still some flaws regarding
I'm kinda at the end of my tether with this task now. It's going to get refactored. |
@spastorino That commit also breaks the test "precompile properly refers files referenced with asset_path and and run in the provided RAILS_ENV", not that I'm particularly bothered by that change in behaviour. |
Ok, I am working on fixes to both problems. |
All fixed. |
Thanks @josevalim, @spastorino. I can confirm this solves the issues for me. Enhancing |
Unfortunately, this still doesn't work. This is primarily because the clean task is running in the development environment by default while the precompile task is running in the production environment by default. I'm about to open up a couple of pull requests - one containing a failing test to cover this case and one containing that test plus a bunch of refactoring work to this task and the |
Patch and associated test to fix #3198.