@@ -44,7 +44,7 @@ o core/js_map.ml: p4of core/js_map.mlp | core/j.ml
44
44
* @returns {boolean }
45
45
*/
46
46
function hasCamlp4 ( ) {
47
- // console.log(`camlp4of ${process.env.PATH}`)
47
+ // console.log(`camlp4of ${process.env.PATH}`)
48
48
try {
49
49
console . log ( cp . execSync ( `camlp4of -v` , { encoding : "ascii" } ) ) ;
50
50
return true ;
@@ -100,7 +100,6 @@ function generateVisitorPattern() {
100
100
* need do test build in CI either
101
101
*
102
102
*/
103
- var useEnv = false ;
104
103
105
104
/**
106
105
* Note this file is not used in ninja file
@@ -109,7 +108,7 @@ var useEnv = false;
109
108
* Note ocamldep.opt has built-in macro handling OCAML_VERSION
110
109
*/
111
110
var getOcamldepFile = ( ) => {
112
- if ( useEnv || process . env . ESY === "true" ) {
111
+ if ( process . env . ESY === "true" ) {
113
112
return `ocamldep.opt` ;
114
113
} else {
115
114
return path . join (
@@ -867,11 +866,7 @@ var compilerTarget = pseudoTarget(COMPILIER);
867
866
async function runtimeNinja ( devmode = true ) {
868
867
var ninjaCwd = "runtime" ;
869
868
var externalDeps = devmode ? [ compilerTarget ] : [ ] ;
870
- var ninjaOutput = devmode
871
- ? useEnv
872
- ? "env.ninja"
873
- : "build.ninja"
874
- : "release.ninja" ;
869
+ var ninjaOutput = devmode ? "build.ninja" : "release.ninja" ;
875
870
var templateRuntimeRules = `
876
871
bsc_no_open_flags = ${ commonBsFlags } -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A
877
872
bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini
@@ -964,11 +959,7 @@ rule ${mllRuleName}
964
959
` ;
965
960
async function othersNinja ( devmode = true ) {
966
961
var externalDeps = [ runtimeTarget ] ;
967
- var ninjaOutput = devmode
968
- ? useEnv
969
- ? "env.ninja"
970
- : "build.ninja"
971
- : "release.ninja" ;
962
+ var ninjaOutput = devmode ? "build.ninja" : "release.ninja" ;
972
963
var ninjaCwd = "others" ;
973
964
974
965
var templateOthersRules = `
@@ -1087,11 +1078,7 @@ async function stdlibNinja(devmode = true) {
1087
1078
var ninjaCwd = stdlibVersion ;
1088
1079
var stdlibDir = path . join ( jscompDir , stdlibVersion ) ;
1089
1080
var externalDeps = [ othersTarget ] ;
1090
- var ninjaOutput = devmode
1091
- ? useEnv
1092
- ? "env.ninja"
1093
- : "build.ninja"
1094
- : "release.ninja" ;
1081
+ var ninjaOutput = devmode ? "build.ninja" : "release.ninja" ;
1095
1082
var bsc_flags = "bsc_flags" ;
1096
1083
/**
1097
1084
* @type [string,string][]
@@ -1232,7 +1219,7 @@ function baseName(x) {
1232
1219
* @returns {Promise<void> }
1233
1220
*/
1234
1221
async function testNinja ( ) {
1235
- var ninjaOutput = useEnv ? "env.ninja" : "build.ninja" ;
1222
+ var ninjaOutput = "build.ninja" ;
1236
1223
var ninjaCwd = `test` ;
1237
1224
var templateTestRules = `
1238
1225
bsc_flags = -absname -bs-no-version-header -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104 -warn-error A -I runtime -I $stdlib -I others
@@ -1392,32 +1379,15 @@ function sortFilesByDeps(domain, dependency_graph) {
1392
1379
}
1393
1380
1394
1381
function updateRelease ( ) {
1395
- if ( ! useEnv ) {
1396
- runtimeNinja ( false ) ;
1397
- stdlibNinja ( false ) ;
1398
- othersNinja ( false ) ;
1399
- }
1382
+ runtimeNinja ( false ) ;
1383
+ stdlibNinja ( false ) ;
1384
+ othersNinja ( false ) ;
1400
1385
}
1401
1386
1402
1387
function updateDev ( ) {
1403
- if ( useEnv ) {
1404
- writeFileAscii (
1405
- path . join ( jscompDir , "env.ninja" ) ,
1406
- `
1407
- ${ getEnnvConfigNinja ( ) }
1408
- stdlib = ${ version6 ( ) ? `stdlib-406` : `stdlib-402` }
1409
- subninja compilerEnv.ninja
1410
- subninja runtime/env.ninja
1411
- subninja others/env.ninja
1412
- subninja $stdlib/env.ninja
1413
- subninja test/env.ninja
1414
- o all: phony runtime others $stdlib test
1415
- `
1416
- ) ;
1417
- } else {
1418
- writeFileAscii (
1419
- path . join ( jscompDir , "build.ninja" ) ,
1420
- `
1388
+ writeFileAscii (
1389
+ path . join ( jscompDir , "build.ninja" ) ,
1390
+ `
1421
1391
${ getVendorConfigNinja ( ) }
1422
1392
stdlib = ${ version6 ( ) ? `stdlib-406` : `stdlib-402` }
1423
1393
${ BSC_COMPILER }
@@ -1428,17 +1398,17 @@ subninja $stdlib/build.ninja
1428
1398
subninja test/build.ninja
1429
1399
o all: phony runtime others $stdlib test
1430
1400
`
1431
- ) ;
1432
- writeFileAscii (
1433
- path . join ( jscompDir , ".." , "lib" , "build.ninja" ) ,
1434
- `
1401
+ ) ;
1402
+ writeFileAscii (
1403
+ path . join ( jscompDir , ".." , "lib" , "build.ninja" ) ,
1404
+ `
1435
1405
ocamlopt = ocamlopt.opt
1436
1406
ext = exe
1437
1407
INCL= ${ version6 ( ) ? "4.06.1+BS" : "4.02.3+BS" }
1438
1408
include body.ninja
1439
1409
`
1440
- ) ;
1441
- }
1410
+ ) ;
1411
+
1442
1412
preprocessorNinjaSync ( ) ;
1443
1413
nativeNinja ( ) ;
1444
1414
runtimeNinja ( ) ;
@@ -1509,7 +1479,7 @@ ocaml = ocaml
1509
1479
* @returns {string }
1510
1480
*/
1511
1481
function getPreprocessorFileName ( ) {
1512
- return useEnv ? "cppoEnv.ninja" : "cppoVendor.ninja" ;
1482
+ return "cppoVendor.ninja" ;
1513
1483
}
1514
1484
/**
1515
1485
* Built cppo.exe refmt.exe etc for dev purpose
@@ -1523,7 +1493,7 @@ function preprocessorNinjaSync() {
1523
1493
. map ( ( file ) => `o napkin/${ file } : copy ../syntax/src/${ file } ` )
1524
1494
. join ( "\n" ) ;
1525
1495
var cppoNative = `
1526
- ${ useEnv ? getEnnvConfigNinja ( ) : getVendorConfigNinja ( ) }
1496
+ ${ getVendorConfigNinja ( ) }
1527
1497
rule link
1528
1498
command = $ocamlopt -g -I +compiler-libs $flags $libs $in -o $out
1529
1499
o ${ cppoFile } : link ${ cppoMonoFile }
@@ -1584,7 +1554,7 @@ ${buildNapkinFiles}
1584
1554
* an effect on depfile
1585
1555
*/
1586
1556
function nativeNinja ( ) {
1587
- var ninjaOutput = useEnv ? "compilerEnv.ninja" : "compiler.ninja" ;
1557
+ var ninjaOutput = "compiler.ninja" ;
1588
1558
var sourceDirs = [
1589
1559
"stubs" ,
1590
1560
"ext" ,
@@ -1774,10 +1744,6 @@ function main() {
1774
1744
var emptyCount = 2 ;
1775
1745
var isPlayground = false ;
1776
1746
if ( require . main === module ) {
1777
- if ( process . argv . includes ( "-env" ) ) {
1778
- useEnv = true ;
1779
- emptyCount ++ ;
1780
- }
1781
1747
if ( process . argv . includes ( "-check" ) ) {
1782
1748
checkEffect ( ) ;
1783
1749
}
0 commit comments