diff --git a/4061.json b/4061.json deleted file mode 100644 index 69608c0f70..0000000000 --- a/4061.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "source": "./esy.json", - "override": { - "resolutions": { - "ocaml": "bucklescript/ocaml:package.json#4582c3fcce632aaa0f9794f5518bf5d9ad4a6385" - } - } -} diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..6ae19cc86e --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,166 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: + - master + +jobs: + - job: Linux_npm_install + pool: + vmImage: ubuntu-16.04 + + steps: + - bash: | + BS_TRAVIS_CI=1 + OCAMLRUNPARAM="b" + echo "##vso[task.setvariable variable=BS_TRAVIS_CI]$BS_TRAVIS_CI" + echo "##vso[task.setvariable variable=OCAMLRUNPARAM]$OCAMLRUNPARAM" + displayName: "Set BS_TRAVIS_CI and OCAMLRUNPARAM" + + - bash: env + displayName: "Print environment" + + - script: | + git submodule init + git submodule update + displayName: "Pull Submodules" + + - script: | + npm install + displayName: "npm install" + + - bash: | + export BS_TRAVIS_CI=1 + npm test + displayName: "test" + + - job: macOS_npm_install + pool: + vmImage: macOS-10.13 + + steps: + - bash: | + BS_TRAVIS_CI=1 + OCAMLRUNPARAM="b" + echo "##vso[task.setvariable variable=BS_TRAVIS_CI]$BS_TRAVIS_CI" + echo "##vso[task.setvariable variable=OCAMLRUNPARAM]$OCAMLRUNPARAM" + displayName: "Set BS_TRAVIS_CI and OCAMLRUNPARAM" + + - bash: env + displayName: "Print environment" + + - script: | + git submodule init + git submodule update + displayName: "Pull Submodules" + + - script: | + npm install + displayName: "npm install" + + - bash: | + export BS_TRAVIS_CI=1 + npm test + displayName: "test" + + - job: Windows_esy_build + pool: + vmImage: vs2017-win2016 + + steps: + # - bash: | + # echo "which x86_64-w64-mingw32-gcc" + # which x86_64-w64-mingw32-gcc + # "echo ls -l /c/ProgramData/Chocolatey/bin" + # ls -l /c/ProgramData/Chocolatey/bin + # echo "int main() { return 0; }" >test.c + # echo "x86_64-w64-mingw32-gcc -v test.c" + # x86_64-w64-mingw32-gcc -v test.c + # # echo "esy b which x86_64-w64-mingw32-as" + # # esy b which x86_64-w64-mingw32-as + + # displayName: "find mingw" + + - bash: | + BS_TRAVIS_CI=1 + OCAMLRUNPARAM="b" + echo "##vso[task.setvariable variable=BS_TRAVIS_CI]$BS_TRAVIS_CI" + echo "##vso[task.setvariable variable=OCAMLRUNPARAM]$OCAMLRUNPARAM" + displayName: "Set BS_TRAVIS_CI and OCAMLRUNPARAM" + + - bash: env + displayName: "Print environment" + + # - script: | + # git submodule init + # git submodule update + # displayName: "Pull Submodules" + + - script: npm install -g esy + displayName: "install esy" + - script: esy install + displayName: "esy install" + - script: esy build + displayName: "esy build" + + # - bash: | + # OCAMLOPT=`esy b which ocamlopt` + # OCAMLBIN_UNIX=$(dirname "${OCAMLOPT}") + # OCAMLBIN=$( cygpath --windows "$OCAMLBIN_UNIX") + # echo "OCAMLBIN: $OCAMLBIN" + # echo "##vso[task.setvariable variable=OCAMLBIN]$OCAMLBIN" + # echo "##vso[task.prependpath]$OCAMLBIN" + # displayName: "Set OCAMLBIN" + + # - bash: env + # displayName: "Print environment" + + # - bash: ls -lR "$OCAMLBIN" + # displayName: "ls -lR $OCAMLBIN" + + # - bash: ls -lR "$OCAMLBIN/.." + # displayName: "ls -lR $OCAMLBIN/.." + + # - bash: | + # echo "PATH" + # echo $PATH + # echo "ocamlopt -version" + # ocamlopt -version + # echo "looking for x86_64-w64-mingw32-as" + # find ~/.esy -name "x86_64-w64-mingw32-as*" + # echo "print_int 42;; print_newline();;" >testOcaml.ml + # echo "build with esy" + # esy b ocamlopt.opt -verbose testOcaml.ml -o testOcaml + # ./testOcaml + # echo "build without esy" + # ocamlopt.opt testOcaml.ml -o testOcaml + # node scripts/prebuilt.js + # displayName: "try node scripts/prebuilt.js" + + - job: Linux_esy_build + pool: + vmImage: ubuntu-16.04 + steps: + - bash: env + displayName: "Print environment" + - script: npm install -g esy + displayName: "install esy" + - script: esy install + displayName: "esy install" + - script: esy build + displayName: "esy build" + + - job: macOS_esy_build + pool: + vmImage: macOS-10.13 + steps: + - bash: env + displayName: "Print environment" + - script: npm install -g esy + displayName: "install esy" + - script: esy install + displayName: "esy install" + - script: esy build + displayName: "esy build" \ No newline at end of file diff --git a/esy.json b/esy.json index caf8ccc91e..748b818cc8 100644 --- a/esy.json +++ b/esy.json @@ -1,14 +1,11 @@ { "name": "bs-platform", "version": "5.2.0-dev.2", - "dependencies": { - "ocaml": "4.02.3000+BS" - }, "devDependencies": { - "ocaml": "4.02.3000+BS" + "ocaml": "overridden below" }, "resolutions": { - "ocaml": "bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb" + "ocaml": "ulrikstrid/ocaml:package.json#6ff2cd84ddc7e8bbebd437a7695d04e4ba0900c2" }, "scripts": { "clean": "node ./scripts/ninja.js clean" diff --git a/esy.lock/index.json b/esy.lock/index.json index 7454e5c58f..5f2b972cbf 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,17 +1,17 @@ { - "checksum": "a0f4fa67bcb1beac6cda121fffdda6bb", + "checksum": "8a97123dcb14bb7cb79bfd0219cb97fa", "root": "bs-platform@link-dev:./esy.json", "node": { - "ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9": { + "ocaml@github:ulrikstrid/ocaml:package.json#6ff2cd84ddc7e8bbebd437a7695d04e4ba0900c2@d41d8cd9": { "id": - "ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9", + "ocaml@github:ulrikstrid/ocaml:package.json#6ff2cd84ddc7e8bbebd437a7695d04e4ba0900c2@d41d8cd9", "name": "ocaml", "version": - "github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb", + "github:ulrikstrid/ocaml:package.json#6ff2cd84ddc7e8bbebd437a7695d04e4ba0900c2", "source": { "type": "install", "source": [ - "github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb" + "github:ulrikstrid/ocaml:package.json#6ff2cd84ddc7e8bbebd437a7695d04e4ba0900c2" ] }, "overrides": [], @@ -24,11 +24,9 @@ "version": "link-dev:./esy.json", "source": { "type": "link-dev", "path": ".", "manifest": "esy.json" }, "overrides": [], - "dependencies": [ - "ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9" - ], + "dependencies": [], "devDependencies": [ - "ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9" + "ocaml@github:ulrikstrid/ocaml:package.json#6ff2cd84ddc7e8bbebd437a7695d04e4ba0900c2@d41d8cd9" ] } } diff --git a/jscomp/snapshot.ninja b/jscomp/snapshot.ninja index 5d5fdebae2..d56a566d80 100644 --- a/jscomp/snapshot.ninja +++ b/jscomp/snapshot.ninja @@ -5,7 +5,7 @@ rule bspack generator = true -NATIVE_OCAML_PATH=../ocaml/ +NATIVE_OCAML_PATH=$native_ocaml_path OCAML_SRC_UTILS=$NATIVE_OCAML_PATH/utils OCAML_SRC_PARSING=$NATIVE_OCAML_PATH/parsing @@ -71,4 +71,3 @@ build $SNAP/unstable/js_compiler.ml: bspack | ./bin/bspack.exe # command = $ocamlopt -w -a unix.cmxa str.cmxa ./stubs/ext_basic_hash_stubs.c $in -o $out # only check if it compiles # build $SNAP/unstable/bsb_native.exe: bsbnative ./bin/bsb_native.ml - diff --git a/scripts/ciTest.js b/scripts/ciTest.js index 81f158d2d5..8f9aa683d1 100644 --- a/scripts/ciTest.js +++ b/scripts/ciTest.js @@ -39,8 +39,8 @@ if (all){ installGlobal = true ounitTest = true mochaTest = true - themeTest = true - bsbTest = true + // themeTest = true + // bsbTest = true } var os = require('os') diff --git a/scripts/ninja.js b/scripts/ninja.js index 63441f9ce2..8f9072a3ac 100755 --- a/scripts/ninja.js +++ b/scripts/ninja.js @@ -1413,6 +1413,11 @@ build all: phony runtime others $stdlib test ` ${getVendorConfigNinja()} stdlib = ${version6() ? `stdlib-406` : `stdlib-402`} +native_ocaml_path = ${ + process.env.ESY === "true" + ? path.join(process.env.OCAMLLIB, "/../..") + : "../ocaml/" + } snapshot_path = ${require("./buildocaml.js").getVersionPrefix()} subninja compiler.ninja subninja snapshot.ninja diff --git a/scripts/prebuilt.js b/scripts/prebuilt.js index 35e7aa041b..4cc51a5cf4 100755 --- a/scripts/prebuilt.js +++ b/scripts/prebuilt.js @@ -34,7 +34,7 @@ function buildCompiler() { var prebuilt = "prebuilt.ninja"; var content = require("./ninjaFactory.js").libNinja({ ocamlopt: is_windows - ? `ocamlopt.opt.exe` + ? `esy b ocamlopt.opt -verbose` : `../native/${ocamlVersion}/bin/ocamlopt.opt`, ext: sys_extension, INCL: ocamlVersion, @@ -58,10 +58,10 @@ var os = require("os"); function createOCamlTar() { if (os.platform() === hostPlatform) { cp.execSync(`git -C ocaml status -uno`, { cwd: root, stdio: [0, 1, 2] }); - cp.execSync( - `git -C ocaml archive --format=tar.gz HEAD -o ../vendor/ocaml.tar.gz`, - { cwd: root, stdio: [0, 1, 2] } - ); + // cp.execSync( + // `git -C ocaml archive --format=tar.gz HEAD -o ../vendor/ocaml.tar.gz`, + // { cwd: root, stdio: [0, 1, 2] } + // ); // fs.copyFileSync( // path.join(root, "ocaml", "VERSION"), // path.join(root, "OCAML_VERSION")