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

WAR files give error "Could not find http-parser-1.2.1 in any of the sources" #482

Open
sandbergja opened this issue Apr 27, 2020 · 4 comments

Comments

@sandbergja
Copy link

sandbergja commented Apr 27, 2020

Warbler appears to not be playing nicely with the http-parser gem. I followed the following steps on jruby 9.2.11.1 to create a WAR file of a basic rails app with http-parser in the Gemfile:

rails new problem
cd problem
echo "gem 'warbler', github: 'jruby/warbler'" >> Gemfile
echo "gem 'http-parser'" >> Gemfile
bundle update
warble

I also tried warble compiled war. Both times, when I put the WAR file into tomcat, I got the following error in my browser:

Could not find http-parser-1.2.1 in any of the sources

I can run rails s no problem, and get no problems when I use http-parser in my app locally. It's only when I try to run the WAR file that I get problems.

I am using bundler 2.1.4. I tried this on both Windows and Linux.

@headius
Copy link
Member

headius commented May 12, 2020

So it's only this library you seem to have trouble with?

I know that http-parser has a native component that has to be build and shipped... so that would definitely complicate putting it into a war file. Native libraries can't be loaded from within a war/jar so it would have to be installed on the filesystem somewhere.

@sandbergja
Copy link
Author

http-parser is the only one that gave me that trouble. I tried a few other gems that also need some C code, like sassc, unf, and rb-fsevent. I do not get the same error in my browser when I include those in my Gemfile.

For what it's worth, it does look like the native C code made it into the WAR. Here is what I get from running ls -R in WEB-INF/gems/gems/http-parser-1.2.1/ext/:

http-parser  Rakefile  x86_64-linux

WEB-INF/gems/gems/http-parser-1.2.1/ext/http-parser:
http_parser.c  http_parser.h

WEB-INF/gems/gems/http-parser-1.2.1/ext/x86_64-linux:
http-parser  libhttp-parser-ext.so

WEB-INF/gems/gems/http-parser-1.2.1/ext/x86_64-linux/http-parser:
http_parser.o

@headius
Copy link
Member

headius commented Jun 2, 2020

This has also been reported in a different form in #472, where the sassc library needs to be able to build and load a native library that it binds with FFI.

@jlahtinen
Copy link

jlahtinen commented Jun 17, 2020

I have similar problem with sassc. I debugged it to the point that sassc spec is skipped because it is missing extensions. gem.build_complete file is not included in application.war.

I am using warbler 2.0.5, jruby 9.2.11.0 with rvm. Bundler version 1.17.3

sassc gems installed into rvm gems has gem.build_complete files and everthing works when running rails with puma. Making application.war does not work inside tomcat and error is Bundler::GemNotFound: Could not find sassc-2.0.1 in any of the sources

this problem does not exist with bundler 2.1.4

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

3 participants