Skip to content

Commit

Permalink
chore: minor comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth committed Jan 23, 2025
1 parent d74e222 commit 01147e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/proving-service/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ use miette::IntoDiagnostic;
use protox::prost::Message;

/// Defines whether the build script should generate files in `/src`.
///
/// The docs.rs build pipeline has a read-only filesystem, so we have to avoid writing to `src`,
/// otherwise the docs will fail to build there. Note that writing to `OUT_DIR` is fine.
const BUILD_GENERATED_FILES_IN_SRC: bool = option_env!("BUILD_GENERATED_FILES_IN_SRC").is_some();

/// Generates Rust protobuf bindings from .proto files.
///
/// Because the proto generated files will be written to ./src/generated, this should be a no-op
/// if ./src is read-only. To enable writing to ./src, set the `BUILD_GENERATED_FILES_IN_SRC`
/// environment variable.
fn main() -> miette::Result<()> {
println!("cargo::rerun-if-env-changed=BUILD_GENERATED_FILES_IN_SRC");
if !BUILD_GENERATED_FILES_IN_SRC {
return Ok(());
}
Expand Down
1 change: 1 addition & 0 deletions crates/miden-lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ fn is_masm_file(path: &Path) -> io::Result<bool> {
///
/// We also ensure that a constant is not defined twice, except if their error code is the same.
/// This can happen across multiple files.
///
/// Because the error files will be written to ./src/errors, this should be a no-op if ./src is
/// read-only. To enable writing to ./src, set the `BUILD_GENERATED_FILES_IN_SRC` environment
/// variable.
Expand Down
3 changes: 3 additions & 0 deletions crates/miden-proving-service-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ use miette::IntoDiagnostic;
use protox::prost::Message;

/// Defines whether the build script should generate files in `/src`.
///
/// The docs.rs build pipeline has a read-only filesystem, so we have to avoid writing to `src`,
/// otherwise the docs will fail to build there. Note that writing to `OUT_DIR` is fine.
const BUILD_GENERATED_FILES_IN_SRC: bool = option_env!("BUILD_GENERATED_FILES_IN_SRC").is_some();

/// Generates Rust protobuf bindings from .proto files.
///
/// Because the proto generated files will be written to ./src/generated, this should be a no-op
/// if ./src is read-only. To enable writing to ./src, set the `BUILD_GENERATED_FILES_IN_SRC`
/// environment variable.
fn main() -> miette::Result<()> {
println!("cargo::rerun-if-env-changed=BUILD_GENERATED_FILES_IN_SRC");
if !BUILD_GENERATED_FILES_IN_SRC {
return Ok(());
}
Expand Down

0 comments on commit 01147e2

Please sign in to comment.