node-lmdb icon indicating copy to clipboard operation
node-lmdb copied to clipboard

Build errors under Node 16.1.0

Open michaelfig opened this issue 4 years ago • 9 comments
trafficstars

Refs Agoric/agoric-sdk#2977

This is apparently caused by older stdc++ compiler flags.

Please see uhop/node-re2#100 for another package that was plagued by this and found a fix.

  CXX(target) Release/obj.target/node-lmdb/src/node-lmdb.o
In file included from /home/warner/.cache/node-gyp/16.1.0/include/node/v8.h:30,
                 from ../src/node-lmdb.h:29,
                 from ../src/node-lmdb.cpp:24:
/home/warner/.cache/node-gyp/16.1.0/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
/home/warner/.cache/node-gyp/16.1.0/include/node/v8-internal.h:452:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
  452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
      |                                      ^~~~~~~~~~~
      |                                      remove_cv
...

michaelfig avatar May 12 '21 06:05 michaelfig

@kriszyp nice updates .. could you please make MR here, since you've already made a new commit on your forking repo?

firdausious avatar Jul 02 '21 08:07 firdausious

I've actually still been trying to figure out the best compiler configuration across multiple projects, as the referencing fix caused a regression for at least one computer in the world: https://github.com/DoctorEvidence/lmdb-store/issues/46. I am hoping that the most reliable config is simply to not specify the C++ version at all (always just let it the compiler use latest). Just committed a fix that does, if you want to give that a try. Let me know if you want me to publish it first.

kriszyp avatar Jul 02 '21 12:07 kriszyp

I am hoping that the most reliable config is simply to not specify the C++ version at all (always just let it the compiler use latest). Just committed a fix that does, if you want to give that a try. Let me know if you want me to publish it first.

I've tested node-lmdb@Venemo/node-lmdb#b96ef731a6 against Node.js 16.8.0 under MacOS and Ubuntu, and it works just fine. Thanks!

Please publish a new version of node-lmdb, then I think it's safe to close this issue.

michaelfig avatar Sep 02 '21 02:09 michaelfig

Ok, I published v0.9.5 with the latest.

kriszyp avatar Sep 02 '21 03:09 kriszyp

Ok, I published v0.9.5 with the latest.

Wow, fast! It works perfectly for me. This bug is squashed!

michaelfig avatar Sep 02 '21 03:09 michaelfig

I've been still experiencing this issue today. The solution was to prefix the commands which involve building dependencies with CXXFLAGS="--std=c++14", eg:

CXXFLAGS="--std=c++14" agoric install

robert-zaremba avatar Nov 22 '21 22:11 robert-zaremba

@robert-zaremba Pushed a fix to specify C++ version based on node version, if you want to try from master. Otherwise I will publish later.

kriszyp avatar Nov 23 '21 05:11 kriszyp

@robert-zaremba I want to make sure I understand what is happening here before proceeding, as this change does have potential for causing regression for other users. How is that your system has C++, but ends up compiling the code with an older version? For all other users/machine, I believe the C++ is automatically compiled with the latest C++ version. Do you have another part of your build that is defaulting the C++ version to 11?

(or is it possible that you were attempting to install/build an older version of node-lmdb that was specifying an incorrect C++ version, and this has already been fixed, as apparently other users seem to have reported this as fixed).

kriszyp avatar Nov 23 '21 12:11 kriszyp

I have published v0.9.6 with a significantly expanded set of prebuilds, which should hopefully eliminate the need for compilation in this situation.

kriszyp avatar Nov 27 '21 14:11 kriszyp