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

Rake task 'gettext:pot' silently fails on Windows #12

Open
glennsarti opened this issue Oct 31, 2016 · 3 comments
Open

Rake task 'gettext:pot' silently fails on Windows #12

glennsarti opened this issue Oct 31, 2016 · 3 comments

Comments

@glennsarti
Copy link

Problem:
I was attempting to run the gettext-setup gem on Windows against Puppet. This works succesfully on Mac, Linux and Windows Subsystem for Linux, however on native windows it gives the following message;

POT file locales/puppet.pot has been updated

However the file is not created and the message comes back VERY quickly. Running procmon, it is obvious that no files are being parsesd.

After digging around I found the problem is related to the following code;
https://github.com/puppetlabs/gettext-setup-gem/blob/master/lib/tasks/gettext.rake#L36-L41

Firstly I thought the command line was too long (it's MASSIVE for Puppet), However I made the following change;
From

           "#{files_to_translate.join(" ")}")

To

           "#{files_to_translate[0..1].join(" ")}")

Just to get the first two files and I received the following error (local git repo is at C:\Source\brannan-puppet);

C:/Source/brannan-puppet/.bundle/windows/ruby/2.3.0/gems/gettext-3.2.2/lib/gettext/tools/xgettext.rb:229:in `check_command_line_options': no input files (ArgumentError)
        from C:/Source/brannan-puppet/.bundle/windows/ruby/2.3.0/gems/gettext-3.2.2/lib/gettext/tools/xgettext.rb:149:in `run'
        from C:/Source/brannan-puppet/.bundle/windows/ruby/2.3.0/gems/gettext-3.2.2/lib/gettext/tools/xgettext.rb:34:in `run'
        from C:/Source/brannan-puppet/.bundle/windows/ruby/2.3.0/gems/gettext-3.2.2/bin/rxgettext:24:in `<top (required)>'
        from C:/Source/brannan-puppet/.bundle/windows/ruby/2.3.0/bin/rxgettext:22:in `load'
        from C:/Source/brannan-puppet/.bundle/windows/ruby/2.3.0/bin/rxgettext:22:in `<main>'
POT file locales/puppet.pot has been updated

It appears that this gem does not work on Windows.

@glennsarti
Copy link
Author

Note - Running the same command outside of Ruby's system works correctly. e.g.

bundle exec rxgettext -o locales/puppet.pot --no-wrap --sort-by-file --no-location --add-comments --msgid-bugs-address '' --package-name '' --package-version '' --copyright-holder='' --copyright-year=2016 lib/hiera/puppet_function.rb lib/hiera/scope.rb

generates a correct pot file

@glennsarti glennsarti changed the title Rake task 'gettext:po' silently fails on Windows Rake task 'gettext:pot' silently fails on Windows Oct 31, 2016
@smcclellan
Copy link
Contributor

smcclellan commented Apr 25, 2017

@glennsarti Some changes have been made to how the gem interprets return codes for executables. Could you verify that this issue is still existent?

EDIT: And also please check the value for source_files inside config.yaml, as that is likely not picking up any files.

@smcclellan
Copy link
Contributor

Just a thought, but using options in this style might work (containing both Windows and Linux path extensions)?

  source_files:
    - 'app.rb'
    - 'lib/**/*.rb'
    - 'lib\\**\\*.rb'

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