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

version 0.9.2 tralics-linux syntax error #100

Closed
acmdas opened this issue Mar 8, 2014 · 9 comments

Comments

Projects
None yet
3 participants
@acmdas
Copy link

commented Mar 8, 2014

In debian wheezy, current rvm/ruby-2.1.1, polytexnic-0.9.2: any call to precompiled binary tralics-linux results in:
/home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic/../../precompiled_binaries/tralics-linux: 1: /home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic/../../precompiled_binaries/tralics-linux: Syntax error: Unterminated quoted string
/home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic/preprocessors/html.rb:318:in read': No such file or directory @ rb_sysopen - /tmp/polytex20140308-18268-8hpwbn.xml (Errno::ENOENT) from /home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic/preprocessors/html.rb:318:intralics_xml'
from /home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic/preprocessors/html.rb:13:in to_xml' from /home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic/preprocessor.rb:17:inpreprocess'
from /home/das/.rvm/gems/ruby-2.1.1/gems/polytexnic-0.9.2/lib/polytexnic.rb:77:in to_html' from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/builders/html.rb:118:inconverted_html'
from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/builders/html.rb:45:in build' from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/builder.rb:18:inbuild!'
from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/builders/epub.rb:8:in build!' from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/builders/mobi.rb:6:inbuild!'
from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/commands/build.rb:30:in block in all_formats' from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/commands/build.rb:24:ineach'
from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/commands/build.rb:24:in all_formats' from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/lib/softcover/cli.rb:28:inbuild'
from /home/das/.rvm/gems/ruby-2.1.1/gems/thor-0.18.1/lib/thor/command.rb:27:in run' from /home/das/.rvm/gems/ruby-2.1.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:ininvoke_command'
from /home/das/.rvm/gems/ruby-2.1.1/gems/thor-0.18.1/lib/thor.rb:363:in dispatch' from /home/das/.rvm/gems/ruby-2.1.1/gems/thor-0.18.1/lib/thor/base.rb:439:instart'
from /home/das/.rvm/gems/ruby-2.1.1/gems/softcover-0.9.8/bin/softcover:4:in <top (required)>' from /home/das/.rvm/gems/ruby-2.1.1/bin/softcover:23:inload'
from /home/das/.rvm/gems/ruby-2.1.1/bin/softcover:23:in <main>' from /home/das/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:ineval'
from /home/das/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `

'

@cirosantilli

This comment has been minimized.

Copy link

commented Mar 10, 2014

I was getting weird errors. Compiling tralics myself solved it: https://github.com/mhartl/tralics. Have you tried that?

@mhartl

@acmdas

This comment has been minimized.

Copy link
Author

commented Mar 10, 2014

Thanks, Ciro.

I'd think that removing the precompiled binaries would be a very good idea.

@mhartl

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2014

The precompiled binaries Just Work(tm) on most systems, so I'd rather not push
the compilation responsibility to the individual users. Instead, I'd like
to incorporate Ciro's precompiled binary into the softcover gem. Ciro,
could you send an email to my personal address with your precompiled
tralics binary? If you do that, also send me the Ruby platform you're on by
telling me the result of running these commands:

$ irb
>> RUBY_PLATFORM

If you can send me that information, it should help us expand the platforms
that can run Softcover without an extra compilation step.

@acmdas

This comment has been minimized.

Copy link
Author

commented Mar 11, 2014

Wonderful - thanks to you both.

David

On Mon, Mar 10, 2014 at 9:54 PM, Michael Hartl notifications@github.comwrote:

The precompiled binaries Just Work(tm) on most systems, so I'd rather not
push
the compilation responsibility to the individual users. Instead, I'd like
to incorporate Ciro's precompiled binary into the softcover gem. Ciro,
could you send an email to my personal address with your precompiled
tralics binary? If you do that, also send me the Ruby platform you're on by
telling me the result of running these commands:

$ irb

RUBY_PLATFORM

If you can send me that information, it should help us expand the platforms
that can run Softcover without an extra compilation step.

Reply to this email directly or view it on GitHubhttps://github.com//issues/100#issuecomment-37255983
.

@cirosantilli

This comment has been minimized.

Copy link

commented Mar 11, 2014

@mhartl I'm on i686-linux, Ubuntu 12.04. I'll add the binary in and PR.

Still, feels like bad practice adding system specific binaries to a Git repo:

  • if it does not work on a system, people have to look really hard for the cause of the problem
  • can a single binary be used consistently on across all Linux distros?
  • makes repo larger, with files that are not useful for most people
  • there are already many steps that require non automatic user input (epubcheck, kindlegen), and

I see the following alternatives, other than adding as a regular dependency:

  • name the binaries consistently according to the system, e.g. tralics-RUBY_PLATFORM.

    First look in PATH for it.

    If not present, try a precompiled binary based on RUBY_PLATFORM.

    If none matches the system, tell people clearly to compile.

    TODO: does having the same RUBY_PLATFORM ruby platform guarantee that it can be used across any Linux distro? Seems not: this reports Fedora / CentOS linker inconsistencies. How can we be sure then the binary works properly?

  • pack tralics code in, and compile it at install time. Not sure if possible with Gems, and not sure if there is a OS portable way of doing it.

  • tell everyone to use a VM: https://github.com/cirosantilli/softcover_vagrant

Also consider either:

Tell me what you want me to do and I'll do it.

@mhartl

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2014

Ideally, I would prefer to compile Tralics on demand rather than include binaries, but I don't know offhand how to do it. It's probably possible, because lots of Ruby gems compile native extensions, though usually in C (Tralics is in C++). If you'd like to try adding it, that would be great. The Tralics source code is here.

Otherwise, the next-best solution is probably to slowly build up a catalog of working binaries and switch on them based on the platform. As you suggested, if the platform isn't supported, the system should detect this and prompt a compilation step.

@cirosantilli

This comment has been minimized.

Copy link

commented Mar 16, 2014

I'll add the binary and pull request once all tests start passing my VM and I'm sure the problem is not due to the binary.

I'll pull request a "precompiled not available for current system" warning soon.

@cirosantilli

This comment has been minimized.

Copy link

commented Mar 17, 2014

@mhartl before I can make a PR, I need to know the value of RUBY_PLATFORM for each of the 3 existing precompiled binaries.

Why are there two for OS X, one newer and older?

@mhartl

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2014

There are only two OS X binaries because the newer binary works on every OS
X after Lion, and older binary works on Lion back to Snow Leopard. I don't
know the value of RUBY_PLATFORM for each of those, but it's probably not
necessary to make a separate tralics binary for every one.

My guess is the best solution is to make things Just Work(tm) for all OS X
users and some Linux users, and prompt other users to compile and install
tralics somewhere on their path. I'm running out of space on my MacBook Air
these days, but sometime soon I'll get a new desktop Mac and start
installing virtual machines so that I can experiment more directly.

2014-03-17 5:20 GMT-07:00 Ciro Santilli notifications@github.com:

@mhartl https://github.com/mhartl before I can make a PR, I need to
know the value of RUBY_PLATFORM for each of the 3 existing precompiled
binaries.

Why are there two for OS X, one newer and older?

Reply to this email directly or view it on GitHubhttps://github.com//issues/100#issuecomment-37809097
.

@mhartl mhartl closed this May 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.