Giter VIP home page Giter VIP logo

Comments (15)

pmq20 avatar pmq20 commented on July 20, 2024 2

I was planning to scan and statically link all native modules during compile time (theoretically it is feasible since we are building from the source and could make some change to how native modules are loaded), but failed to find time to do it. I'll implement it as soon as possible. Thanks for the feedback!

from node-packer.

pmq20 avatar pmq20 commented on July 20, 2024 1

Node.js Compiler v1.0.0 released! Native C++ modules are fully supported now.

https://github.com/pmq20/node-compiler/releases/tag/v1.0.0

@mauron85 Could you have a try and let me know if it works for you? Thanks!

from node-packer.

Dexus avatar Dexus commented on July 20, 2024

I dont know node-compiler but did you nodec run with --npm-package=node-time-uuid ?
Maybe you need compile native before you can use it?

from node-packer.

pmq20 avatar pmq20 commented on July 20, 2024

@mauron85 Native modules are starting to work on the master branch, if you are urgent you could clone the repo and run nodec from master to try it. I'll release it once I have tested it thoroughly.

image

from node-packer.

firrae avatar firrae commented on July 20, 2024

Hey @pmq20,

I just tried this out on an application I'm working on. It says it built but throws:

return process.dlopen(module, path._makeLong(filename));
                 ^
Error: dlopen(/__enclose_io_memfs__/node_modules/bcrypt/lib/binding/bcrypt_lib.node, 1): image not found

Seems like bcrypt wasn't built/included into the build? Is this an error or potentially something I did wrong? I have Node 8 installed on my Macbook and am using V1.0.0.

from node-packer.

firrae avatar firrae commented on July 20, 2024

To note I also get a number of ../deps/libsquash/sample/enclose_io_common.h:38:28: warning: variadic macros are a C99 feature [-Wvariadic-macros] in the build process. ex:

../deps/libsquash/sample/enclose_io_common.h:40:29: warning: variadic macros are a C99 feature [-Wvariadic-macros]

../deps/libsquash/sample/enclose_io_common.h:49:22: warning: variadic macros are a C99 feature [-Wvariadic-macros]

Could this be related?

from node-packer.

ptusch avatar ptusch commented on July 20, 2024

I tried this as well with sqlite3 with issues as well:

/Release/obj.target/openssl/deps/openssl/openssl/crypto/cpt_err.o ../deps/openssl/openssl/crypto/cpt_err.c
deps/libsquash/enclose_io_libsquash.target.mk:97: recipe for target '/tmp/nodec/node/out/Release/obj.target/enclose_io_libsquash/deps/libsquash/sample/enclose_io_memfs.o' failed
make[1]: *** [/tmp/nodec/node/out/Release/obj.target/enclose_io_libsquash/deps/libsquash/sample/enclose_io_memfs.o] Error 1
make[1]: *** Waiting for unfinished jobs....
rm c2142693082db8da77c35c9808dbcddd987ca620.intermediate
Makefile:76: recipe for target 'node' failed
make: *** [node] Error 2
Failed running ["make -j4"]

My index.js I'm trying to compile:

console.log(process.version)

var knex = require('knex')({
  dialect: 'sqlite3',
  connection: {
    filename: './data.db'
  }
});

// Create a table
knex.schema.createTableIfNotExists('users', function(table) {
  table.increments('id');
  table.string('user_name');
})

// ...and another
.createTableIfNotExists('accounts', function(table) {
  table.increments('id');
  table.string('account_name');
  table.integer('user_id').unsigned().references('users.id');
})

// Then query the table...
.then(function() {
  return knex.insert({user_name: 'Tim'}).into('users');
})

// ...and using the insert id, insert into the other table.
.then(function(rows) {
  return knex.table('accounts').insert({account_name: 'knex', user_id: rows[0]});
})

// Query both of the rows.
.then(function() {
  return knex('users')
    .join('accounts', 'users.id', 'accounts.user_id')
    .select('users.user_name as user', 'accounts.account_name as account');
})

// .map over the results
.map(function(row) {
  console.log(row);
})

// Finally, add a .catch handler for the promise chain
.catch(function(e) {
  console.error(e);
})
.finally(() => {
  return knex.destroy();
});

I'm using nvm with node8.
I used the fresh [email protected]

Compiling normal packages works nicely.

from node-packer.

pmq20 avatar pmq20 commented on July 20, 2024

@firrae I failed to reproduce this on my local machine. See the screenshot. Could you check your build log to see if some error occurs when building bcrypt?

image

from node-packer.

pmq20 avatar pmq20 commented on July 20, 2024

@ptusch Do you have more message regarding this particular failure:

deps/libsquash/enclose_io_libsquash.target.mk:97: recipe for target '/tmp/nodec/node/out/Release/obj.target/enclose_io_libsquash/deps/libsquash/sample/enclose_io_memfs.o' failed

The error message is too much truncated for a diagnosis.

from node-packer.

pmq20 avatar pmq20 commented on July 20, 2024

Ping @ptusch

Ping @firrae

Also, have you cleaned your temporary directory that the compiler uses? If old directory generated by nodec 0.x is used then it would be problematic. It needs to be cleaned when a compiler of a new version is used. I should fix this in a precautionary way: #42

from node-packer.

ptusch avatar ptusch commented on July 20, 2024

@pmq20 Please forgive me, I think I forgot to add sqlite3 to the package.json.
I just reinstalled and everything went as expected.

Well done btw!

from node-packer.

firrae avatar firrae commented on July 20, 2024

@pmq20 where would the cache be? I had used nodec before the latest version so that may be it. I'm digging around to see if I can find it on my own. I am on a Mac.

from node-packer.

firrae avatar firrae commented on July 20, 2024

@pmq20 nevermind, I see it's a command line option. Rebuild seems to have worked well. Now I just need to figure out the sequence of flags needed to include our public folder and it looks like it'll work. This is awesome. Thanks!

from node-packer.

firrae avatar firrae commented on July 20, 2024

Looks like I just need to sit our Public folder beside the executable and it works :D

from node-packer.

lexor90 avatar lexor90 commented on July 20, 2024

Closing this as native modules support has been added in v1.0.0.
Feel free to re-open it should you need it

from node-packer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.