Skip to content

Commit

Permalink
fix(ci): compile rust docs in release and deny warnings (starkware-li…
Browse files Browse the repository at this point in the history
…bs#2824)

- No reason to run cargo on release in the ci, and this busts cache
- Cargo doc doesn't pick up the usual place we pass -Dwarnings, which is
  RUSTFLAGS, it needs a special flag RUSTDOCFLAGS (it cannot reference
  the usual RUSTFLAGS so we have to duplicate)

Co-Authored-By: Gilad Chase <[email protected]>
  • Loading branch information
giladchase and Gilad Chase authored Dec 30, 2024
1 parent 2a7d97c commit b875cc0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
env:
CI: 1
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
RUSTDOCFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
EXTRA_RUST_TOOLCHAINS: nightly-2024-04-29

# On PR events, cancel existing CI runs on this same PR for this workflow.
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/execution/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ impl SyscallResponse for GetBlockHashResponse {

/// Returns the block hash of a given block_number.
/// Returns the expected block hash if the given block was created at least
/// [constants::STORED_BLOCK_HASH_BUFFER] blocks before the current block. Otherwise, returns an
/// error.
/// [crate::abi::constants::STORED_BLOCK_HASH_BUFFER] blocks before the current block. Otherwise,
/// returns an error.
pub fn get_block_hash(
request: GetBlockHashRequest,
_vm: &mut VirtualMachine,
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_api/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl From<cairo_lang_starknet_classes::contract_class::ContractClass> for Sierra
}
}

/// An entry point of a [ContractClass](`crate::state::ContractClass`).
/// An entry point of a [SierraContractClass](`SierraContractClass`).
#[derive(Debug, Default, Clone, Eq, PartialEq, Hash, Deserialize, Serialize, PartialOrd, Ord)]
pub struct EntryPoint {
pub function_idx: FunctionIndex,
Expand Down
4 changes: 2 additions & 2 deletions crates/starknet_sequencer_node/src/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pub struct SequencerNodeClients {
///
/// # Returns
///
/// An Option<Arc<dyn ClientTrait>> containing the available client (local_client or remote_client),
/// wrapped in Arc. If neither exists, returns None.
/// An `Option<Arc<dyn ClientTrait>>` containing the available client (local_client or
/// remote_client), wrapped in Arc. If neither exists, returns None.
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def cmd(self, crates: Set[str]) -> List[str]:
return ["cargo", "clippy"] + clippy_args + ["--all-targets"]
elif self == BaseCommand.DOC:
doc_args = package_args if len(package_args) > 0 else ["--workspace"]
return ["cargo", "doc", "-r", "--document-private-items", "--no-deps"] + doc_args
return ["cargo", "doc", "--document-private-items", "--no-deps"] + doc_args

raise NotImplementedError(f"Command {self} not implemented.")

Expand Down

0 comments on commit b875cc0

Please sign in to comment.