Skip to content

Commit

Permalink
chore(compiler)!: Avoid building JS bundles by default (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 18, 2021
1 parent 9393519 commit 2925fb8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ jobs:
yarn compiler import-dependencies
shx rm -rf compiler/_export
# Don't build grainc.exe, only the JS builds
# TODO(#589): Actually build the exe's these once users can install them locally
- name: Build compiler
run: |
yarn compiler build
# To avoid bundling the wrong grainc.exe for the platform
# TODO(#589): Actually bundle these once users can install them locally
- name: Remove grainc.exe
run: |
shx rm cli/bin/grainc.exe
yarn compiler build:js
# This will log a warning because we removed the grainc.exe file
- name: Build Binaries
Expand Down
2 changes: 1 addition & 1 deletion compiler/dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.0)
(lang dune 2.3)
(name grain)
(version 0.3.2)

Expand Down
3 changes: 2 additions & 1 deletion compiler/esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
}
},
"scripts": {
"copy-compiler": "cp #{$GRAINC_BIN_PATH} #{$GRAINC_JS_PATH} #{$CLI_BIN_DIR}",
"copy:exe": "cp #{$GRAINC_BIN_PATH} #{$CLI_BIN_DIR}",
"copy:js": "cp #{$GRAINC_JS_PATH} #{$CLI_BIN_DIR}",
"clean": "rm -rf #{self.root}/_esy",
"test": "#{$TEST_EXEC_PATH}",
"format": "dune build @fmt --auto-promote",
Expand Down
4 changes: 4 additions & 0 deletions compiler/grainc/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(executable
(enabled_if
(<> %{profile} jsoo))
(name grainc)
(public_name grainc)
(package grain)
Expand All @@ -20,6 +22,8 @@
(cat %{dep:grainc.re})))))

(executable
(enabled_if
(= %{profile} jsoo))
(name grainc_js)
(public_name grainc_js)
(package grainc)
Expand Down
4 changes: 3 additions & 1 deletion compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"clean": "esy clean",
"prepare": "esy install",
"build": "esy",
"postbuild": "esy copy-compiler",
"postbuild": "esy copy:exe",
"build:js": "esy b dune build --no-buffer --profile jsoo",
"postbuild:js": "esy copy:js",
"pretest": "esy",
"test": "esy test",
"format": "esy format",
Expand Down

0 comments on commit 2925fb8

Please sign in to comment.