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

Aperta Adatta ai principianti
#1,347 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, shell
Ambito
build-system, cli

Direzione di ricerca

Inizia da tools/offload/run-offload.sh e dalla tabella dei comandi del README che descrive il job run e il relativo percorso dell’albero di build. Riproduci il comportamento segnalato con un comando in cui fallisce una fase iniziale della pipeline, poi fai in modo che run propaghi lo stato di errore dell’intero comando e identifichi il comando fallito. Il lavoro è completo quando l’esempio non stampa più PASS né termina con 0 e il percorso di build documentato corrisponde a quello usato da run.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C
Stelle
10
Fork
8
Merge medio
6h 32m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FriendsofECCE/ECCE

Tutte le issue di FriendsofECCE/ECCE

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.