-
Notifications
You must be signed in to change notification settings - Fork 428
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
Changes from 1 commit
8f195cf
e660347
1675c55
79fa2cc
a9925c5
d118601
b9f17a8
d4461ad
9677c52
5eb1090
e876003
a912b5e
4c709b3
1aca9a2
22a520c
23d08c1
28e4c96
1d05e43
7b335f1
d667cb8
e92ca99
9c0248d
74e623a
20a8f01
6a8a441
a56fc71
5b79c17
b5d3aef
458baa1
fd11d9d
654f582
dbd1034
e3eec8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,14 @@ set -e | |
# this script does 2 independent things: | ||
# - pack the whole repo into a single refmt file for vendoring into bucklescript | ||
# - generate the js version of refmt for web usage | ||
esy i | ||
esy b | ||
|
||
THIS_SCRIPT_DIR="$(cd "$( dirname "$0" )" && pwd)" | ||
|
||
# command -v dune || { echo "Dune not found. If you're using esy, do 'esy ./reason_bspack.sh'"; exit 1; } | ||
cd $THIS_SCRIPT_DIR | ||
|
||
esy i | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't
the same as just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. However, we might find some issues with the |
||
esy b | ||
|
||
# echo "**This script is switching you to ocaml 4.02.3 for the subsequent bspacking. Please switch back to your own version afterward. Thanks!**\n" | ||
# opam switch 4.02.3 | ||
# eval $(opam config env) | ||
# Because OCaml 4.02 doesn't come with the `Result` module, it also needed stubbing out. | ||
resultStub="module Result = struct type ('a, 'b) result = Ok of 'a | Error of 'b end open Result" | ||
|
||
|
@@ -22,8 +20,6 @@ menhirSuggestedLib=`esy menhir --suggest-menhirLib` | |
esy build-env node_modules/@opam/ocaml-migrate-parsetree > _get_root | ||
echo >> _get_root | ||
echo 'echo $cur__root' >> _get_root | ||
# generated from the script ./downloadSomeDependencies.sh | ||
# ocamlMigrateParseTreeTargetDir="$THIS_SCRIPT_DIR/ocaml-migrate-parsetree/_build/default/src" | ||
ocamlMigrateParseTreeTargetDir=`cat _get_root | bash`/_build/default/src | ||
rm _get_root | ||
|
||
|
@@ -44,9 +40,10 @@ rm -rf $buildDir | |
mkdir $buildDir | ||
|
||
pushd $THIS_SCRIPT_DIR | ||
# rebuild the project in case it was stale | ||
|
||
# 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 | ||
make pre_release | ||
esy install | ||
|
@@ -64,7 +61,7 @@ mv $i ${target} | |
done; | ||
ocamlMigrateParseTreeTargetDir=$THIS_SCRIPT_DIR/build/omp | ||
|
||
# Build ourselves a bspack.exe | ||
# Build ourselves a bspack.exe if we haven't yet | ||
if [ ! -f $THIS_SCRIPT_DIR/bspack.exe ]; then | ||
echo "👉 building bspack.exe" | ||
cd $THIS_SCRIPT_DIR/bin | ||
|
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.