From 5700ea48615aa10f438a60979720c1d2e8f3782b Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Thu, 13 Aug 2020 13:13:28 +0200 Subject: [PATCH 1/5] rebase rescript-lang/ocaml --- 4061.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4061.json b/4061.json index b5dfd6c8f5..eba84d43d9 100644 --- a/4061.json +++ b/4061.json @@ -2,7 +2,7 @@ "source": "./esy.json", "override": { "resolutions": { - "ocaml": "ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b" + "ocaml": "Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57" } } } From ed5f5cb3253a3dcc1452658a1d1bea9358dc8afb Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Thu, 13 Aug 2020 15:15:38 +0200 Subject: [PATCH 2/5] fix native_ocaml_path for esy. --- scripts/ninja.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ninja.js b/scripts/ninja.js index bded5701e1..312bbd4d2d 100755 --- a/scripts/ninja.js +++ b/scripts/ninja.js @@ -1415,6 +1415,10 @@ build all: phony runtime others $stdlib test ` ); } else { + // ASK: should I change something in the other branch ? + // ASK: Do you want a less destructive way by generating a .ninja file to include + const snapshot_ninja = fs.readFileSync(path.join(jscompDir, "snapshot.ninja"), "utf8"); + fs.writeFileSync(path.join(jscompDir, "snapshot.ninja"), snapshot_ninja.replace(/^native_ocaml_path.*/m, "native_ocaml_path = " + (process.env.ESY === "true" ? path.join(process.env.OCAMLLIB, "/../..") : "../ocaml/")), "utf8"); writeFileAscii( path.join(jscompDir, "build.ninja"), ` From 4e389d06b7947839dcdb354fef36db2a57412e9a Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sat, 15 Aug 2020 18:31:24 +0200 Subject: [PATCH 3/5] git remote add hello https://github.com/esy-ocaml/hello-reason; git fetch hello; git checkout hello/master -- .github --- .github/workflows/build.yml | 77 ++++++++++++++++++++++++++++ .github/workflows/print_esy_cache.js | 14 +++++ 2 files changed, 91 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/print_esy_cache.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..1ff6fa2925 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/setup-node@v1.4.2 + with: + node-version: 12 + - uses: actions/checkout@v2.2.0 + - name: Install esy + run: npm install -g esy + + - name: Try to restore install cache + uses: actions/cache@v2 + with: + path: ~/.esy/source + key: source-${{ hashFiles('**/index.json') }} + + - name: Install + run: esy install + + - name: Print esy cache + uses: actions/github-script@v2 + id: print_esy_cache + with: + script: | + const path = require('path') + const scriptPath = path.resolve('.github/workflows/print_esy_cache.js') + require(scriptPath)(core) + + - name: Try to restore build cache + id: deps-cache + uses: actions/cache@v2 + with: + path: ${{ steps.print_esy_cache.outputs.esy_cache }} + key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }} + restore-keys: build-${{ matrix.os }}- + + # Here we use a low-level. In real situation you don't have to + # but it is useful in CI as it split the log in GitHub UI. + # You can see at a glance if it is your projet or your deps that break. + # + # We also use --release flag to build less. + # This allow us to spo syntax/type error more quickly. + - name: Build release dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' + run: esy build-dependencies --release + + - name: Build project in release + run: esy build --release + + # Now that our core project build let builds others deps + - name: Build dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' + run: esy build-dependencies + + - name: Build project + run: esy build + + # Here we cleanup if we have a cache fail because we use restore-keys. + # restore-keys take the old store even on cache fail. + # So, we have deps we don't care anymore. We prune them. + - name: Clean global store + if: steps.deps-cache.outputs.cache-hit != 'true' + run: esy cleanup . + + - name: Test + run: esy test + + - name: Build docs + run: esy doc diff --git a/.github/workflows/print_esy_cache.js b/.github/workflows/print_esy_cache.js new file mode 100644 index 0000000000..a1498fe5db --- /dev/null +++ b/.github/workflows/print_esy_cache.js @@ -0,0 +1,14 @@ +const fs = require("fs"); +const os = require("os"); +const path = require("path"); + +const ESY_FOLDER = process.env.ESY__PREFIX + ? process.env.ESY__PREFIX + : path.join(os.homedir(), ".esy"); +const esy3 = fs + .readdirSync(ESY_FOLDER) + .filter(name => name.length > 0 && name[0] === "3") + .sort() + .pop(); +module.exports = exports = core => + core.setOutput('esy_cache', path.join(ESY_FOLDER, esy3, "i")); From fee2534f5e9ee2f5ad8300f86aa3ea5d8efca57e Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sat, 15 Aug 2020 18:32:45 +0200 Subject: [PATCH 4/5] fix: update json files. --- 4061.json | 8 -------- esy.json | 7 ++++--- esy.lock/index.json | 14 +++++++------- 3 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 4061.json diff --git a/4061.json b/4061.json deleted file mode 100644 index eba84d43d9..0000000000 --- a/4061.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "source": "./esy.json", - "override": { - "resolutions": { - "ocaml": "Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57" - } - } -} diff --git a/esy.json b/esy.json index 42db6276a1..a1fff09e6d 100644 --- a/esy.json +++ b/esy.json @@ -1,6 +1,6 @@ { "name": "bs-platform", - "version": "7.2.0", + "version": "8.3.0-dev.2", "dependencies": { "ocaml": "4.6.1000+BS" }, @@ -8,13 +8,14 @@ "ocaml": "4.6.1000+BS" }, "resolutions": { - "ocaml": "bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400" + "ocaml": "Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57" }, "scripts": { + "doc": "echo here we can generate doc for rescript-lang and push", + "test": "echo here we can actually test the binary work maybe with bsc -e 'code'", "clean": "node ./scripts/ninja.js clean" }, "esy": { - "buildsInSource": true, "build": [ ["node", "./scripts/install.js"], ["cp", "-r", "-f", "#{self.root / 'bsconfig.json'}", "#{self.install}"], diff --git a/esy.lock/index.json b/esy.lock/index.json index f609241030..b485fbb55a 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,17 +1,17 @@ { - "checksum": "3c8b1af980087634890b5cb0aea5b450", + "checksum": "8dea6b83c2d82cbe9271b3aa8aa6ca2a", "root": "bs-platform@link-dev:./esy.json", "node": { - "ocaml@github:bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400@d41d8cd9": { + "ocaml@github:Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57@d41d8cd9": { "id": - "ocaml@github:bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400@d41d8cd9", + "ocaml@github:Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57@d41d8cd9", "name": "ocaml", "version": - "github:bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400", + "github:Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57", "source": { "type": "install", "source": [ - "github:bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400" + "github:Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57" ] }, "overrides": [], @@ -25,10 +25,10 @@ "source": { "type": "link-dev", "path": ".", "manifest": "esy.json" }, "overrides": [], "dependencies": [ - "ocaml@github:bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400@d41d8cd9" + "ocaml@github:Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57@d41d8cd9" ], "devDependencies": [ - "ocaml@github:bucklescript/ocaml:package.json#bf88fbf88d4e305bab82259def35a4492e475400@d41d8cd9" + "ocaml@github:Et7f3/ocaml:package.json#cee7129b58afcb987cc1741acf4a786414502a57@d41d8cd9" ] } } From 670a4cc069f15aaa2fcb7670a26402a7c866b2f7 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sat, 15 Aug 2020 18:43:28 +0200 Subject: [PATCH 5/5] fix(ci): Clone submodules. --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ff6fa2925..adacf9ebe1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,9 @@ jobs: path: ~/.esy/source key: source-${{ hashFiles('**/index.json') }} + - name: Clone submodules + run: git submodule update --init + - name: Install run: esy install