Skip to content
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

building playground on the fly #4372

Merged
merged 1 commit into from
May 11, 2020
Merged

building playground on the fly #4372

merged 1 commit into from
May 11, 2020

Conversation

bobzhang
Copy link
Member

@bobzhang bobzhang commented May 11, 2020

we check in a bytecode version of jsoo.bc and call ocamlrun jsoo.bc, no external deps, lighting build on the ci

@anmonteiro
Copy link
Contributor

anmonteiro commented May 11, 2020

Note that running the .bc file directly doesn't work:

$ ~/Downloads/js_of_ocaml.bc --help
zsh: /Users/anmonteiro/Downloads/js_of_ocaml.bc: bad interpreter: /Users/hongbozhang/.opam/4.06.1/bin/ocamlrun: no such file or directory

This has to be prefixed with ocamlrun js_of_ocaml.bc on an OCaml 4.06 switch.

@bobzhang
Copy link
Member Author

bobzhang commented May 11, 2020 via email

@anmonteiro
Copy link
Contributor

anmonteiro commented May 11, 2020

Sorry, was just making a note in the PR documenting the edge case for running the bytecode file. I edited my message to provide more context (and your solution).

@ryyppy
Copy link
Member

ryyppy commented May 11, 2020

hmm, just running the whole playground building workflow as stated in the CONTRIBUTING file, and I am getting this:

BS_PLAYGROUND=../playground node scripts/repl.js          1 ↵
building byte code version of the compiler
>>>>>> running command: /Users/ryyppy/Projects/bucklescript/native/4.06.1/bin/ocamlc.opt -w -30-40 -no-check-prims -I /Users/ryyppy/Projects/bucklescript/lib/4.06.1/unstable /Users/ryyppy/Projects/bucklescript/lib/4.06.1/unstable/js_refmt_compiler.mli /Users/ryyppy/Projects/bucklescript/lib/4.06.1/unstable/js_refmt_compiler.ml -o jsc.byte
<<<<<<
building js version
>>>>>> running command: /Users/ryyppy/Projects/bucklescript/native/4.06.1/bin/ocamlrun /Users/ryyppy/Projects/bucklescript/vendor/js_of_ocaml.bc compile jsc.byte -o exports.js
/Users/ryyppy/Projects/bucklescript/vendor/js_of_ocaml.bc: Error: Config file not found - neither /Users/hongbozhang/.opam/4.06.1/lib/findlib.conf nor the directory /Users/hongbozhang/.opam/4.06.1/lib/findlib.conf.d
child_process.js:660
    throw err;
    ^

Error: Command failed: /Users/ryyppy/Projects/bucklescript/native/4.06.1/bin/ocamlrun /Users/ryyppy/Projects/bucklescript/vendor/js_of_ocaml.bc compile jsc.byte -o exports.js
    at checkExecSyncError (child_process.js:621:11)
    at Object.execSync (child_process.js:657:15)
    at e (/Users/ryyppy/Projects/bucklescript/scripts/repl.js:29:5)
    at prepare (/Users/ryyppy/Projects/bucklescript/scripts/repl.js:53:3)
    at Object.<anonymous> (/Users/ryyppy/Projects/bucklescript/scripts/repl.js:86:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 27778,
  stdout: null,
  stderr: null
}

Looks like there's some hardcoded paths somewhere in the .bc file?

To highlight the error from the logs above:

Error: Config file not found - neither /Users/hongbozhang/.opam/4.06.1/lib/findlib.conf nor the directory /Users/hongbozhang/.opam/4.06.1/lib/findlib.conf.d

@bobzhang
Copy link
Member Author

bobzhang commented May 11, 2020 via email

@bobzhang
Copy link
Member Author

@ryyppy can confirm findlib is invoked -- will test on fresh linux box , thanks for trying

@bobzhang
Copy link
Member Author

bobzhang commented May 11, 2020 via email

@ryyppy
Copy link
Member

ryyppy commented May 11, 2020

This worked on my machine

@bobzhang
Copy link
Member Author

bobzhang commented May 11, 2020 via email

@bobzhang
Copy link
Member Author

For people who want get a version of jsoo without depending on findlib, check this ocsigen/js_of_ocaml#966 for more details

@bobzhang bobzhang merged commit 8ad3126 into master May 11, 2020
@bobzhang bobzhang deleted the playground branch May 11, 2020 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants