hexparrot / mineos-node

node.js implementation of mineos minecraft management
GNU General Public License v3.0
334 stars 170 forks source link

Problems compiling on FreeBSD 12.1 #312

Closed cross closed 4 years ago

cross commented 4 years ago

I opened this issue in mineos, but this might be the better place. https://github.com/hexparrot/mineos/issues/164

In the "Installing MineOS scripts" section, I cloned the repository, but when I get to echo "CXX=c++ npm install userid" | sh

it compiles for a while, and eventually fails with the following. Note that c++ is clang 8.0.1 on FreeBSD 12.1.

In file included from ../src/posix.cc:1:                                        
In file included from ../node_modules/nan/nan.h:203:                            
In file included from ../node_modules/nan/nan_new.h:189:                        
../node_modules/nan/nan_implementation_12_inl.h:103:42: error: no viable        
      conversion from 'v8::Isolate *' to 'Local<v8::Context>'                   
  return scope.Escape(v8::Function::New( isolate                                
                                         ^~~~~~~                                
/home/cross/.cache/node-gyp/12.10.0/include/node/v8.h:183:7: note: candidate    
      constructor (the implicit copy constructor) not viable: no known
      conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for
      1st argument
class Local {
      ^
/home/cross/.cache/node-gyp/12.10.0/include/node/v8.h:183:7: note: candidate
      constructor (the implicit move constructor) not viable: no known
      conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st
      argument
/home/cross/.cache/node-gyp/12.10.0/include/node/v8.h:187:13: note: candidate
      template ignored: could not match 'Local<type-parameter-0-0>' against
      'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/home/cross/.cache/node-gyp/12.10.0/include/node/v8.h:4139:22: note: passing
      argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^

There are a few warnings before this deprecations, some of which seem to be emitted by V8_DEPRECATED macros in node/v8.h. Those may be expected, but, wanted to note it in case I have the wrong sources or something.

cross commented 4 years ago

Okay. When it occurred to me that I should note in this issue the versions of node and npm I have, (12.10.0 and 6.11.3, respectively), I realized maybe I should try other versions.

node10 is available on FreeBSD 12.1 via pkg, and the npm for it (npm-node10). Removing the newer node/npm and installing node10/npm-node10, I still get warnings, but no longer the hard error. I can move forward.

Let me know if there can be a fix for node12.

hexparrot commented 4 years ago

Node continues to develop and change its api, which is good.

MineOS relies on many npm dependencies that largely may have seemed alive and well in 2015, but not so much in 2019, 2020.

More and more dependencies appear to fail to build in node 12 and beyond. This means I either need to:

1) update other's npm code base myself, to ensure compatibility (impractical) 2) update my code base to stop using those dependencies (practical, but a lot of work).

Not all of the functionality I want has alternative npm packages. userid is one of the biggest offenders, which doesn't build on the new releases, as you've noticed.

I'm worried we're stuck at node8 (or node10) forever, because I'm not all that motivated to try to find drop-in replacements for these utilities, which work so impressively well for their purpose--and doesn't warrant many hours of rewriting and testing.

There's so many deployments of the webui currently, and making big codebase changes can negatively impact thousands of users if not QA'd properly. The alternative I'm embracing is "Let's hope this thing stays afloat until Node.js 10 goes EOL in April 2021."

By then, either I'll have put in more time to finish mineos-ruby, or I'll retire. mineos-python, by the way, was released in January 2011, so it's been quite a long time of creating and supporting; I'm hoping mineos-ruby will reinvigorate my interest, but my current holdup is a new UI, which I just ... don't like working on.

tl;dr I'm really reluctant to think that mineos-node will be upgraded to node12.

cross commented 4 years ago

Okay. That's all reasonable. If you could please update https://minecraft.codeemo.com/mineoswiki/index.php?title=MineOS-node_(pkg_add) then I think saying "doesn't work with node12, make sure you're using node 8 or 10" is fine.