Skip to content

Compilation error with Rust 1.89.0 - raw_os_error() method not found on TryLockError #338

@rjan90

Description

@rjan90

A user in Lotus reported getting build errors coming from bellperson when using rust version 1.89.0:

Environment:

  • OS: Ubuntu 22.04
  • Rust version: 1.89.0 (29483883e 2025-08-04)
  • bellperson version: 0.26.0
  • Context: Building Lotus v1.34.0-rc2 with FFI_BUILD_FROM_SOURCE=1

Error:

error[E0599]: no method named `raw_os_error` found for enum `std::fs::TryLockError` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bellperson-0.26.0/src/gpu/locks.rs:176:20
    |
176 |             if err.raw_os_error() == fs2::lock_contended_error().raw_os_error() {
    |                    ^^^^^^^^^^^^ method not found in `std::fs::TryLockError`
    |
note: the method `raw_os_error` exists on the type `std::io::Error`

Root Cause:

Rust 1.89.0 appears to have removed or changed the raw_os_error() method on std::fs::TryLockError, causing a compilation failure in src/gpu/locks.rs:176.

Workaround:

Downgrading to Rust 1.87.0 resolved the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions