Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Build-test fixtures that no longer test what they claim

Aperta Adatta ai principianti
#8,827 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@cknitt ci sta già lavorando.

Dal 12/10/2026.

  • #8838 di @cknitt — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js, ocaml
Ambito
testing

Direzione di ricerca

Leggi tests/build_tests/rescript_tools_binary_path/input.js e la configurazione delle relative fixture, poi esamina i file rescript.json di weird_deps e weird_devdeps. Aggiungi un package.json di fixture per rescript_tools_binary_path e imposta le sources delle altre fixture su un elenco vuoto. Il lavoro è completato quando le fixture verificano il comportamento previsto per l’importazione dei package e non elencano più cartelle sorgente eliminate.

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

Descrizione

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.
Lingua principale
OCaml
Stelle
7.5k
Fork
484
Merge medio
18h 19m
PR unite (30g)
116

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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

Tutte le issue di rescript-lang/rescript

Issue simili

Altre issue su Testing & QA

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.