jordwalke / jordwalke/CommonML

Shell is required to pick up opam environment

Open
#19 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
96
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Not sure how to properly fix it, but having

```
"findlibPackages": [{"dependency": "js_of_ocaml"}]
```

gives me an error:

```
ocamlfind: Package `js_of_ocaml' not found
Dependencies scanned and verified, but failed to build

Stack Trace:
------------
Error: Command failed: ocamlfind ocamldep -package js_of_ocaml -only-show
ocamlfind: Package `js_of_ocaml' not found

at checkExecSyncError (child_process.js:470:13)
at Object.execSync (child_process.js:510:13)
at getFindlibCommand (/home/ul/Projects/ludwig/node_modules/CommonML/build.js:1149:24)
at discoverDeps (/home/ul/Projects/ludwig/node_modules/CommonML/build.js:1604:32)
at dirtyDetectingBuilder (/home/ul/Projects/ludwig/node_modules/CommonML/build.js:2044:5)
at onAllSubpackagesDone (/home/ul/Projects/ludwig/node_modules/CommonML/build.js:2266:11)
at /home/ul/Projects/ludwig/node_modules/async/lib/async.js:52:16
at replenish (/home/ul/Projects/ludwig/node_modules/async/lib/async.js:317:29)
at /home/ul/Projects/ludwig/node_modules/async/lib/async.js:333:15
at Object.async.forEachLimit.async.eachLimit (/home/ul/Projects/ludwig/node_modules/async/lib/async.js:226:35)
```

If I change https://github.com/jordwalke/CommonML/blob/ccea57fa15f9ecad27ec3e47e139783864430ba0/build.js#L1148 to

```
return child_process.execSync(findLib, {shell: "fish"}).toString().trim();
```

it picks up environment fine.

Probably worth to add `shell` as a config parameter to `CommonML` entry in `package.json`?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at build.js line 1148, where child_process.execSync runs the findlib command, and compare the current shell behavior with the reported fish invocation. Review the CommonML entry in package.json to determine how a shell setting should be represented. Done means the findlibPackages example discovers js_of_ocaml without a manual build.js change.

Written by the indexing model from the issue text.

Assessment

Tech stack
fish, node.js
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.