Skip to content

Conversation

@Annih
Copy link

@Annih Annih commented Jun 9, 2025

Replace require_relative "../llhttp_ext" by require "llhttp_ext" to load the native extension.
This improves compatibility with Bundler and RubyGems, especially in environments using bundle install --standalone or other setups where the extension may not be located relative to the Ruby file.

Using require ensures the extension is loaded from the load path, following RubyGems best practices for native extensions.

Fix #33

@Annih
Copy link
Author

Annih commented Jun 9, 2025

I successfully tested it against our bundle install --standalone setup, but also against a more standard bundle install.

@bryanp
Copy link
Owner

bryanp commented Jun 23, 2025

Thanks @Annih, it looks like there are some test failures. Can you look?

@Annih
Copy link
Author

Annih commented Jun 24, 2025

OK @bryanp I'm checking, but this does not seem related to my change (I tested in local with and without my change I reproduce 100%)
The curl call times out (it even stay after the test session on my local machine)

@Annih
Copy link
Author

Annih commented Jun 24, 2025

From my quick investigation the issue comes from io-event after the version >= 1.9.0. I will dig a bit later the changelog.

@Annih
Copy link
Author

Annih commented Jun 24, 2025

OK so the project async-http faced a similar issue and reported the compat issue between recent IO-event version and fork processed in socketry/io-event#36
They seem to have fix (one of?) their issue using synchronous block for the IO endpoint see socketry/async-http#100

I will submit a pin of io-event to demonstrate it works well, then let me know what you really want me to do 🤷🏻‍♂️

@Annih Annih force-pushed the native_extension_require branch from a3ef322 to fc30831 Compare September 30, 2025 10:14
@Annih
Copy link
Author

Annih commented Sep 30, 2025

@bryanp could you approve the workfow to validate it works well with the pin?

@bryanp
Copy link
Owner

bryanp commented Oct 1, 2025

Apologies @Annih, I got busy 😅

Just approved the workflow. Tests pass now but one minor linter issue.

Annih added 2 commits October 2, 2025 17:42
Replace `require_relative "../llhttp_ext"` by `require "llhttp_ext"`
to load the native extension.
This improves compatibility with Bundler and RubyGems, especially in
environments using `bundle install --standalone` or other setups where
the extension may not be located relative to the Ruby file.

Using `require` ensures the extension is loaded from the load path,
following RubyGems best practices for native extensions.
This commit is mostly here to demonstrate the tests are passing with
this version of io-event.
A refactor of the tests might be required.
@Annih Annih force-pushed the native_extension_require branch from fc30831 to 989ead6 Compare October 2, 2025 15:42
@Annih
Copy link
Author

Annih commented Oct 2, 2025

No problem @bryanp I was busy too :) I should have fixed the linter issue!

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

Successfully merging this pull request may close these issues.

LoadError when requiring native extension with require_relative in Parser.rb

2 participants