-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix playground build infra w/ ReScript 11 #6201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! 🎉
I get errors with: make playground-cmijs
<<<<<<
>>>>>> running command: find /Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/node_modules/rescript/lib/ocaml -name "*.cmi" -or -name "*.cmj" | xargs -n1 basename | xargs js_of_ocaml build-fs -o /Users/cristianocalcagno/GitHub/rescript-compiler/playground/packages/compilerCmij.js -I /Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/node_modules/rescript/lib/ocaml
<<<<<<
>>>>>> running command: find /Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/node_modules/@rescript/react/lib/es6 -name '*.js' -exec cp {} /Users/cristianocalcagno/GitHub/rescript-compiler/playground/packages/@rescript/react \;
find: /Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/node_modules/@rescript/react/lib/es6: No such file or directory
node:child_process:960
throw err;
^
Error: Command failed: find /Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/node_modules/@rescript/react/lib/es6 -name '*.js' -exec cp {} /Users/cristianocalcagno/GitHub/rescript-compiler/playground/packages/@rescript/react \;
at checkExecSyncError (node:child_process:885:11)
at Object.execSync (node:child_process:957:15)
at e (/Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/scripts/generate_cmijs.js:45:17)
at installLib (/Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/scripts/generate_cmijs.js:100:5)
at Array.forEach (<anonymous>)
at buildThirdPartyCmijs (/Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/scripts/generate_cmijs.js:73:12)
at Object.<anonymous> (/Users/cristianocalcagno/GitHub/rescript-compiler/packages/playground-bundling/scripts/generate_cmijs.js:108:1)
at Module._compile (node:internal/modules/cjs/loader:1205:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1259:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 67434,
stdout: null,
stderr: null
}
|
@cristianoc Found the issue. Could you try again and see if it works on your machine? |
Works. There are a few warnings. These jump to the eye:
I guess they might be jsoo warnings. And probably does not matter. |
The location information does not exactly help. |
To please CI: npm run format |
These warnings only occur when building with jsoo, and they have been there "forever" (before moving to the dune-based build setup). |
Yes, in fact I actually find these errors useful to know that jsoo actually did its work. I will still need to adapt the compiled files to uncurried mode. |
3792080
to
889fa49
Compare
337c12d
to
f262f1f
Compare
Force-pushed to latest master. There's still some issue when trying to compile |
I stumbled upon this while testing, and it seems to cause a stack overflow error if there is an unused value. If I replace it with this, I don't get the error. let _ = React.useState(_ => 0) |
The issue was caused by the overloaded warning printer logic. Fixed in f75fbf0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks a lot! ❤️
Go for it. |
…core functionality
Co-authored-by: Christoph Knittel <ck@cca.io>
…h script to make it work with rescript-lang.org
… to endless recursion
…rter usage after rebasing to latest main
1cb750c
to
ed711f8
Compare
Re-based onto master again and adjusted the code to use the adapted error reporter. Ready to be merged now. |
Fixes #6200
Key changes:
generate_cmij.js
script to also build acompiler-builtins/cmij.js
file from the ReScriptlib/ocaml
modules (otherwise the playground can't compile any ReScript programs due to missing core modules likePervasives
)@rescript/core
as a pre-vendored packageMakefile
targetsjsoo_main.ml
/jsoo_common
infra (and usejs_of_ocaml
as a library instead)There's quite some potential making the playground e2e tests more rigorous by re-using existing compiler tests and passing them to the JSOOified compiler APIs as strings.