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

Bootsnap readonly + --enable=frozen-string-literal --debug=frozen-string-literal = stale entries in logs #492

Closed
n-rodriguez opened this issue Oct 12, 2024 · 2 comments

Comments

@n-rodriguez
Copy link

Hi there!

I've enabled --enable=frozen-string-literal --debug=frozen-string-literal after reading https://gist.github.com/fxn/bf4eed2505c76f4fca03ab48c43adc72 and now I get a lot of [Bootsnap] stale messages in logs :

puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/devise-4.9.4/lib/devise/hooks/proxy.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/devise-4.9.4/lib/devise/controllers/rememberable.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/televisions.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/shell_tv.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/notebooks.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/consoles.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/car_browsers.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/cameras.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/portable_media_player.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/device/mobiles.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/vendorfragments.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/oss.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/client/feed_readers.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/client/mobile_apps.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/client/mediaplayers.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/client/pim.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/client/browsers.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/device_detector-1.1.3/regexes/client/libraries.yml
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/actionview-7.2.1/lib/action_view/template/sources/file.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/temple-0.10.3/lib/temple/generators/rails_output_buffer.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/kramdown-2.4.0/lib/kramdown/utils/string_scanner.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/kramdown-2.4.0/lib/kramdown/converter/html.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/kramdown-2.4.0/lib/kramdown/converter/base.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/kramdown-2.4.0/lib/kramdown/utils/html.rb
puma-back-office-1    | [Bootsnap] stale /app/vendor/bundle/ruby/3.3.0/gems/kramdown-2.4.0/lib/kramdown/converter/syntax_highlighter/rouge.rb

Thank you!

@casperisfine
Copy link
Contributor

Hi, this is expected.

These flags do change the generated bytecode, so any cache generated without these flags automatically get stale.

I'm not sure in which context you are asking this for, I assume it's for development so not much to do except ignore those.

If it's in a production environment and you do want to run with these flags there and use bootsnap precompile, then you have to invoke bootsnap precompile with the same flags: RUBYOPT='--enable=frozen-string-literal --debug=frozen-string-literal' bootsnap precompile ...

@n-rodriguez
Copy link
Author

If it's in a production environment and you do want to run with these flags there and use bootsnap precompile, then you have to invoke bootsnap precompile with the same flags: RUBYOPT='--enable=frozen-string-literal --debug=frozen-string-literal' bootsnap precompile ...

It works! Thank you!

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

No branches or pull requests

2 participants