Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

trouble building on OpenBSD #87

Open
bonds opened this issue Dec 27, 2017 · 1 comment
Open

trouble building on OpenBSD #87

bonds opened this issue Dec 27, 2017 · 1 comment

Comments

@bonds
Copy link

bonds commented Dec 27, 2017

In my attempt to build https://github.com/ssbc/patchwork on my OpenBSD box I ran into this error building node-spellchecker on which patchwork depends:

~/s/config (master|✔) ❯❯❯ npm install spellchecker                          Wed 2017-12-27 11:26:14 -0800

> [email protected] install /home/scott/node_modules/spellchecker
> node-gyp rebuild

gyp: name 'spellchecker_use_hunspell' is not defined while evaluating condition 'spellchecker_use_hunspell=="true"' in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System OpenBSD 6.2
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/scott/node_modules/spellchecker
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/scott/package.json'
npm WARN scott No description
npm WARN scott No repository field.
npm WARN scott No README data
npm WARN scott No license field.
npm ERR! OpenBSD 6.2
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "spellchecker"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spellchecker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs spellchecker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls spellchecker
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/scott/src/config/npm-debug.log
@bonds
Copy link
Author

bonds commented Dec 27, 2017

Well, duh:

'conditions': [
['OS=="mac"', {
'spellchecker_use_hunspell%': 'true',
}],
['OS=="linux"', {
'spellchecker_use_hunspell': 'true',
}],
['OS=="win"', {
'spellchecker_use_hunspell': 'true',
}],
],

...let's see what happens when I blindly enable OpenBSD there:

diff --git a/binding.gyp b/binding.gyp
index bfb0fa4..9d36938 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -7,6 +7,9 @@
       ['OS=="linux"', {
         'spellchecker_use_hunspell': 'true',
       }],
+      ['OS=="openbsd"', {
+        'spellchecker_use_hunspell': 'true',
+      }],
       ['OS=="win"', {
         'spellchecker_use_hunspell': 'true',
       }],
@@ -59,6 +62,12 @@
              'src/transcoder_posix.cc',
           ],
         }],
+        ['OS=="openbsd"', {
+          'sources': [
+             'src/spellchecker_linux.cc',
+             'src/transcoder_posix.cc',
+          ],
+        }],
         ['OS=="mac"', {
           'sources': [
             'src/spellchecker_mac.mm',

Ok, new error:

~/t/node-spellchecker (master|✚1) ❯❯❯ npm install                           Wed 2017-12-27 11:42:07 -0800

> [email protected] install /home/scott/tmp/node-spellchecker
> node-gyp rebuild

gmake: Entering directory '/home/scott/tmp/node-spellchecker/build'
  /usr/bin/clang++ '-DNODE_GYP_MODULE_NAME=hunspell' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHUNSPELL_STATIC' -I/home/scott/.node-gyp/6.11.2/include/node -I/home/scott/.node-gyp/6.11.2/src -I/home/scott/.node-gyp/6.11.2/deps/uv/include -I/home/scott/.node-gyp/6.11.2/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=c++11 -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o.d.raw   -c -o Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o ../vendor/hunspell/src/hunspell/affentry.cxx
In file included from ../vendor/hunspell/src/hunspell/affentry.cxx:9:
../vendor/hunspell/src/hunspell/affentry.hxx:30:94: error: cannot initialize a parameter of type
      'unsigned short' with an rvalue of type 'nullptr_t'
  ...*      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                                  ^          ~~~~
../vendor/hunspell/src/hunspell/affentry.hxx:30:94: note: passing argument to parameter 'needflag' here
../vendor/hunspell/src/hunspell/affentry.hxx:93:103: error: cannot initialize a parameter of type
      'unsigned short' with an rvalue of type 'nullptr_t'
  ...char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                    ^          ~~~~
../vendor/hunspell/src/hunspell/affentry.hxx:93:103: note: passing argument to parameter 'needflag' here
../vendor/hunspell/src/hunspell/affentry.cxx:544:47: warning: while loop has empty body [-Wempty-body]
                        while (p && *p != ']' && (p = nextchar(p)));
                                                                   ^
../vendor/hunspell/src/hunspell/affentry.cxx:544:47: note: put the semicolon on a separate line to
      silence this warning
1 warning and 2 errors generated.
gmake: *** [hunspell.target.mk:105: Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o] Error 1
gmake: Leaving directory '/home/scott/tmp/node-spellchecker/build'
gyp ERR! build error
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:278:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System OpenBSD 6.2
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/scott/tmp/node-spellchecker
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm WARN [email protected] No license field.
npm ERR! OpenBSD 6.2
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spellchecker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs spellchecker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls spellchecker
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/scott/tmp/node-spellchecker/npm-debug.log

Is that progress? Not much. ;) FWIW hunspell, the executable, is installed and runs fine on my OpenBSD box. Maybe its installed with LibreOffice?

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

1 participant