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

Đang mở Phù hợp với người mới
#1,347 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, shell
Lĩnh vực
build-system, cli

Hướng nghiên cứu

Bắt đầu với tools/offload/run-offload.sh và bảng lệnh trong README mô tả job run cùng đường dẫn cây build của nó. Tái hiện hành vi được báo cáo bằng một lệnh có bước đầu tiên của pipeline thất bại, sau đó để run truyền tiếp trạng thái lỗi của toàn bộ lệnh và xác định lệnh đã thất bại. Hoàn tất nghĩa là ví dụ không còn in PASS hoặc thoát với mã 0, và đường dẫn build được ghi trong tài liệu khớp với đường dẫn được run sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C
Star
10
Fork
8
Merge trung bình
6 giờ 32 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FriendsofECCE/ECCE

Tất cả issue của FriendsofECCE/ECCE

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.