Canonical: https://www.startearly.ai/case-files/conan/replace-in-file-no-op/
Updated: 2026-11-14

# Conan replace_in_file Regression Case File | Early

## The pattern was present. The build still failed.

Regression Case File

Conan, the open-source C/C++ package manager maintained by JFrog, could reject a valid no-op file replacement as missing in 2.31.0. One release was affected before 2.31.1 restored the helper's documented behavior.

## Release

**Baseline:** 2.30.0

**Baseline Date:** 2026-06-29

**Introduced:** 2.31.0

**Introduced Date:** 2026-07-23

**Last Affected:** 2.31.0

**Restored:** 2.31.1

**Restored Date:** 2026-07-24

**Affected Release Count:** 1

### Public report

Reported by: User. Recorded report delay: 19 hours.

**Approximate:** true

Recorded fix delay: 20 hours.

**Approximate:** true

## Regression

The pattern was present.

Conan reported it missing.

Valid no-op replacements could stop builds.

**Changed:** replace_in_file() started treating unchanged output as proof that no pattern matched. A valid no-op substitution left the file unchanged, so strict mode raised a false not-found exception. Conan 2.31.1 restored separate foundness checks: literal search presence and regular expression match count.

**Relationship:** Conan recipe → replace_in_file() → strict foundness check → build result

The new predicate measured content difference instead of pattern presence.

## Replay

The recorded historical analysis compared 2.30.0 with 2.31.0.

The run reported **8 Expected** and **1 Regression** findings.

“Expected” means behavior Early classified as expected, not the number of bugs it expected to find. “Regression” identifies behavior classified as a defect relative to the baseline. These labels describe this run; the counts are not recall or accuracy measurements. The verification evidence below establishes which defects were corroborated.

**Finding Title:** replace_in_file misreports no-op replace as not-found

**Finding Summary:** Early traced the false build failure to the changed foundness predicate and proposed the decisive no-op verification. The reproduction passed on 2.30.0, failed on 2.31.0, and passed again on 2.31.1.

The actual Regression finding from the Early product.

### Public Report

[Public issue #20212](https://github.com/conan-io/conan/issues/20212)

### Introducing Change

[Introducing PR #20194](https://github.com/conan-io/conan/pull/20194)

### Upstream fix

[Upstream fix PR #20211](https://github.com/conan-io/conan/pull/20211)

**Disclosure:** Independent replay of a public Conan release. Conan and JFrog did not participate.

[Technical article](https://www.startearly.ai/post/conan-replace-in-file-regression-release-replay/)

## Source and next step

[Read the canonical page and its evidence](https://www.startearly.ai/case-files/conan/replace-in-file-no-op/).
