nstepien/iltorb

"detect-libc: not found" error when using npm/yarn --no-bin-links option

edmorley opened this issue · 8 comments

Hi!

STR:

  1. Run any of:
    • docker run --rm -it node:9.7.1-slim yarn add iltorb --no-bin-links
    • docker run --rm -it node:9.7.1-slim npm install iltorb --no-bin-links
  2. Compare result to running the same command, but without the --no-bin-links option.

Expected:

iltorb installation succeeds using pre-compiled binary.

Actual:

Output includes sh: 1: detect-libc: not found, and iltorb falls back to building the binary manually (which fails due to lack of Python). Full log:
https://emorley.pastebin.mozilla.org/9079080

This presumably comes from the iltorb's install lifecycle command:
https://github.com/MayhemYDG/iltorb/blob/4fbd8a89d616c35a9eea97222ff90193484cd10a/package.json#L52

Context:

The use of --no-bin-links is required in environments where the filesystem doesn't support symlinks even though the OS itself does. For example inside a Vagrant development environment where the host is Windows and the source directory is a virtualbox shared folder. In this case the only way to prevent errors is to add --no-bin-links to the repo root's .yarn.rc (or pass in each time).

Unless someone else is willing to tackle this, I'll take a deeper look at this when I have the time. We'll need to deal with the issue where symlinks for both detect-libc and prebuild-install aren't created when using the --no-bin-links options.

It should be fixed with 612d820. I'll publish a release in the morning.

Going to revert that diff since it actually didn't work properly when installed as a dependency.

Ah yeah was just about to add a comment - unfortunately that approach doesn't work when yarn/npm hoist dependencies (this would fail: docker run --rm -it node:9-slim yarn add gulp-brotli). I think perhaps the best option might be a wrapper script in the iltorb repo that uses node module resolution to run the commands? (Not ideal I know)

I'm starting to think that yarn/npm should just remove the no-bin-links option and replace with a "no-symlinks" option instead (which would still create the .bin/ entries, but they would be the wrapper scripts like is produces for Windows and other non-symlink compatible platforms).

Agreed, I was going to write a wrapper when I have the time today. I dislike having duplicate code, but I can't think of a better solution.

@edmorley Can you checkout the latest master and see if it works with --no-bin-links. If it's all good, I'll push out a build.

npm i https://github.com/MayhemYDG/iltorb.git --no-bin-links

This should be addressed now.

Sorry for the delayed reply! I can confirm the detect-libc error no longer appears (though I'm now seeing #61).
Thank you for your help/time :-)