Playground: `exit of N` returns rc 1 from eigs_run_source instead of N

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

Maintainer thường phản hồi trong vòng 1 ngày

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
62/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ệ
c, wasm
Lĩnh vực
cli

Hướng nghiên cứu

Giá trị trả về được tính trong eigs_run_source trong web/eigs_wasm.c, hàm này trả về g_has_error ? 1 : 0 mà không đọc g_exit_code. Hãy bắt đầu từ đó và kiểm tra cách exit of N đặt g_exit_code. Công việc hoàn thành khi exit of 3 trả về 3, exit of 0 trả về 0, lỗi lúc chạy vẫn trả về 1, và dòng exit of 3 trong tests/test_playground_wasm_2301.sh cố định giá trị thay vì chấp nhận null.

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

Mô tả

needs-triage

Found while fixing #2301 (PR #2302, hq#58 ES-OWF-1).

Problem

In the browser playground, exit of N does not propagate N. eigs_run_source (web/eigs_wasm.c) returns g_has_error ? 1 : 0 and never reads g_exit_code, so:

program CLI exit status playground eigs_run_source rc
exit of 3 3 1
exit of 0 0 not pinned (expected 0)

(rc 1 measured on a real emcc 3.1.74 build in PR #2302's CI.) The playground cannot distinguish exit of 3 from a runtime error. tests/test_playground_wasm_2301.sh accepts any number for this row (wantRc null), so nothing pins the value.

Done when

  • eigs_run_source("exit of 3") returns 3, and eigs_run_source("exit of 0") returns 0, in a real emcc build of web/build.sh.
  • A runtime error still returns 1, and a plain run after any of these in the same module still returns 0 with its output.
  • The exit of 3 row in the playground test pins the rc (no null wildcard). The test runs in pages.yml before the receipt and goes red on the current g_has_error ? 1 : 0 return.
  • web/app.js shows the exit code if the UI surfaces rc. If it does not, the PR says so.

Generated by Claude Code

Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
6 giờ 21 phút
Pull request đã merge (30 ngày)
323

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

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.