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

Fix incompatibility with bootsnap #158

Closed

Conversation

dsander
Copy link

@dsander dsander commented Apr 21, 2018

When using bootsnap in production it tries to compile the migration
files, but fails because the files are actually erb and thus not a
valid ruby file.

When using bootsnap in production it tries to compile the migration
files, but fails because the files are actually erb and thus not a
valid ruby file.
@albus522
Copy link
Member

albus522 commented Nov 8, 2019

What specific error did you run into and under what configuration? I have not seen where bootstrap is trying to compile these files.

@dsander
Copy link
Author

dsander commented Nov 9, 2019

The error was that files were named .rb while actually being .erb templates and not containing valid ruby syntax.

@albus522
Copy link
Member

I was asking for the actual error message as I can not reproduce your issue. Those files are never required by ruby and therefore should never be touched by bootsnap. A backtrace from the error would also be helpful.

@dsander
Copy link
Author

dsander commented Nov 11, 2019

Sorry you are right, at Huginn we have been running on a fork that uses this commit: dsander@55535e2 I kind of forgot about that change and without it (and the latest master branch) it works without issues.

Kind of unrelated question, we conditionally need to modify the reserve_sql_strategy, but since the Railtie is running after_initialize we can not do that in a Rails initializer.

Would you accept a PR that adds a ActiveSupport.run_load_hooks call like this: dsander@0b433cc ?

Thanks for your recent work on this gem!

@dsander dsander closed this Nov 11, 2019
@albus522
Copy link
Member

I am reasonable sure after_initialize hooks are run in the order in which they are defined. So if you add an after_initialize in your app that makes the changes you want, it should run after the one defined in DJ runs.

@albus522
Copy link
Member

Thank you for pointing out the reserve_sql_strategy issue. I need to update the documentation about that. I knew that change had something we were missing.

@dsander
Copy link
Author

dsander commented Nov 13, 2019

it should run after the one defined in DJ runs.

Thanks that seems to work. 👍

@albus522
Copy link
Member

@dsander I have been picking away at #149 slowly and would be curious to know what caused you to choose the old lock format.

@dsander
Copy link
Author

dsander commented Nov 13, 2019

We are only using the old lock strategy on mysql. Here is the original issue and reproduction: huginn/huginn#977 (comment). I believe we tested it against Postgres as well and did not have any issues with the optimized strategy.

@albus522
Copy link
Member

Thank you for digging that up.

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.

None yet

2 participants