Skip to content

Update extconf.rb to use dev build for Rust library when possible#17

Merged
ChallaHalla merged 1 commit intomainfrom
update-build-config
Jun 24, 2025
Merged

Update extconf.rb to use dev build for Rust library when possible#17
ChallaHalla merged 1 commit intomainfrom
update-build-config

Conversation

@ChallaHalla
Copy link
Contributor

When building a Rust library, the command cargo build --release can be used to build an optimized version of the library. This however comes at a performance cost during compilation time. During development, these bits of time will add up significantly.

This PR enables the Ruby build script to call cargo build without the release flag. This will generate a dev build for the Rust lib whenever possible, saving us some time when developing.

possible so that compile times are shorter during development.
@ChallaHalla ChallaHalla requested a review from vinistock June 24, 2025 13:51
# Get the absolute path to the target directory
root_dir = File.expand_path("../..", __dir__)
target_dir = File.join(root_dir, "target", "release")
release = ENV["RELEASE"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using an ENV variable seems like the best way to toggle between build strategies from what I can tell. I am not sure if there's some config Rake compiler has where we can pass an arg when calling ruby extconf.rb.

@ChallaHalla ChallaHalla merged commit 3b3e855 into main Jun 24, 2025
1 check passed
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.

2 participants