Skip to content

feat: add load_data_fun to load dynamic data - #107

Merged
philss merged 4 commits into
philss:mainfrom
leandrocp:feat-load-data-fun
Sep 28, 2026
Merged

philss merged 4 commits into
philss:mainfrom
leandrocp:feat-load-data-fun

Conversation

@leandrocp

Copy link
Copy Markdown
Contributor

Closes #54

Hey @philss I found a situation where I needed to load data dynamically and since #54 is open I'm pushing this proposal.

Disclaimer: used claude but reviewed all changes and tested the config on my own projects.

@philss philss left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @leandrocp 👋

Thanks for the PR! Please check the comment and the CI.

Comment thread lib/rustler_precompiled/config.ex
Comment thread lib/rustler_precompiled/config.ex Outdated
assert {:module, ^module} = :code.load_binary(module, ~c"nofile", binary)
assert_receive :load_data_called
end)
end

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leandrocp This test is giving a SIGSEGV for me (like it does on CI), and I couldn't figure out how to fix it.

Please give it a try, but if you can't, I'm comfortable with proceeding without this integration test.

@leandrocp leandrocp Sep 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @philss I was able to reproduce on a Linux container (it works on my local Mac). I think the root cause was caused by 051306b where it added the archive extension so File.rm/1 stopped working silently and the tests in this PR tries to reload an existing NIF and it crashes. But I can't explain why it works in some envs but not others so I'm not completely sure.

Note that 6e7d7bc matches File.rm/1 returns. I think it's correct but I'm happy to make more changes! Thanks for your time reviewing this!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, and I agree it looks correct. Would you mind to open a isolated PR with that commit? I think it would be better for documenting the fix. We can rebase it after the merge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem! Done #109

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's odd that we don't have a conflict here, but please rebase so I can merge with only the changes for the load_data_fun.

@leandrocp leandrocp Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied the same patch in #109 and just added one test so I think that wouldn't create a conflict :)

@philss
philss merged commit 454b09f into philss:main Sep 28, 2026
2 checks passed
@leandrocp
leandrocp deleted the feat-load-data-fun branch September 28, 2026 21:07
@philss

philss commented Sep 28, 2026

Copy link
Copy Markdown
Owner

@leandrocp thank you for your efforts here! Great work!

I should release a new version (minor) between today and tomorrow.

@philss

philss commented Sep 29, 2026

Copy link
Copy Markdown
Owner

@leandrocp there is a new release, v0.10.0, with your changes :)

@leandrocp

Copy link
Copy Markdown
Contributor Author

Thanks @philss !

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.

Add support for loading dynamic data

2 participants