apply_patch_toml.sh: reverse-check probe prints 'patch does not apply' errors on every fresh configure

Offen Anfängerfreundlich
#356 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 5 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
88/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Ruhig
Tech-Stack
cmake, git, shell
Bereich
build-system

Rechercherichtung

Öffne cmake/patches/apply_patch_toml.sh und überprüfe, wie dort festgestellt wird, ob der tomlplusplus-Patch bereits angewendet wurde; lies außerdem die zugehörige Guard in cmake/toml.cmake. Führe eine frische Konfiguration und anschließend eine zweite Konfiguration aus, um zu verifizieren, dass der Patch ohne Probe-Fehler angewendet wird, idempotent bleibt und weiterhin echte Fehler beim Anwenden meldet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

cmake/patches/apply_patch_toml.sh prints four error: lines on every fresh configure, even though everything works correctly:

[ 44%] Performing patch step for 'tomlplusplus-populate'
error: patch failed: include/toml++/impl/make_node.h:134
error: include/toml++/impl/make_node.h: patch does not apply
error: patch failed: CMakeLists.txt:31
error: CMakeLists.txt: patch does not apply
Cause

The script answers the question "was the patch already applied?" by attempting a reverse apply:

if ! git apply -R --ignore-whitespace ${TOML_PATCH} --check; then git apply --ignore-whitespace ${TOML_PATCH}; fi

git apply -R --check fails loudly when the patch is not yet applied — which is the normal case on every fresh FetchContent clone. The errors come from the probe, not from the actual application (which succeeds silently right after). Downstream consumers see scary patch does not apply errors in otherwise green build logs (we hit this building RediSearch → VectorSimilarity → SVS, and spent time confirming the patch was in fact applied).

Suggested fix

Probe the state instead of reverse-applying — the TOMLPLUSPLUS_INSTALL option that the patch itself adds to CMakeLists.txt is proof of appliedness:

if ! grep -q TOMLPLUSPLUS_INSTALL CMakeLists.txt; then git apply --ignore-whitespace ${TOML_PATCH}; fi
  • Same idempotence for CMake re-configures (the case the script guards against, per the comment in cmake/toml.cmake).
  • Nothing is silenced: the real git apply keeps its stderr, so a genuinely failing patch still surfaces.
  • Verified against a fresh marzer/tomlplusplus clone at v3.3.0: first run applies the patch with zero output, second run skips with zero output.

Happy to open a PR if you'd take one.

Vorherrschende Sprache
C++
Sterne
241
Forks
48
Ø Merge
4 T. 21 Std.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus intel/ScalableVectorSearch

Alle Issues in intel/ScalableVectorSearch

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.