-
Notifications
You must be signed in to change notification settings - Fork 262
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
Normalization adds whitespaces - inconsistently #355
Comments
I was not able to figure out a quick way of diagnosing what the difference was between the CircleCI and local parsing, and just manually edited the whitespace back in locally (bikeindex/bike_index#1646) If there is a way to do additional diagnostics, or any way of getting to a fix on this, I would be very appreciative! |
I'm not sure what’s going on here. There seems to be something related to glebm/i18n-tasks#355.
I'm not sure what’s going on here. There seems to be something related to glebm/i18n-tasks#355.
I'm not sure what’s going on here. There seems to be something related to glebm/i18n-tasks#355.
Exactly the same issue here! |
Also bumped into this. Using Circle CI and Linux for local dev. |
The problem lies in the yaml gem which behaves differently on different operating systems. # ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
# irb
irb(main):001:0> require "yaml"
=> true
irb(main):002:0> tree = {"en"=>{"empty"=>nil}}.to_yaml
=> "---\nen:\n empty: \n" # ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
# irb
irb(main):001:0> require "yaml"
=> true
irb(main):002:0> tree = {"en"=>{"empty"=>nil}}.to_yaml
=> "---\nen:\n empty:\n" Notice the space after ruby/psych#467 |
Just did a quick test on my local machine (Arch Linux) and on the Circle CI VM. Different behaviours despite similar systems: Local:$ uname -a
Linux geofront 5.9.1-arch1-1 #1 SMP PREEMPT Sat, 17 Oct 2020 13:30:37 +0000 x86_64 GNU/Linux
$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
$ irb
irb(main):001:0> require "yaml"
=> true
irb(main):002:0> tree = {"en"=>{"empty"=>nil}}.to_yaml
=> "---\nen:\n empty:\n" Circle CI:circleci:~$ uname -a
Linux b2f5d83f5d3f 4.15.0-1077-aws #81-Ubuntu SMP Wed Jun 24 16:48:15 UTC 2020 x86_64 GNU/Linux
circleci:~$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
circleci:~$ irb
irb(main):001:0> require "yaml"
=> true
irb(main):002:0> tree = {"en"=>{"empty"=>nil}}.to_yaml
=> "---\nen:\n empty: \n" One difference that I can see is the much older kernel version on the Circle CI VM. |
The problem is with the libyaml versions. There is a difference on how the versions 0.2.4 and 0.2.5 handle the nil values. An easy way to check the version of your libyaml version is the following:
Thus not sure if something can be done on the gem. |
On CI the test `test_files_are_normalized` failed because normalizing behaved differently due to an older libyaml version. glebm/i18n-tasks#355
Getting the correct libyaml version onto the current |
Having this problem as well |
This makes normalization work consistently, regardless of the libyaml version used by psych. This fixes glebm#355
This makes normalization work consistently, regardless of the libyaml version used by psych. This fixes #355
Running into an issue with inconsistent normalization on Bike Index.
Normalization is not adding whitespace locally, and then is failing on CircleCI. Which is very frustrating.
I can't demonstrate that
normalize
is passing locally, but I promise that it is. Both local and CircleCI are running the same version of ruby, same version of gems, etc.The end result of this is the same as #319 - but since i18n-tasks no longer uses Psych, and instead uses the standard lib yaml parser, I think this belongs in a separate issue.
I'm trying to solve this, hopefully I figure it out shortly and I'll update here when I do - but in case anyone else runs into this problem, I figure documenting it is worthwhile.
The text was updated successfully, but these errors were encountered: