Skip to content

Conversation

scintillavoy
Copy link

@scintillavoy scintillavoy commented Aug 7, 2025

This PR updates the documentation under "Compiling protoc from source" to avoid using unsafe std::env::set_var.

std::env::set_var becomes unsafe in Rust 2024 unless certain strict single-threaded conditions are met. While we could wrap the call in an unsafe block, introducing unsafe just for setting an environment variable isn't worth the added complexity. Instead, the example now uses the prost_build::Config::protoc_executable method to directly set the path to the protoc binary.

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