-
Notifications
You must be signed in to change notification settings - Fork 327
Closed
Description
Environment
- OS: Rocky Linux 8.10
- Ruby: 3.1.4 (EOL I know)
- Gems::
bundler 2.4.22
,http 5.3.0
,lhttp 0.6.1
Problem
After the recent switch to the llhttp
native Ruby binding (#800), using the http
gem in environments that rely on Bundler’s --standalone
mode results in a LoadError
when requiring the native extension. This is due to the way llhttp loads its native extension using require_relative
, which fails when the extension is not located relative to the Ruby file (as is common in standalone or custom deployment setups).
Error example:
LoadError: cannot load such file -- /app/bundle/ruby/3.1.0/gems/llhttp-0.5.0/lib/llhttp_ext # ./bundle/ruby/3.1.0/gems/llhttp-0.5.0/lib/llhttp/parser.rb:52:in `require_relative' # ...
Analysis
- The
http
gem now depends onllhttp
instead ofllhttp-ffi
, which currently usesrequire_relative
to load its native extension. - In some deployment setups (notably with bundle install
--standalone
), the compiled extension is not in the expected relative location, causing aLoadError
. - This issue has been reported and a fix submitted upstream to the
llhttp
gem: LoadError when requiring native extension with require_relative in Parser.rb bryanp/llhttp#33 and Do not use require_relative with native extension bryanp/llhttp#34.
Suggested Action
- Consider documenting this issue for users of the http gem until the fix is released in
llhttp
. - Optionally, add a compatibility note or version constraint for
llhttp
in thehttp
gem’s dependencies to ensure users get the fixed version once released. - If possible, add a test or CI job for Bundler standalone mode to catch similar issues in the future. (I know this is kind of niche 🤷♂ )
Metadata
Metadata
Assignees
Labels
No labels