style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -110,17 +110,17 @@ impl PrepareError {
|
||||
pub fn is_deterministic(&self) -> bool {
|
||||
use PrepareError::*;
|
||||
match self {
|
||||
Prevalidation(_) |
|
||||
Preparation(_) |
|
||||
JobError(_) |
|
||||
OutOfMemory |
|
||||
CouldNotDecompressCodeBlob(_) => true,
|
||||
IoErr(_) |
|
||||
JobDied { .. } |
|
||||
CreateTmpFile(_) |
|
||||
RenameTmpFile { .. } |
|
||||
ClearWorkerDir(_) |
|
||||
Kernel(_) => false,
|
||||
Prevalidation(_)
|
||||
| Preparation(_)
|
||||
| JobError(_)
|
||||
| OutOfMemory
|
||||
| CouldNotDecompressCodeBlob(_) => true,
|
||||
IoErr(_)
|
||||
| JobDied { .. }
|
||||
| CreateTmpFile(_)
|
||||
| RenameTmpFile { .. }
|
||||
| ClearWorkerDir(_)
|
||||
| Kernel(_) => false,
|
||||
// Can occur due to issues with the PVF, but also due to factors like local load.
|
||||
TimedOut => false,
|
||||
// Can occur due to issues with the PVF, but also due to local errors.
|
||||
|
||||
@@ -160,16 +160,17 @@ pub fn params_to_wasmtime_semantics(par: &ExecutorParams) -> (Semantics, Determi
|
||||
|
||||
for p in par.iter() {
|
||||
match p {
|
||||
ExecutorParam::MaxMemoryPages(max_pages) =>
|
||||
ExecutorParam::MaxMemoryPages(max_pages) => {
|
||||
sem.heap_alloc_strategy = HeapAllocStrategy::Dynamic {
|
||||
maximum_pages: Some((*max_pages).saturating_add(DEFAULT_HEAP_PAGES_ESTIMATE)),
|
||||
},
|
||||
}
|
||||
},
|
||||
ExecutorParam::StackLogicalMax(slm) => stack_limit.logical_max = *slm,
|
||||
ExecutorParam::StackNativeMax(snm) => stack_limit.native_stack_max = *snm,
|
||||
ExecutorParam::WasmExtBulkMemory => sem.wasm_bulk_memory = true,
|
||||
ExecutorParam::PrecheckingMaxMemory(_) |
|
||||
ExecutorParam::PvfPrepTimeout(_, _) |
|
||||
ExecutorParam::PvfExecTimeout(_, _) => (), /* Not used here */
|
||||
ExecutorParam::PrecheckingMaxMemory(_)
|
||||
| ExecutorParam::PvfPrepTimeout(_, _)
|
||||
| ExecutorParam::PvfExecTimeout(_, _) => (), /* Not used here */
|
||||
}
|
||||
}
|
||||
sem.deterministic_stack_limit = Some(stack_limit.clone());
|
||||
|
||||
@@ -133,8 +133,8 @@ impl fmt::Debug for PvfPrepData {
|
||||
|
||||
impl PartialEq for PvfPrepData {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.code_hash == other.code_hash &&
|
||||
self.executor_params.hash() == other.executor_params.hash()
|
||||
self.code_hash == other.code_hash
|
||||
&& self.executor_params.hash() == other.executor_params.hash()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -562,8 +562,8 @@ fn recv_worker_handshake(stream: &mut UnixStream) -> io::Result<WorkerHandshake>
|
||||
///
|
||||
/// Returns a `Duration` representing the total CPU time.
|
||||
pub fn get_total_cpu_usage(rusage: Usage) -> Duration {
|
||||
let micros = (((rusage.user_time().tv_sec() + rusage.system_time().tv_sec()) * 1_000_000) +
|
||||
(rusage.system_time().tv_usec() + rusage.user_time().tv_usec()) as i64) as u64;
|
||||
let micros = (((rusage.user_time().tv_sec() + rusage.system_time().tv_sec()) * 1_000_000)
|
||||
+ (rusage.system_time().tv_usec() + rusage.user_time().tv_usec()) as i64) as u64;
|
||||
|
||||
return Duration::from_micros(micros);
|
||||
}
|
||||
|
||||
@@ -121,11 +121,12 @@ fn try_restrict(worker_info: &WorkerInfo) -> Result<()> {
|
||||
worker_dir_path_c.as_ptr(),
|
||||
worker_dir_path_c.as_ptr(),
|
||||
ptr::null(), // ignored when MS_BIND is used
|
||||
libc::MS_BIND |
|
||||
libc::MS_REC | libc::MS_NOEXEC |
|
||||
libc::MS_NODEV | libc::MS_NOSUID |
|
||||
libc::MS_NOATIME |
|
||||
additional_flags,
|
||||
libc::MS_BIND
|
||||
| libc::MS_REC | libc::MS_NOEXEC
|
||||
| libc::MS_NODEV
|
||||
| libc::MS_NOSUID
|
||||
| libc::MS_NOATIME
|
||||
| additional_flags,
|
||||
ptr::null(), // ignored when MS_BIND is used
|
||||
) < 0
|
||||
{
|
||||
|
||||
@@ -82,12 +82,12 @@ fn clone_flags(have_unshare_newuser: bool) -> CloneFlags {
|
||||
// SIGCHLD flag is used to inform clone that the parent process is
|
||||
// expecting a child termination signal, without this flag `waitpid` function
|
||||
// return `ECHILD` error.
|
||||
maybe_clone_newuser |
|
||||
CloneFlags::CLONE_NEWCGROUP |
|
||||
CloneFlags::CLONE_NEWIPC |
|
||||
CloneFlags::CLONE_NEWNET |
|
||||
CloneFlags::CLONE_NEWNS |
|
||||
CloneFlags::CLONE_NEWPID |
|
||||
CloneFlags::CLONE_NEWUTS |
|
||||
CloneFlags::from_bits_retain(libc::SIGCHLD)
|
||||
maybe_clone_newuser
|
||||
| CloneFlags::CLONE_NEWCGROUP
|
||||
| CloneFlags::CLONE_NEWIPC
|
||||
| CloneFlags::CLONE_NEWNET
|
||||
| CloneFlags::CLONE_NEWNS
|
||||
| CloneFlags::CLONE_NEWPID
|
||||
| CloneFlags::CLONE_NEWUTS
|
||||
| CloneFlags::from_bits_retain(libc::SIGCHLD)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user