Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install fails - error in spellchecker_mac.mm code #205

Closed
bluechips23 opened this issue Oct 6, 2017 · 21 comments
Closed

npm install fails - error in spellchecker_mac.mm code #205

bluechips23 opened this issue Oct 6, 2017 · 21 comments

Comments

@bluechips23
Copy link

bluechips23 commented Oct 6, 2017

I did a clone of the master branch this morning and I ran npm install and I got the following error. Seems like there's an error in the code but let me know if I'm doing something wrong.

I'm running on MacOS - 10.12.6 (Sierra).

Error:

LIBTOOL-STATIC Release/hunspell.a
CXX(target) Release/obj.target/spellchecker/src/main.o
CXX(target) Release/obj.target/spellchecker/src/spellchecker_hunspell.o
**CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
../src/spellchecker_mac.mm:184:13: error: cannot initialize a variable of type 'NSString *' with an rvalue of type 'const NSString *'
NSString* globalLang = currentGlobalLanguage ? currentGlobalLanguage : autoLangauge;
          ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/spellchecker_mac.mm:185:13: error: cannot initialize a variable of type 'NSString *' with an rvalue of type 'const NSString *'
NSString* ourLang = this->spellCheckerLanguage ? this->spellCheckerLanguage : autoLangauge;
          ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.**
make: *** [Release/obj.target/spellchecker/src/spellchecker_mac.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/8.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/<username>/Dev/Symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: screen-snippet@git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1 (node_modules/screen-snippet):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for screen-snippet@1.0.1: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @paulcbetts/spellchecker@4.0.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @paulcbetts/spellchecker@4.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/<username>/.npm/_logs/2017-10-06T14_41_29_514Z-debug.log
@lneir
Copy link

lneir commented Oct 6, 2017

@VikasShashidhar what is the status of spellchecker? is there still compilation issue with that npm package - causing issue here?

@VishwasShashidhar
Copy link
Contributor

@lneir @bluechips23 master should contain a fix for this.

Please see this PR -> #197

@pmonks
Copy link
Contributor

pmonks commented Oct 9, 2017

I just pulled down the latest code in master and the build is still failing. Here's some of the relevant build output:

> @paulcbetts/spellchecker@4.0.5 install /Users/pmonks/Development/symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
> node-gyp rebuild

  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/md5.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string_piece.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict_reader.o
../vendor/hunspell/src/google/bdict_reader.cc:670:15: warning: unused variable
      'begin' [-Wunused-variable]
  const char* begin = reinterpret_cast<const char*>(&bdict_data_[cur_offset_]);
              ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
In file included from ../vendor/hunspell/src/hunspell/affentry.cxx:9:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                 ~ ^~~~
                                                                   0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                ~ ^~~~
                                                                  0
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: warning: while loop has
      empty body [-Wempty-body]
                        while (p && *p != ']' && ((p = nextchar(p)) != NULL));
                                                                             ^
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: note: put the semicolon on
      a separate line to silence this warning
3 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affixmgr.o
In file included from ../vendor/hunspell/src/hunspell/affixmgr.cxx:12:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                 ~ ^~~~
                                                                   0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                ~ ^~~~
                                                                  0
2 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/csutil.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/dictmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/filemgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hashmgr.o
In file included from ../vendor/hunspell/src/hunspell/hashmgr.cxx:9:
../vendor/hunspell/src/hunspell/hashmgr.hxx:32:21: warning: private field
      'userword' is not used [-Wunused-private-field]
  int               userword;
                    ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunspell.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunzip.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/phonet.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/replist.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/suggestmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/parsers/textparser.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string16.o
  LIBTOOL-STATIC Release/hunspell.a
  CXX(target) Release/obj.target/spellchecker/src/main.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_hunspell.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
../src/spellchecker_mac.mm:184:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...globalLang = currentGlobalLanguage ? currentGlobalLanguage : autoLangauge;
     ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/spellchecker_mac.mm:185:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...ourLang = this->spellCheckerLanguage ? this->spellCheckerLanguage : autoLangauge;
     ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [Release/obj.target/spellchecker/src/spellchecker_mac.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 17.0.0
gyp ERR! command "/usr/local/Cellar/node/8.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pmonks/Development/symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

@pmonks
Copy link
Contributor

pmonks commented Oct 9, 2017

Looks like rev 89e8238 that @VikasShashidhar just committed fixes the issue - I can now build.

@lneir lneir closed this as completed Oct 9, 2017
@bluechips23
Copy link
Author

bluechips23 commented Oct 9, 2017

Hey @pmonks did you have to do anything else to build this? I am still getting the error.

These are the steps I am following now:

  1. Create a brand new git clone
  2. CD to the SymphonyElectron directory
  3. npm install

I did git fetch and git pull and I can confirm I have the newest code, yet I still get the following error:

npm install

> @paulcbetts/spellchecker@4.0.5 install /Users/bluechips23/Dev/Symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/md5.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string_piece.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict_reader.o
../vendor/hunspell/src/google/bdict_reader.cc:670:15: warning: unused variable 'begin' [-Wunused-variable]
  const char* begin = reinterpret_cast<const char*>(&bdict_data_[cur_offset_]);
              ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
In file included from ../vendor/hunspell/src/hunspell/affentry.cxx:9:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  struct hentry *      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                                                      ~ ^~~~
                                                                                                        0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  struct hentry *   check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                                                               ~ ^~~~
                                                                                                                 0
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: warning: while loop has empty body [-Wempty-body]
                        while (p && *p != ']' && ((p = nextchar(p)) != NULL));
                                                                             ^
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: note: put the semicolon on a separate line to silence this warning
3 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affixmgr.o
In file included from ../vendor/hunspell/src/hunspell/affixmgr.cxx:12:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  struct hentry *      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                                                      ~ ^~~~
                                                                                                        0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  struct hentry *   check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                                                               ~ ^~~~
                                                                                                                 0
2 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/csutil.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/dictmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/filemgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hashmgr.o
In file included from ../vendor/hunspell/src/hunspell/hashmgr.cxx:9:
../vendor/hunspell/src/hunspell/hashmgr.hxx:32:21: warning: private field 'userword' is not used [-Wunused-private-field]
  int               userword;
                    ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunspell.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunzip.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/phonet.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/replist.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/suggestmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/parsers/textparser.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string16.o
  LIBTOOL-STATIC Release/hunspell.a
  CXX(target) Release/obj.target/spellchecker/src/main.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_hunspell.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
../src/spellchecker_mac.mm:184:13: error: cannot initialize a variable of type 'NSString *' with an rvalue of type 'const NSString *'
  NSString* globalLang = currentGlobalLanguage ? currentGlobalLanguage : autoLangauge;
            ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/spellchecker_mac.mm:185:13: error: cannot initialize a variable of type 'NSString *' with an rvalue of type 'const NSString *'
  NSString* ourLang = this->spellCheckerLanguage ? this->spellCheckerLanguage : autoLangauge;
            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [Release/obj.target/spellchecker/src/spellchecker_mac.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/8.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bluechips23/Dev/Symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

@VishwasShashidhar
Copy link
Contributor

@bluechips23 You may have probably upgraded to the latest XCode.

  1. Open XCode and accept the license agreement. That should fix things.
  2. If not, Install XCode command line tools and restart your system (optional, but, a good thing anyway).

One of the above should fix your issue.

@VishwasShashidhar
Copy link
Contributor

If you've not installed XCode, please install it.

@pmonks
Copy link
Contributor

pmonks commented Oct 9, 2017

@bluechips23 FWIW I use the following script to build (npm seems to do a poor job of keeping itself and SymphonyElectron's modules up to date):

#!/bin/sh
npm i -g npm
if [ -d ./node_modules ]; then rm -rf ./node_modules; fi
npm install
npm run unpacked-mac

@VishwasShashidhar
Copy link
Contributor

@pmonks You really don't need to do all of the above. Just run npm i in case there are new dependencies.

@pmonks
Copy link
Contributor

pmonks commented Oct 10, 2017

@VishwasShashidhar in theory that's true. In practice I've found npm to be... ...a "tad" unreliable. 😉

@bluechips23
Copy link
Author

Thanks @pmonks and @VishwasShashidhar - I finally got this to work. I had the newest XCode - 9.1 beta 2. After uninstalling it and reinstalling XCode 8.3, npm install works.

@pmonks
Copy link
Contributor

pmonks commented Oct 13, 2017

This just started recurring for me:

  CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
../src/spellchecker_mac.mm:184:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...globalLang = currentGlobalLanguage ? currentGlobalLanguage : autoLangauge;
     ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/spellchecker_mac.mm:185:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...ourLang = this->spellCheckerLanguage ? this->spellCheckerLanguage : autoLangauge;
     ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [Release/obj.target/spellchecker/src/spellchecker_mac.o] Error 1

My install of Xcode recently updated itself (to Version 9.0 (9A235)), and I wonder if that's the issue here - a version incompatibility between that spellchecker package and Xcode v9+?

@VishwasShashidhar
Copy link
Contributor

@pmonks You may have switched branches perhaps? On "master", it's working fine for me and on Jenkins too.

@pmonks
Copy link
Contributor

pmonks commented Oct 14, 2017

Yeah I'm on master too:

pmonks@mthay ~/D/s/SymphonyElectron$ git branch
* master
pmonks@mthay ~/D/s/SymphonyElectron$

Are you building with Xcode v9?

@bluechips23
Copy link
Author

bluechips23 commented Oct 14, 2017

If two people with two different machines are having the same issue, then chances are there will be more folks who are going to have the same problem when they upgrade to Xcode 9+.

Looks like @VishwasShashidhar is aware of this issue as reported here electron-userland/electron-spellchecker#88

But I don't think this really solves the problem. At least it didn't for me or for @pmonks.

Please see if you can reproduce this on a clean machine with XCode 9. I ran into this issue on a brand new Mac with newest XCode. Only downgrading to Xcode 8.3 solved it for me.

@VishwasShashidhar
Copy link
Contributor

@pmonks @bluechips23 I've got the same XCode version on my laptop too. If you are facing the 4.0.6 version of electron-spellchecker, you shouldn't face this issue as it has been fixed in that version.

It's weird that you folks are facing the issue. Could you try and do a clean install of the Symphony repo and see if you can repro the issue.

@pmonks
Copy link
Contributor

pmonks commented Oct 16, 2017

Fresh checkout & build:

Script started on Mon Oct 16 08:53:51 2017
bash-3.2$ export TERM=dumb
bash-3.2$ git clone https://github.com/symphonyoss/SymphonyElectron.git
Cloning into 'SymphonyElectron'...
remote: Counting objects: 2538, done.        
[snip]
remote: Compressing objects: 100% (54/54), done.        
[snip]
Receiving objects: 100% (2538/2538), 9.04 MiB | 13.36 MiB/s, done.
[snip]
Resolving deltas: 100% (1506/1506), done.
bash-3.2$ cd SymphonyElectron
bash-3.2$ npm i -g npm
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
+ npm@5.5.1
updated 1 package in 7.973s
bash-3.2$ npm install

> @paulcbetts/spellchecker@4.0.5 install /Users/pmonks/Development/symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
> node-gyp rebuild

  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/md5.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string_piece.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict_reader.o
../vendor/hunspell/src/google/bdict_reader.cc:670:15: warning: unused variable
      'begin' [-Wunused-variable]
  const char* begin = reinterpret_cast<const char*>(&bdict_data_[cur_offset_]);
              ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
In file included from ../vendor/hunspell/src/hunspell/affentry.cxx:9:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                 ~ ^~~~
                                                                   0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                ~ ^~~~
                                                                  0
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: warning: while loop has
      empty body [-Wempty-body]
                        while (p && *p != ']' && ((p = nextchar(p)) != NULL));
                                                                             ^
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: note: put the semicolon on
      a separate line to silence this warning
3 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affixmgr.o
In file included from ../vendor/hunspell/src/hunspell/affixmgr.cxx:12:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                 ~ ^~~~
                                                                   0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                ~ ^~~~
                                                                  0
2 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/csutil.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/dictmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/filemgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hashmgr.o
In file included from ../vendor/hunspell/src/hunspell/hashmgr.cxx:9:
../vendor/hunspell/src/hunspell/hashmgr.hxx:32:21: warning: private field
      'userword' is not used [-Wunused-private-field]
  int               userword;
                    ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunspell.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunzip.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/phonet.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/replist.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/suggestmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/parsers/textparser.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string16.o
  LIBTOOL-STATIC Release/hunspell.a
  CXX(target) Release/obj.target/spellchecker/src/main.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_hunspell.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
../src/spellchecker_mac.mm:184:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...globalLang = currentGlobalLanguage ? currentGlobalLanguage : autoLangauge;
     ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/spellchecker_mac.mm:185:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...ourLang = this->spellCheckerLanguage ? this->spellCheckerLanguage : autoLangauge;
     ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [Release/obj.target/spellchecker/src/spellchecker_mac.o] Error 1
�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mbuild error�[0m 
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m Error: `make` failed with exit code: 2
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at emitTwo (events.js:125:13)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at ChildProcess.emit (events.js:213:7)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mSystem�[0m Darwin 17.0.0
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mcommand�[0m "/usr/local/Cellar/node/8.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mcwd�[0m /Users/pmonks/Development/symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mnode -v�[0m v8.7.0
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mnode-gyp -v�[0m v3.6.2
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mnot ok�[0m 
�[0mnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: screen-snippet@git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1 (node_modules/screen-snippet):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for screen-snippet@1.0.1: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @paulcbetts/spellchecker@4.0.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @paulcbetts/spellchecker@4.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/pmonks/.npm/_logs/2017-10-16T15_55_21_580Z-debug.log
bash-3.2$ xcodebuild -version
Xcode 9.0
Build version 9A235
bash-3.2$ exit
exit

Script done on Mon Oct 16 08:55:50 2017

It looks like npm is still picking up v4.0.5 of @paulcbetts/spellchecker (look for > @paulcbetts/spellchecker@4.0.5 install in the output above), which is strange, given that electron-spellchecker v1.1.2 is dependent on v4.0.6.

What might be causing npm to mess up the transitive dependency versions like that?

@VishwasShashidhar
Copy link
Contributor

That's weird! Can you try clearing npm cache and see if that makes any difference?

@pmonks
Copy link
Contributor

pmonks commented Oct 17, 2017

That didn't seem to help:

Script started on Mon Oct 16 21:08:37 2017
bash-3.2$ export TERM=dumb
bash-3.2$ xcodebuild -version
Xcode 9.0.1
Build version 9A1004
bash-3.2$ git clone https://github.com/symphonyoss/SymphonyElectron.git
Cloning into 'SymphonyElectron'...
remote: Counting objects: 2538, done.        
[snip]
remote: Compressing objects: 100% (54/54), done.        
[snip]
Receiving objects: 100% (2538/2538), 9.04 MiB | 11.78 MiB/s, done.
[snip]
Resolving deltas: 100% (1506/1506), done.
bash-3.2$ cd SymphonyElectron
bash-3.2$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
bash-3.2$ npm i -g npm
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
+ npm@5.5.1
updated 1 package in 8.557s
bash-3.2$ npm install

> @paulcbetts/spellchecker@4.0.5 install /Users/pmonks/Development/symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
> node-gyp rebuild

  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/md5.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string_piece.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict_reader.o
../vendor/hunspell/src/google/bdict_reader.cc:670:15: warning: unused variable
      'begin' [-Wunused-variable]
  const char* begin = reinterpret_cast<const char*>(&bdict_data_[cur_offset_]);
              ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/google/bdict.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
In file included from ../vendor/hunspell/src/hunspell/affentry.cxx:9:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                 ~ ^~~~
                                                                   0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                ~ ^~~~
                                                                  0
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: warning: while loop has
      empty body [-Wempty-body]
                        while (p && *p != ']' && ((p = nextchar(p)) != NULL));
                                                                             ^
../vendor/hunspell/src/hunspell/affentry.cxx:546:57: note: put the semicolon on
      a separate line to silence this warning
3 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affixmgr.o
In file included from ../vendor/hunspell/src/hunspell/affixmgr.cxx:12:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                 ~ ^~~~
                                                                   0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit
      conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
  ...int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                ~ ^~~~
                                                                  0
2 warnings generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/csutil.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/dictmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/filemgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hashmgr.o
In file included from ../vendor/hunspell/src/hunspell/hashmgr.cxx:9:
../vendor/hunspell/src/hunspell/hashmgr.hxx:32:21: warning: private field
      'userword' is not used [-Wunused-private-field]
  int               userword;
                    ^
1 warning generated.
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunspell.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunzip.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/phonet.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/replist.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/suggestmgr.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/parsers/textparser.o
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/base/strings/string16.o
  LIBTOOL-STATIC Release/hunspell.a
  CXX(target) Release/obj.target/spellchecker/src/main.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_hunspell.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
../src/spellchecker_mac.mm:184:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...globalLang = currentGlobalLanguage ? currentGlobalLanguage : autoLangauge;
     ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/spellchecker_mac.mm:185:13: error: cannot initialize a variable of type
      'NSString *' with an rvalue of type 'const NSString *'
  ...ourLang = this->spellCheckerLanguage ? this->spellCheckerLanguage : autoLangauge;
     ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [Release/obj.target/spellchecker/src/spellchecker_mac.o] Error 1
�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mbuild error�[0m 
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m Error: `make` failed with exit code: 2
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at emitTwo (events.js:125:13)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at ChildProcess.emit (events.js:213:7)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mstack�[0m     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mSystem�[0m Darwin 17.0.0
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mcommand�[0m "/usr/local/Cellar/node/8.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mcwd�[0m /Users/pmonks/Development/symphony/SymphonyElectron/node_modules/@paulcbetts/spellchecker
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mnode -v�[0m v8.7.0
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mnode-gyp -v�[0m v3.6.2
�[0m�[37;40mgyp�[0m �[0m�[31;40mERR!�[0m �[0m�[35mnot ok�[0m 
�[0mnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: screen-snippet@git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1 (node_modules/screen-snippet):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for screen-snippet@1.0.1: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @paulcbetts/spellchecker@4.0.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @paulcbetts/spellchecker@4.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/pmonks/.npm/_logs/2017-10-17T04_10_25_517Z-debug.log
bash-3.2$ exit
exit

Script done on Mon Oct 16 21:10:28 2017

@pmonks
Copy link
Contributor

pmonks commented Oct 17, 2017

I also tried whacking ~/.npm, but that didn't help either.

@lock
Copy link

lock bot commented Jun 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants