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

Run CI with frozen-string-literals enabled #592

Closed
PragTob opened this issue Jun 24, 2017 · 2 comments
Closed

Run CI with frozen-string-literals enabled #592

PragTob opened this issue Jun 24, 2017 · 2 comments

Comments

@PragTob
Copy link
Collaborator

PragTob commented Jun 24, 2017

As mentioned in #590 and should probably also be applied to simplecov-html. I'm not 100% sure if we should just run all 2.4+ with this seeting or if we should run 2.4 with both. As we also CI against 2.3 etc. without the setting it should be ok though.

@pat mentions how to do this:

I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced:

before_script:
- if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT

This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). However, at this point in time for the tests to pass, you'll need to use the latest RSpec commits, along with submitted patches to simplecov-html, test-unit, and parser (for rubocop):

@pat
Copy link
Contributor

pat commented Jun 25, 2017

Regarding the dependencies: obviously, simplecov-html is now sorted (at least in git), and test-unit's 3.2.5 release is frozen-string-literal friendly as well.

Parser is trickier, as it depends on racc, which isn't yet happy about frozen string literals. There are existing PRs there (made in January), but the test suite isn't green and I've not been able to figure out why.
ruby/racc#80
ruby/racc#81

@PragTob
Copy link
Collaborator Author

PragTob commented Jul 2, 2019

We enforce the pragma comments on freezing strings so I believe this is good enough as we make sure it works for our project.

@PragTob PragTob closed this as completed Jul 2, 2019
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