Conversation
org-ruby 0.9.12 (with rubypants), creole 0.5.0 and wikicloth 0.8.3 modify string literals in place, so every Org, Creole and MediaWiki render raises FrozenError when string literals are frozen by default (--enable=frozen-string-literal, or a future Ruby). GemImplementation now accepts mutable_string_literals: true. When literals are frozen, it loads the gem with frozen_string_literal: false and restores the compile option afterwards. In the default "chilled" mode it does nothing, because Ruby can't restore that state once it has been changed. Also add a Ruby 4.0 CI job that runs the tests with frozen string literals.
|
Note there are some PR's (didn't test) to fix this in org-ruby at least: |
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
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.
Related to #2105
Why
org-ruby, creole and wikicloth change string literals in place. With frozen string literals (
--enable=frozen-string-literaltoday, possibly the default in a future Ruby), every Org, Creole and MediaWiki render fails withFrozenError. None of these gems has had a release in years, so upgrading them isn't an option.This probably isn't what's behind the issue above, but it's the same kind of break waiting to happen.
What changed
Testing
bundle exec rakepasses on Ruby 3.4 with and withoutRUBYOPT=--enable=frozen-string-literal, with 100% line and branch coverage. Without this change, the frozen run fails the Org, Creole and MediaWiki tests.It only helps when the gem is first loaded through github-markup, not when an app has already loaded it.