I've create a minimal example here: https://github.com/wyze/bucklescript-bsconfig-bug
If I move the bs-dependencies node up to the top level from sources, it works. The above repo produces the following output currently:
> bsb -make-world
BSB check build spec : OK
Making the dependency world!
Package stack: bucklescript-bsconfig-bug
ninja.exe -C lib/bs
ninja: Entering directory `lib/bs'
[1/1] Building __tests__/sum_test.cmj /Users/neil/Projects/pers...escript-bsconfig-bug/lib/js/__tests__/sum_test.js __tests__/sum_test.cmi
FAILED: __tests__/sum_test.cmj /Users/neil/Projects/personal/bucklescript-bsconfig-bug/lib/js/__tests__/sum_test.js __tests__/sum_test.cmi
/Users/neil/Projects/personal/bucklescript-bsconfig-bug/node_modules/bs-platform/bin/bsc.exe -bs-package-name bucklescript-bsconfig-bug -bs-package-output commonjs:lib/js/__tests__ -bs-assume-no-mli -bs-no-builtin-ppx-ml -bs-no-implicit-include -bs-package-include bs-jest -I src -I __tests__ -nostdlib -I /Users/neil/Projects/personal/bucklescript-bsconfig-bug/node_modules/bs-platform/lib/ocaml -no-alias-deps -color always -w -40+6+7+27+32..39+44+45 -o __tests__/sum_test.mlast -c __tests__/sum_test.mlast
/Users/neil/Projects/personal/bucklescript-bsconfig-bug/node_modules/bs-platform/bin/bsc.exe: unknown option '-bs-package-include'.
And also prints the usage for bsc.exe.
based on discussions, instead of fixing such bug, the solution is to add dev dependencies explicitly via
"bs-dependencies": { "dev" : [ "a", ... ], "lib" : ... }
Note it would be backward compatible, "bs-dependencies" will accept array as well
@wyze please change your bsconfig.json per #1493
{
"name": "bucklescript-bsconfig-bug",
"bs-dev-dependencies": [
"bs-jest"
],
"sources": [
"src",
{
"dir": "__tests__",
"type": "dev"
}
]
}
Confirmed it is now working. Thanks for the quick fix @bobzhang!
Most helpful comment
based on discussions, instead of fixing such bug, the solution is to add dev dependencies explicitly via
Note it would be backward compatible, "bs-dependencies" will accept array as well