Skip to content

Commit 18d6459

Browse files
committed
Test building on #3918.
#3918
1 parent 7296ea7 commit 18d6459

File tree

5 files changed

+141
-53
lines changed

5 files changed

+141
-53
lines changed

azure-pipelines.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ jobs:
8080
vmImage: vs2017-win2016
8181

8282
steps:
83-
- bash: |
84-
echo "which x86_64-w64-mingw32-gcc"
85-
which x86_64-w64-mingw32-gcc
86-
"echo ls -l /c/ProgramData/Chocolatey/bin"
87-
ls -l /c/ProgramData/Chocolatey/bin
88-
echo "int main() { return 0; }" >test.c
89-
echo "x86_64-w64-mingw32-gcc -v test.c"
90-
x86_64-w64-mingw32-gcc -v test.c
91-
# echo "esy b which x86_64-w64-mingw32-as"
92-
# esy b which x86_64-w64-mingw32-as
93-
94-
displayName: "find mingw"
83+
# - bash: |
84+
# echo "which x86_64-w64-mingw32-gcc"
85+
# which x86_64-w64-mingw32-gcc
86+
# "echo ls -l /c/ProgramData/Chocolatey/bin"
87+
# ls -l /c/ProgramData/Chocolatey/bin
88+
# echo "int main() { return 0; }" >test.c
89+
# echo "x86_64-w64-mingw32-gcc -v test.c"
90+
# x86_64-w64-mingw32-gcc -v test.c
91+
# # echo "esy b which x86_64-w64-mingw32-as"
92+
# # esy b which x86_64-w64-mingw32-as
93+
94+
# displayName: "find mingw"
9595

9696
- task: NodeTool@0
9797
inputs:
@@ -108,10 +108,10 @@ jobs:
108108
- bash: env
109109
displayName: "Print environment"
110110

111-
- script: |
112-
git submodule init
113-
git submodule update
114-
displayName: "Pull Submodules"
111+
# - script: |
112+
# git submodule init
113+
# git submodule update
114+
# displayName: "Pull Submodules"
115115

116116
- script: npm install -g esy
117117
displayName: "install esy"
@@ -120,36 +120,36 @@ jobs:
120120
- script: esy build
121121
displayName: "esy build"
122122

123-
- bash: |
124-
OCAMLOPT=`esy b which ocamlopt`
125-
OCAMLBIN_UNIX=$(dirname "${OCAMLOPT}")
126-
OCAMLBIN=$( cygpath --windows "$OCAMLBIN_UNIX")
127-
echo "OCAMLBIN: $OCAMLBIN"
128-
echo "##vso[task.setvariable variable=OCAMLBIN]$OCAMLBIN"
129-
echo "##vso[task.prependpath]$OCAMLBIN"
130-
displayName: "Set OCAMLBIN"
123+
# - bash: |
124+
# OCAMLOPT=`esy b which ocamlopt`
125+
# OCAMLBIN_UNIX=$(dirname "${OCAMLOPT}")
126+
# OCAMLBIN=$( cygpath --windows "$OCAMLBIN_UNIX")
127+
# echo "OCAMLBIN: $OCAMLBIN"
128+
# echo "##vso[task.setvariable variable=OCAMLBIN]$OCAMLBIN"
129+
# echo "##vso[task.prependpath]$OCAMLBIN"
130+
# displayName: "Set OCAMLBIN"
131131

132-
- bash: env
133-
displayName: "Print environment"
132+
# - bash: env
133+
# displayName: "Print environment"
134134

135135
# - bash: ls -lR "$OCAMLBIN"
136136
# displayName: "ls -lR $OCAMLBIN"
137137

138138
# - bash: ls -lR "$OCAMLBIN/.."
139139
# displayName: "ls -lR $OCAMLBIN/.."
140140

141-
- bash: |
142-
echo "PATH"
143-
echo $PATH
144-
echo "ocamlopt -version"
145-
ocamlopt -version
146-
echo "looking for x86_64-w64-mingw32-as"
147-
find ~/.esy -name "x86_64-w64-mingw32-as*"
148-
echo "print_int 42;; print_newline();;" >testOcaml.ml
149-
echo "build with esy"
150-
esy b ocamlopt.opt -verbose testOcaml.ml -o testOcaml
151-
./testOcaml
152-
echo "build without esy"
153-
ocamlopt.opt testOcaml.ml -o testOcaml
154-
node scripts/prebuilt.js
155-
displayName: "try node scripts/prebuilt.js"
141+
# - bash: |
142+
# echo "PATH"
143+
# echo $PATH
144+
# echo "ocamlopt -version"
145+
# ocamlopt -version
146+
# echo "looking for x86_64-w64-mingw32-as"
147+
# find ~/.esy -name "x86_64-w64-mingw32-as*"
148+
# echo "print_int 42;; print_newline();;" >testOcaml.ml
149+
# echo "build with esy"
150+
# esy b ocamlopt.opt -verbose testOcaml.ml -o testOcaml
151+
# ./testOcaml
152+
# echo "build without esy"
153+
# ocamlopt.opt testOcaml.ml -o testOcaml
154+
# node scripts/prebuilt.js
155+
# displayName: "try node scripts/prebuilt.js"

esy.json

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,85 @@
11
{
22
"name": "bs-platform",
3-
"version": "6.2.1",
3+
"version": "5.2.0-dev.2",
44
"dependencies": {
5-
"ocaml": "~4.06.1"
6-
}
5+
"ocaml": "4.02.3000+BS"
6+
},
7+
"devDependencies": {
8+
"ocaml": "4.02.3000+BS"
9+
},
10+
"resolutions": {
11+
"ocaml": "ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b"
12+
},
13+
"scripts": {
14+
"clean": "node ./scripts/ninja.js clean"
15+
},
16+
"esy": {
17+
"buildsInSource": true,
18+
"build": [
19+
["node", "./scripts/install.js"],
20+
["cp", "-r", "-f", "#{self.root / 'bsconfig.json'}", "#{self.install}"],
21+
["cp", "-r", "-f", "#{self.root / 'esy.json'}", "#{self.install}"],
22+
["cp", "-r", "-f", "#{self.root / 'package.json'}", "#{self.install}"],
23+
["cp", "-r", "-f", "#{self.root / 'jscomp'}", "#{self.install}"],
24+
["cp", "-r", "-f", "#{self.root / 'jscomp' / 'bin'}", "#{self.install}"],
25+
["cp", "-r", "-f", "#{self.root / 'lib'}", "#{self.install}"],
26+
["cp", "-r", "-f", "#{self.root / 'scripts'}", "#{self.install}"],
27+
["cp", "-r", "-f", "#{self.root / 'vendor'}", "#{self.install}"]
28+
],
29+
"buildDev": [
30+
["echo", "config"],
31+
["node", "./scripts/ninja.js", "config"],
32+
["echo", "build"],
33+
["node", "./scripts/ninja.js", "build"]
34+
],
35+
"buildEnv": {
36+
"ESY": "true"
37+
},
38+
"exportedEnv": {
39+
"OCAMLLIB": {
40+
"val": "#{self.lib / 'ocaml' }",
41+
"scope": "global"
42+
},
43+
"CAML_LD_LIBRARY_PATH": {
44+
"val": "#{self.lib / 'ocaml' / 'stublibs' : self.lib / 'ocaml' : $CAML_LD_LIBRARY_PATH}",
45+
"scope": "global"
46+
},
47+
"OCAML_TOPLEVEL_PATH": {
48+
"val": "#{self.lib / 'ocaml' }",
49+
"scope": "global"
50+
},
51+
"bs_custom_resolution": {
52+
"val": "true",
53+
"scope": "global"
54+
},
55+
"bs_platform__install": {
56+
"val": "#{self.install}",
57+
"scope": "global"
58+
},
59+
"PATH": {
60+
"val": "#{self.lib : $PATH}",
61+
"scope": "global"
62+
}
63+
}
64+
},
65+
"description": "bucklescript compiler for use in esy, ocaml standard libary by bucklescript and its required runtime support",
66+
"repository": {
67+
"type": "git",
68+
"url": "git+https://github.com/bucklescript/bucklescript.git"
69+
},
70+
"keywords": ["ocaml", "bucklescript", "stdlib", "functional programming"],
71+
"author": {
72+
"name": "Hongbo Zhang"
73+
},
74+
"maintainers": [
75+
{
76+
"name": "hongbo_zhang",
77+
"email": "[email protected]"
78+
}
79+
],
80+
"license": "SEE LICENSE IN LICENSE",
81+
"bugs": {
82+
"url": "https://github.com/bucklescript/bucklescript/issues"
83+
},
84+
"homepage": "https://github.com/bucklescript/bucklescript#readme"
785
}

esy.lock/index.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2-
"checksum": "62680885f80ef361d9673f75df49f278",
2+
"checksum": "927e0056007e9ee1cea4deb3c760e964",
33
"root": "bs-platform@link-dev:./esy.json",
44
"node": {
5-
"[email protected]@d41d8cd9": {
6-
"id": "[email protected]@d41d8cd9",
5+
"ocaml@github:ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b@d41d8cd9": {
6+
"id":
7+
"ocaml@github:ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b@d41d8cd9",
78
"name": "ocaml",
8-
"version": "4.6.1000",
9+
"version":
10+
"github:ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b",
911
"source": {
1012
"type": "install",
1113
"source": [
12-
"archive:https://registry.npmjs.org/ocaml/-/ocaml-4.6.1000.tgz#sha1:99525ef559353481396454f9a072dedc96b52f44"
14+
"github:ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b"
1315
]
1416
},
1517
"overrides": [],
@@ -22,8 +24,12 @@
2224
"version": "link-dev:./esy.json",
2325
"source": { "type": "link-dev", "path": ".", "manifest": "esy.json" },
2426
"overrides": [],
25-
"dependencies": [ "[email protected]@d41d8cd9" ],
26-
"devDependencies": []
27+
"dependencies": [
28+
"ocaml@github:ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b@d41d8cd9"
29+
],
30+
"devDependencies": [
31+
"ocaml@github:ulrikstrid/ocaml:package.json#68e181a3a44f0b6be1b1ab1e585d2c9f2718c37b@d41d8cd9"
32+
]
2733
}
2834
}
2935
}

jscomp/snapshot.ninja

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rule bspack
55
generator = true
66

77

8-
NATIVE_OCAML_PATH=../ocaml/
8+
NATIVE_OCAML_PATH=$native_ocaml_path
99

1010
OCAML_SRC_UTILS=$NATIVE_OCAML_PATH/utils
1111
OCAML_SRC_PARSING=$NATIVE_OCAML_PATH/parsing
@@ -71,4 +71,3 @@ build $SNAP/unstable/js_compiler.ml: bspack | ./bin/bspack.exe
7171
# command = $ocamlopt -w -a unix.cmxa str.cmxa ./stubs/ext_basic_hash_stubs.c $in -o $out
7272
# only check if it compiles
7373
# build $SNAP/unstable/bsb_native.exe: bsbnative ./bin/bsb_native.ml
74-

scripts/ninja.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,11 @@ build all: phony runtime others $stdlib test
14131413
`
14141414
${getVendorConfigNinja()}
14151415
stdlib = ${version6() ? `stdlib-406` : `stdlib-402`}
1416+
native_ocaml_path = ${
1417+
process.env.ESY === "true"
1418+
? path.join(process.env.OCAMLLIB, "/../..")
1419+
: "../ocaml/"
1420+
}
14161421
snapshot_path = ${require("./buildocaml.js").getVersionPrefix()}
14171422
subninja compiler.ninja
14181423
subninja snapshot.ninja

0 commit comments

Comments
 (0)