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

[internal] get the reason bspack build script working with esy #2153

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8f195cf
almost to jsoo
jaredly Aug 21, 2018
e660347
gettin it workin
jaredly Aug 21, 2018
1675c55
working with esy
jaredly Aug 21, 2018
79fa2cc
ignore
jaredly Aug 21, 2018
a9925c5
cleanup
jaredly Aug 21, 2018
d118601
more cleanup
jaredly Aug 21, 2018
b9f17a8
more cleanup
jaredly Aug 21, 2018
d4461ad
version default
jaredly Aug 21, 2018
9677c52
locks
jaredly Aug 21, 2018
5eb1090
vendor bspack
jaredly Aug 21, 2018
e876003
missed that too
jaredly Aug 22, 2018
a912b5e
cleanup
jaredly Aug 22, 2018
4c709b3
gnu sed
jaredly Aug 22, 2018
1aca9a2
fix version number
jaredly Sep 12, 2018
22a520c
Merge branch 'master' into joo. Conflicts: bspacks/reason_bspack.sh
jchavarri Nov 24, 2019
23d08c1
Add ppx_derivers to bspacks deps
jchavarri Nov 25, 2019
28e4c96
Fix paths to esy sandbox
jchavarri Nov 25, 2019
1d05e43
Native build passing
jchavarri Nov 25, 2019
7b335f1
Fix refmt_js api
jchavarri Nov 26, 2019
d667cb8
Merge pull request #2 from jchavarri/joo
jaredly Nov 27, 2019
e92ca99
quiet esy.lock
jaredly Nov 28, 2019
9c0248d
get bspack.ml from github
jchavarri Nov 28, 2019
74e623a
actually remove bspack and fix paths
jchavarri Nov 28, 2019
20a8f01
Merge pull request #3 from jchavarri/joo
jaredly Nov 30, 2019
6a8a441
Merge branch 'master' into joo
jaredly Dec 2, 2019
a56fc71
igonre output directory
jaredly Dec 2, 2019
5b79c17
use sandboxes! yay
jaredly Dec 2, 2019
b5d3aef
rm old
jaredly Dec 2, 2019
458baa1
Merge branch 'master' into joo
jaredly Dec 12, 2019
fd11d9d
simplify
jaredly Dec 12, 2019
654f582
generated
jaredly Dec 12, 2019
dbd1034
undo that
jaredly Dec 12, 2019
e3eec8a
do the prerelease thing
jaredly Dec 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
working with esy
  • Loading branch information
jaredly committed Aug 21, 2018
commit 1675c551d3fa0175ce6fcdb351e6ed4457587db4
16 changes: 9 additions & 7 deletions bspacks/reason_bspack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ 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; }
# command -v dune || { echo "Dune not found. If you're using esy, do 'esy ./reason_bspack.sh'"; exit 1; }

# 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"

menhirSuggestedLib=`menhir --suggest-menhirLib`
menhirSuggestedLib=`esy menhir --suggest-menhirLib`

esy build-env node_modules/@opam/ocaml-migrate-parsetree > _get_root
echo >> _get_root
Expand Down Expand Up @@ -66,7 +68,7 @@ ocamlMigrateParseTreeTargetDir=$THIS_SCRIPT_DIR/build/omp
if [ ! -f $THIS_SCRIPT_DIR/bspack.exe ]; then
echo "👉 building bspack.exe"
cd $THIS_SCRIPT_DIR/bin
ocamlopt -g -w -40-30-3 ./ext_basic_hash_stubs.c unix.cmxa ./bspack.ml -o ../bspack.exe
esy ocamlopt -g -w -40-30-3 ./ext_basic_hash_stubs.c unix.cmxa ./bspack.ml -o ../bspack.exe
cd -
fi

Expand Down Expand Up @@ -99,7 +101,7 @@ build_js_api () {

# the `-no-alias-deps` flag is important. Not sure why...
# remove warning 40 caused by ocaml-migrate-parsetree
ocamlc -g -no-alias-deps -w -40-3 -I +compiler-libs ocamlcommon.cma "$REFMT_API.ml" -o "$REFMT_API.byte"
esy ocamlc -g -no-alias-deps -w -40-3 -I +compiler-libs ocamlcommon.cma "$REFMT_API.ml" -o "$REFMT_API.byte"

# compile refmtJsApi as the final entry file
esy ocamlfind ocamlc -bin-annot -g -w -30-3-40 -package js_of_ocaml,ocaml-migrate-parsetree -o "$REFMT_API_ENTRY" -I $buildDir -c -impl ./refmtJsApi.ml
Expand Down Expand Up @@ -145,15 +147,15 @@ build_refmt () {

echo "👉 compiling refmt"
# build REFMT_BINARY into an actual binary too. For testing purposes at the end
ocamlc -g -no-alias-deps -w -40-3 -I +compiler-libs ocamlcommon.cma "$REFMT_BINARY.ml" -o "$REFMT_BINARY.byte"
esy ocamlc -g -no-alias-deps -w -40-3 -I +compiler-libs ocamlcommon.cma "$REFMT_BINARY.ml" -o "$REFMT_BINARY.byte"
echo "👉 opt compiling refmt"
ocamlopt -g -no-alias-deps -w -40-3 -I +compiler-libs ocamlcommon.cmxa "$REFMT_BINARY.ml" -o "$REFMT_BINARY.exe"
esy ocamlopt -g -no-alias-deps -w -40-3 -I +compiler-libs ocamlcommon.cmxa "$REFMT_BINARY.ml" -o "$REFMT_BINARY.exe"

# small integration test to check that the process went well
# for the native binary
echo "let f = (a) => 1" | "$REFMT_BINARY.byte" --parse re --print ml
echo "✅ finished building refmt binary"
}

# build_refmt
build_refmt
build_js_api