Comments (15)
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.
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.
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.
@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.
from node-packer.
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.
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.
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.
@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
?
from node-packer.
@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.
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.
@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.
@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.
@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.
Looks like I just need to sit our Public folder beside the executable and it works :D
from node-packer.
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)
- 放弃维护了吗? HOT 9
- npm installation?
- How to hide Windows command prompt after start a.exe file
- Cannot create destination file: No such file or directory HOT 3
- Linux Exceutable Decompiling
- Will there be Nodec with Node.js 10 LTS HOT 3
- Getting Error - No such file or directory @ rb_sysopen HOT 2
- How do I separate the configuration from being compiled? HOT 1
- nodec-v1.5.0-x64 throw errors "No such file or directory - node -pe process.arch"
- How to build nodec for Window? HOT 4
- Is ARM supported? HOT 1
- i don't know how to install Linux operating system HOT 1
- Windows version does not work (Win10, nodec 1.5.0 x64) HOT 3
- Can we resurrect node-packer to get it working with latest Node.js versions? HOT 35
- Assertion `backup_off == lseek_off' failed. HOT 2
- how to use the latest source code to build binary, instead of using the old 1.5.0 version? HOT 3
- ../deps/uv/include/uv.h:37:10: fatal error: enclose_io.h: No such file or directory HOT 4
- Can the packaged executable file effectively protect the source code? HOT 1
- fatal error: Killed signal terminated program cc1 HOT 1
- fatal error: enclose_io.h: No such file or directory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-packer.