Torna al blog

Rust 1.91.1: Patch Release Critica - Release Novembre 2025

Scopri Rust 1.91.1: fix WebAssembly cross-crate symbols, risoluzione file locking illumos, e correzioni critiche dalla 1.91.0 di novembre 2025.

Edoardo Midali

Edoardo Midali

Developer Β· Content Creator

5 min di lettura
Rust 1.91.1: Patch Release Critica - Release Novembre 2025

Rust 1.91.1 Γ¨ stato rilasciato il 10 novembre 2025. Questa patch release corregge due regressioni critiche introdotte nella 1.91.0: il fix WebAssembly cross-crate symbols e il ripristino del file locking su illumos. Update consigliato per tutti!

🎯 Fix Principali

WebAssembly Cross-Crate Symbols Fix

Risolto bug critico wasm_import_module attribute!

Il Problema (1.91.0)

// ❌ Rust 1.91.0 - BROKEN!

// crate A
#[link(wasm_import_module = "custom_env")]
extern "C" {
    fn external_function(x: i32) -> i32;
}

// crate B (depends on A)
pub fn use_external() {
    // ❌ Linker error o runtime crash!
    let result = external_function(42);
}

Cosa causava:

  • πŸ”΄ Linker errors durante compilazione cross-crate
  • πŸ”΄ Runtime crashes se linking riusciva
  • πŸ”΄ Data corruption da symbol mismatch

La Soluzione (1.91.1)

// βœ… Rust 1.91.1 - FIXED!

// crate A
#[link(wasm_import_module = "custom_env")]
extern "C" {
    fn external_function(x: i32) -> i32;
}

// crate B (depends on A)
pub fn use_external() {
    // βœ… Funziona correttamente!
    let result = external_function(42);
}

Background tecnico:

WebAssembly identifica symbols con doppia identificazione:

;; Symbol identification in Wasm
(import "module_name" "symbol_name" ...)
         ^^^^^^^^^^^   ^^^^^^^^^^^
         Wasm module   Symbol name

Differenza con altri targets:

Target Symbol ID Example
Linux/Mac/Windows Nome solo external_function
WebAssembly Modulo + Nome ("env", "external_function")

Il bug 1.91.0:

L'attributo #[link(wasm_import_module)] non propagava correttamente attraverso crate boundaries:

// Crate A definisce
#[link(wasm_import_module = "custom")]  // Module = "custom"

// Crate B riceveva
// Module = "env" (default errato!)  ❌

// Risultato: symbol mismatch β†’ linker error

illumos File Locking Fix

Ripristinato file locking per Cargo su illumos!

Il Problema (1.91.0)

# ❌ Cargo 1.91.0 su illumos
cargo build

# Internamente:
# File::lock() β†’ sempre Unsupported ❌
# Cargo β†’ nessun lock su target/ ❌
# Risultato: possibili race conditions! πŸ”΄

Conseguenze:

  • πŸ”΄ Concurrent builds potevano corrompere artifacts
  • πŸ”΄ Build instabili su illumos
  • πŸ”΄ Race conditions su shared filesystems

La Soluzione (1.91.1)

// βœ… Rust 1.91.1 - File::lock restored

use std::fs::File;

let file = File::create("lockfile")?;

// βœ… Su illumos ora funziona correttamente!
file.lock_exclusive()?;
// Fa il build
file.unlock()?;

Background tecnico:

Cargo 1.91.0 migration:

// Prima (custom code)
#[cfg(target_os = "illumos")]
fn lock_directory(path: &Path) -> Result<Lock> {
    // Custom OS API calls βœ…
}

// Dopo 1.91.0 (standard library)
fn lock_directory(path: &Path) -> Result<Lock> {
    let file = File::open(path)?;
    file.lock_exclusive()?;  // ❌ Sempre Unsupported su illumos!
    Ok(Lock { file })
}

Il bug: File::lock_exclusive() non era implementato correttamente per illumos!

// std/src/sys/unix/fs.rs (simplified)

#[cfg(target_os = "illumos")]
impl File {
    fn lock_exclusive(&self) -> io::Result<()> {
        // ❌ Rust 1.91.0
        Err(io::Error::new(io::ErrorKind::Unsupported, "not supported"))

        // βœ… Rust 1.91.1
        // Implementazione corretta con fcntl/flock
    }
}

Fix 1.91.1:

  • βœ… Implementata corretta chiamata fcntl() per illumos
  • βœ… File locking ora funzionale su filesystem supportati
  • βœ… Cargo puΓ² lockare target/ correttamente

πŸ“Š Context: Rust 1.91.0 Features

Per riferimento, le feature principali di 1.91.0 (30 Ottobre 2025):

aarch64-pc-windows-msvc β†’ Tier 1

# βœ… Pieno supporto Windows ARM64
rustup target add aarch64-pc-windows-msvc

# Garantiti:
# - Full test suite su ogni commit
# - Prebuilt binaries disponibili
# - Supporto production-ready

Dangling Raw Pointer Lint

// ⚠️ Warn by default
fn get_pointer() -> *const i32 {
    let x = 42;
    &x as *const i32  // ⚠️ Warning: returning pointer to local!
}

// βœ… Correct patterns
fn get_pointer_safe() -> *const i32 {
    Box::leak(Box::new(42)) as *const i32
}

static VALUE: i32 = 42;
fn get_static_pointer() -> *const i32 {
    &VALUE as *const i32
}

Stabilized APIs (1.91.0)

use std::path::Path;
use std::sync::atomic::{AtomicPtr, Ordering};

// Path absolute/normalize
let path = Path::new("./src/../main.rs");
let absolute = path.canonicalize()?;  // βœ… Stabilized

// Atomic pointer methods
let ptr = AtomicPtr::new(Box::leak(Box::new(42)));
let old = ptr.swap(std::ptr::null_mut(), Ordering::SeqCst);

// Integer methods
let n: i32 = -42;
let abs = n.unsigned_abs();  // βœ… Returns u32

πŸ”„ Upgrade

Installazione/Update

# Update esistente
rustup update stable

# Da zero
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Verifica versione
rustc --version
# rustc 1.91.1 (stable)

Migrazione da 1.91.0

# 1. Update Rust
rustup update stable

# 2. Clean e rebuild (risolve Wasm/illumos issues)
cargo clean
cargo build

# 3. Verifica fix Wasm (se usi Wasm target)
cargo build --target wasm32-unknown-unknown

# 4. Test completo
cargo test

Chi Deve Upgradare SUBITO

πŸ”΄ CRITICO - Upgrade immediato:

  • βœ… WebAssembly projects con cross-crate symbols
  • βœ… illumos users (Cargo builds instabili)
  • βœ… Progetti usando #[link(wasm_import_module)]

🟑 CONSIGLIATO:

  • βœ… Tutti i progetti Rust in production
  • βœ… CI/CD pipelines
  • βœ… Shared development environments

Testing Post-Upgrade

# Test Wasm fix
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen target/wasm32-unknown-unknown/release/my_crate.wasm

# Test illumos fix (su illumos)
cargo build -j 4  # Concurrent builds dovrebbero funzionare

# Integration tests
cargo test --workspace

πŸ’‘ Conclusioni

Rust 1.91.1 Γ¨ una patch release critica:

βœ… WebAssembly fix - Cross-crate symbols funzionanti βœ… illumos fix - File locking ripristinato βœ… Stability - Regressioni 1.91.0 risolte βœ… Production ready - Safe per deploy immediato βœ… Backward compatible - Drop-in replacement

Impatto:

Issue SeveritΓ  Impatto Fix
Wasm symbols πŸ”΄ CRITICO Linker errors, crashes βœ… Risolto
illumos locking πŸ”΄ CRITICO Build corruption βœ… Risolto

Timeline:

  • 30 Ottobre 2025: Rust 1.91.0 released (con bugs)
  • 10 Novembre 2025: Rust 1.91.1 released (fix critici)

Prossimi rilasci:

  • 11 Dicembre 2025: Rust 1.92.0 (scheduled)
  • 22 Gennaio 2026: Rust 1.93.0 (scheduled)

Action items:

# 1. Update NOW
rustup update stable

# 2. Rebuild projects
cargo clean && cargo build

# 3. Run tests
cargo test

# 4. Deploy with confidence! πŸš€