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
[internal] get the reason bspack build script working with esy #2153
base: master
Are you sure you want to change the base?
Conversation
src/refmt/package.ml
Outdated
let version = "3.3.3" | ||
let git_version = "fefe5e4db3a54a7946c2220ee037dd2f407011c9" | ||
let git_short_version = "fefe5e4d" | ||
let version = "4.4.5" |
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.
This version seems interesting 😄
bspacks/esy.json
Outdated
"build": [ | ||
["echo", "No-op"] | ||
], | ||
"_dependenciesForNewEsyInstaller": { |
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.
This shouldn't be needed. Was it? It was just a hack for some special cased packages to make sure some old projects will continue to install correctly. It no longer applies.
bspacks/esy.json
Outdated
"@opam/menhir": " >= 20170418.0.0 <= 20171013.0.0", | ||
"@opam/ocaml-migrate-parsetree": "*" | ||
}, | ||
"peerDependencies": { |
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.
peerDependencies are now no longer needed. The constraint solver fixed that ;)
bspacks/reason_bspack.sh
Outdated
cd $THIS_SCRIPT_DIR | ||
|
||
# Install & build menhir, omp | ||
esy i |
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.
<3
I had the same idea a while ago (to automate the CI via esy). Glad you're doing it.
bspacks/reason_bspack.sh
Outdated
# rebuild the project in case it was stale | ||
cd .. | ||
# We need 4.02 for js_of_ocaml (it has a stack overflow otherwise :/) | ||
sed -i '' 's/"ocaml": "~4.6.0"/"ocaml": "~4.2.3004"/' ./esy.json |
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.
I can see why you wanted the sandboxes feature. It's unfortunate you had to destroy the esy.json file.
bspacks/reason_bspack.sh
Outdated
cd .. | ||
# We need 4.02 for js_of_ocaml (it has a stack overflow otherwise :/) | ||
sed -i '' 's/"ocaml": "~4.6.0"/"ocaml": "~4.2.3004"/' ./esy.json | ||
make pre_release |
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.
I think you want to do something like version=<VERSION> make pre_release
. Probably want to read it out of the esy.json
file's version field.
bspacks/reason_bspack.sh
Outdated
get_omp () { | ||
mkdir $ocamlMigrateParseTreeTargetDir | ||
|
||
esy build-env node_modules/@opam/ocaml-migrate-parsetree > _get_root |
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.
In the latest esy you can make esy.json
"scripts" entries which give you access to variables such as #{ocaml-migrate-parsetree.build}
.
You can then run them via esy script-name
bspacks/reason_bspack.sh
Outdated
cd $THIS_SCRIPT_DIR | ||
|
||
# Install & build menhir, omp | ||
esy i |
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.
Isn't
esy install
esy build
the same as just esy
now? But I maybe we want it more explicit?
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.
Yes. However, we might find some issues with the esy=esy i && esy b
shortcut so it's good to be explicit in case it changes.
Ready to have this merged? |
I think I have a different sed:
I recall installing gnu-sed because the macOS sed is old. What to do here? This might fail CI |
When using |
@jaredly hold on, you make refmt work with bsc. Maybe the sed can be dropped altogether? |
@chenglou I changed set to use gnu format. |
On newest Esy: ❯ version=3.4.5 ./reason_bspack.sh
info esy install 0.2.6
info esy build 0.2.6
info found esy manifests: esy.json
esy: error, exiting...
invalid dependency @opam/ocaml: unable to resolve package
processing package: get-js-of-ocaml@xxx
processing package: @opam/base-ocamlbuild@base |
Trying this again. I got:
|
That means it's finding the wrong version of menhir :/ I'll take a look. |
I picked up from @jaredly's branch, and updated with latest master: https://github.com/jchavarri/reason/tree/joo. Feel free to incorporate it to this PR if it's useful. Most relevant changes:
I am blocked on one more error though, it seems the new build config for
What'd be the change needed to produce a |
Managed to fix the menhir issue, there were more paths that had to be migrated from So both refmt binary and refmt js api seem to be building ok now 🎉 Fixed some issues with omp modules being generated by bspack like Also, updated refmt js api to the latest breaking changes after Same branch: https://github.com/jchavarri/reason/tree/joo |
Bring in jchavarri's changes
@jaredly Added another small change so that the script gets bspack.ml from BS github repo: jaredly#3. Some future tasks could be:
As far as I can tell though, this is ready to merge. |
bspack: download bspack.ml from github
@jchavarri ok I added sandboxes, so now this script works with both 4.02 and 4.06! Very clean |
I opened this PR against bucklescript which should allow us to use bspack from upstream instead of vendoring it. |
Ok @jordwalke @ulrikstrid @jchavarri I think this is good to go! |
What is stopping this from going in? Seems like something that would be nice since the community wants to upstream reason changes into bucklescript more frequently |
This basically means all you need is to clone the repo and do
cd bspacks; ./bspack.js
and it will All Work™I think this is a much smoother workflow... lmk if there's anything I haven't thought of though.
(this is motivated in part by the desire to make reason releases easier to do)