Offload: a 'run' job reports PASS when its command failed (and the README's $BLD/b path does not exist)

Offen Anfängerfreundlich
#1,347 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
76/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
bash, shell
Bereich
build-system, cli

Rechercherichtung

Beginnen Sie mit tools/offload/run-offload.sh und der README-Befehlstabelle, die den run-Job und dessen Build-Tree-Pfad beschreibt. Reproduzieren Sie das gemeldete Verhalten mit einem Befehl, dessen früher Pipeline-Schritt fehlschlägt, und sorgen Sie dann dafür, dass run den Fehlerstatus des vollständigen Befehls weitergibt und den fehlgeschlagenen Befehl identifiziert. Fertig bedeutet, dass das Beispiel nicht mehr PASS ausgibt oder mit 0 beendet wird und der dokumentierte Build-Pfad mit dem von run verwendeten Pfad übereinstimmt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

tools/offload/run-offload.sh ... run <cmd> reports PASS and exits 0 when
the command it ran failed.

Seen today building a package on beryllium:

run bash -c 'cd $BLD/b && cpack -G DEB 2>&1 | tail -5; ls -lh *.deb | tail -5'

bash: line 1: cd: /home/andy/ecce-offload/build/main/b: No such file or directory
ls: cannot access '*.deb': No such file or directory
PASS: run bash -c ... on main (8825ee3dda) exit 0, 1470s

Nothing was built, and the job reported success.

Two causes, and the second is the one that matters:

  1. The README's command table says the build tree is $BLD/b. For a run
    job it is $BLD/bi, the same tree ctesti uses. Either the README or the
    variable should change; the path in the docs does not exist.
  2. run takes its status from the last command of the pipeline rather than
    from the whole command, so an early failure is invisible. Here cd
    failed, cpack never ran, ls failed, and the job still exited 0.

This is the same shape as #1301 (a ctest -R matching no test exiting 0) and
#1309: a step that did nothing reports success. An offload run is used for
measurement sweeps and packaging, where "it printed PASS" is often the only
thing anyone looks at.

Suggested: run should use set -o pipefail and fail on any non-zero status
in the command it was given, and say which command failed. A run whose
command produced no output at all is also worth failing, as #1309 does for
test scripts.

Vorherrschende Sprache
C
Sterne
10
Forks
8
Ø Merge
6 Std. 32 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

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 FriendsofECCE/ECCE

Alle Issues in FriendsofECCE/ECCE

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

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