Skip to content

Add ability to override library that bindgen loads in at runtime via the environment#28

Draft
1egoman wants to merge 1 commit intomainfrom
add-environment-override
Draft

Add ability to override library that bindgen loads in at runtime via the environment#28
1egoman wants to merge 1 commit intomainfrom
add-environment-override

Conversation

@1egoman
Copy link
Collaborator

@1egoman 1egoman commented Mar 17, 2026

The thinking with this is it provides a way that developers or users can potentially use a newly built native core for testing / debugging without having to fully rebuild the node end of the bindgen.

I have seen this pattern in other bindgen type tools so I think it probably is a good one, but I'm definitely open to thoughts here on if this is a good idea or should be the concern of user code higher up the stack.

(Note - I tested this in a livekit downstream implementer of the bindgen with success, so I am confident this works in its current state.)

…e via the environment

The thinking with this is it provides a way that developers or users can
potentially use a newly built native core for testing / debugging
without having to fully rebuild the node end of the bindgen.

I have seen this pattern in other bindgen type tools so I think it
probably is a good one, but I'm definitely open to thoughts here on if
this is a good idea or should be the concern of user code higher up the
stack.
// Get the path to the lib to load

// 1. Use the library passed in the environment with the highest precidence
let libraryPath = process.env[`${library.toUpperCase()}_PATH`];
Copy link
Collaborator Author

@1egoman 1egoman Mar 17, 2026

Choose a reason for hiding this comment

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

Note to self: Before merging, this needs to be documented somewhere (maybe in --help?)

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.

1 participant