Can't install on Mac after 6.0.0
chooban opened this issue ยท 13 comments
This isn't about supporting Mac as a hosting platform, just a development one.
In the previous version, if I yarn install
on a mac then the bindings fail to compile silently, but now I get a warning, it exits with a process.exit(1)
and I can't go any further. I could move the bindings to the optionalDependencies
but this would complicate our build process for boring reasons.
Any chance of making the install
part of this log a warning but allow the install to continue on unsupported platforms?
Hi @chooban, thanks for raising this issue. It's definitely a regression because an appoptics-bindings install failure shouldn't stop the install process; it should just mean the agent goes into no-op mode.
It seems like a simple change in setup-liboboe.js
but I don't think we'll be able to get to it until early next week -- is this blocking you?
No, not at all, no great rush from our end.
hey @chooban - i am not able to reproduce either npm install
or yarn install
exiting and not proceeding. i do see the message we output (pardon the win32 message, i don't have a mac to force a failure on):
===================================================================
AppopticsApm warning: the win32 platform is not yet supported
see: https://docs.appoptics.com/kb/apm_tracing/supported_platforms/
Contact support@appoptics.com if this is unexpected.
===================================================================
followed by the output of npm ls
followed by npm's error message:
npm WARN test-bindings-install@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appoptics-bindings@6.1.0 (node_modules\appoptics-bindings):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appoptics-bindings@6.1.0 install: `node setup-liboboe && node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
and when i run the program (or load appoptics-apm
in any way) we output:
appoptics:error Can't load bindings Error: Cannot find module 'appoptics-bindings'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (U:\Users\Bruce\solarwinds\test-bindings-install\node_modules\appoptics-apm\lib\index.js:305:16)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3) +0ms
appoptics:error AppopticsAPM disabled due to: bindings not loaded, bindings intentionally not loaded +16ms
but the program continues to execute and should operate in disabled mode (aka noop mode). it's possible that there might be something that isn't stubbed correctly when in disabled mode, but that should result in a completely different error message.
maybe you can provide the terminal/log output. i've tested with npm and yarn on node 6 and 8.
If I'm in the project directory, execute yarn upgrade-interactive --latest
and select the AO modules, I get the following:
...
[5/5] ๐จ Building fresh packages...
โจ Done in 17.05s.
Error: /Users/ross/Projects/chronologic/cl-server/node_modules/appoptics-bindings: Command failed.
Exit code: 1
Command: node setup-liboboe && node-gyp rebuild
Arguments:
Directory: /Users/ross/Projects/chronologic/cl-server/node_modules/appoptics-bindings
Output:
===================================================================
AppopticsApm warning: the darwin platform is not yet supported
see: https://docs.appoptics.com/kb/apm_tracing/supported_platforms/
Contact support@appoptics.com if this is unexpected.
===================================================================
at ProcessTermError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:721:66)
at ProcessTermError.MessageError (/usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:750:123)
at new ProcessTermError (/usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:790:113)
at ChildProcess.<anonymous> (/usr/local/Cellar/yarn/1.15.2/libexec/lib/cli.js:25795:17)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:189:13)
at Pipe._handle.close (net.js:597:12)
This exits the upgrade process without changing any package.json
files in the workspace.
However, if I change the package.json
file manually and run yarn
I get the same error message, an overall exit code of 1, but the packages seem to be installed. However, since it exited prematurely, the lock file hasn't been updated, so any subsequent yarn commands complain about it being out of date. The solution is to to run yarn install
which just repeats the previous command.
Based on the stack trace it looks like this might be a yarn bug. We do return an exit 1, as expected, because both yarn and npm need to know that the optional dependency installation failed. Maybe yarn's update logic presumes that the package is already installed? Are you OK with yarn install
or would you like me to take a look at the yarn code?
Sorry, I phrased my message badly.
The solution to the "lockfile is out of date" problem is to run yarn install, but since this repeats what was done before, it exits at the same point and we're in the same situation.
Have you considered reporting this to the yarn folks? If it's our bug I want to fix it but it seems like we're doing the right thing. What do you think? FWIW, it doesn't seem like yarn upgrade-interactive --latest
works at all on windows - it returns success but doesn't install missing dependencies. npm
works as expected.
Yup, I'l see if I can make a test case
The windows behavior is interesting - if appoptics-bindings is not installed (because it failed) the upgrade-interactive --latest
command does nothing but says everything is updated. I guess that's the correct behavior if appoptics-apm
is already the latest version. When I installed an old version of appoptics-apm
and then ran the yarn upgrade-interactive --latest
command I get a successful return:
PS U:\Users\Bruce\solarwinds\test-bindings-install> yarn upgrade-interactive --latest
yarn upgrade-interactive v1.15.2
info Color legend :
"<red>" : Major Update backward-incompatible updates
"<yellow>" : Minor Update backward-compatible features
"<green>" : Patch Update backward-compatible bug fixes
? Choose which packages to update.
? Choose which packages to update. appoptics-apm@6.2.1
info Installing "dependencies"...
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
warning Error running install script for optional dependency: "U:\\Users\\Bruce\\solarwinds\\test-bindings-install\\node_modules\\appoptics-bindings: Command failed.
Exit code: 1
Command: node setup-liboboe && node-gyp rebuild
Arguments:
Directory: U:\\Users\\Bruce\\solarwinds\\test-bindings-install\\node_modules\\appoptics-bindings
Output:
===================================================================
AppopticsApm warning: the win32 platform is not yet supported
see: https://docs.appoptics.com/kb/apm_tracing/supported_platforms/
Contact support@appoptics.com if this is unexpected.
==================================================================="
info This module is OPTIONAL, you can safely ignore this error
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
โโ appoptics-apm@6.2.1
info All dependencies
โโ appoptics-apm@6.2.1
Done in 27.13s.
PS U:\Users\Bruce\solarwinds\test-bindings-install>
I can't say for sure but it appears that maybe this is a mac-specific error.
That might be because you have it listed as an optional dependency (a guess based on the log). I'll play about with that as well. Moving the bindings to the optional dependencies will mess up something in our deployment process, but that's probably more indicative of a problem with our process rather than the library. Thinking hat time...
appoptics-bindings should be an optional dependency of appoptics-apm. that's what we've published it as. is yours different?
that's how we make sure that appoptics-apm can load even if appoptics-bindings fails in some way. appoptics-apm then supplies simulated functions for the missing appoptics-bindings.
hmm. you have explicitly included appoptics-bindings as a dependency? appoptics-apm already includes appoptics-bindings as an optional dependency. there should be no need for you to explicitly make appoptics-bindings a dependency of any sort. is there something unique about your setup that requires it?
Yeah, I'm beginning to think I've optimised a build process and broken this in the meantime, sorry!
I added it as a dependency to get around the fact I don't want to install optional dependencies at deploy time, as some of the dependencies are large and not needed to run. However, it's designed to be optional so I'm taking the project into unsupported territory by adding it as an explicit.
I think I'm happy to say this is an issue of my own making and it shouldn't be a bug for you to worry about.
No worries. Thanks for being so responsive. I've found that npm (and yarn) don't allow as much flexibility as desired in dependencies. I've wanted to have optional devDependency packages but there is no way to do that. And I've wanted to be able to set architecture-dependent dependencies as well. Also no way.
I understand your issue. Thanks for working through this so quickly.