Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Build-test fixtures that no longer test what they claim

Đang mở Phù hợp với người mới
#8,827 0 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

@cknitt đang làm issue này rồi.

Từ ngày 12/10/2026.

  • #8838 của @cknitt — đang mở

Đá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
78/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ệ
javascript, node.js, ocaml
Lĩnh vực
testing

Hướng nghiên cứu

Đọc tests/build_tests/rescript_tools_binary_path/input.js và cấu hình fixture của nó, sau đó kiểm tra các tệp rescript.json của weird_deps và weird_devdeps. Thêm một package.json fixture cho rescript_tools_binary_path và đặt sources của các fixture còn lại thành danh sách rỗng. Công việc hoàn tất khi các fixture kiểm tra hành vi import package như dự định và không còn liệt kê các thư mục mã nguồn đã bị xóa.

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

Mô tả

Found by adversarial experiments on semantic analysts.

Each item below is a build-test fixture whose setup no longer matches its purpose.

  • rescript_tools_binary_path passes with the import it guards against.
    • input.js runs the compiled src/Main.mjs and src/Main.cjs inside the repository.
    • The fixture has no package.json, so Node resolves # specifiers in those files against the repository root package.json, which defines #cli/*.
    • The bug fixed by #8694 (@module("#cli/bins") emitted into user code) therefore does not reproduce here. The commit message of 45446347c says the test uses its own package.json, but none is checked in.
    • Reproduction at 8d51b9ce7 in tests/build_tests/rescript_tools_binary_path, with node_modules/rescript linked to the repo root as input.js does. The two files contain the JS that bsc emits for the pre-#8694 external:
      printf 'import * as Bins from "#cli/bins";\nconsole.log(Bins.rescript_tools_exe);\n' > src/Old.mjs
      printf 'let Bins = require("#cli/bins");\nconsole.log(Bins.rescript_tools_exe);\n' > src/Old.cjs
      node src/Old.mjs; node src/Old.cjs   # both print …/bin/rescript-tools.exe
      echo '{"name":"user-project","private":true}' > package.json
      node src/Old.mjs   # ERR_PACKAGE_IMPORT_NOT_DEFINED
      node src/Old.cjs   # Error: Cannot find module '#cli/bins'
      
    • With that package.json in place, the current Main.mjs and Main.cjs (importing rescript/tools) still print the binary path.
    • Fix: check in a fixture package.json.
  • weird_deps and weird_devdeps list deleted source folders.
Ngôn ngữ chính
OCaml
Star
7.5k
Fork
484
Merge trung bình
18 giờ 19 phút
Pull request đã merge (30 ngày)
116

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 rescript-lang/rescript

Tất cả issue của rescript-lang/rescript

Issue tương tự

Thêm issue về Testing & QA

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.