node-nw-snapshot
node-nw-snapshot copied to clipboard
32bit limitation on OSX and Windows
I've tried to change the configs.js architecture from "ia32" to "x64" as I realized it's only building in 32 bit, but then I got the error:
Only ia32 is supported on osx and windows
Is there a reason for this? I'm curious :)
Yea, when i made the tool, there was no x64 distribution of node-webkit for OS X and windows. There is now though. I'll implement a version check.
Thanks, I'd love to use the x64 version, especially since the newer macs all have 64 bit.
Hi Mikkel, is there a chance this will get added? Using 32bit is kind of outdated already, especially for Macs.
Yea sorry i sort of forgot about this again. I'll take a look at it sometime this week!
I just published 0.2.0. Please check if it works as expected :)
see 6c1bbc1f003273bc3d6ed2554b7cce71f69d5e0f for implementation details.
Also i've updated the docs to include command line arguments / npm config for arch.
Oh i almost forgot. Be aware that the default ports have changed to allow for x64 on osx and windows.
Server socket ports:
- osx32 servers will use 3001
- osx64 servers will use 3002
- win32 servers will use 3011
- win64 servers will use 3012
- linux32 servers will use 3021
- linux64 servers will use 3022
Server http ports:
- osx32 servers will use 3301
- osx64 servers will use 3302
- win32 servers will use 3311
- win64 servers will use 3312
- linux32 servers will use 3321
- linux64 servers will use 3322
@chino23 Have you had a chance to check it out yet?
Hi Mikkel, sorry for the late reply.
Thanks for picking that up again! I really appreciate it.
I've updated to the latest version, and set the config ports to 3002 and 3302 for socket and http, as in the readme, as well as the architecture to x64, because I run the server with npm start nw-snapshot.
But then when I start the server, I see this:
Using arch from npm package configuration: x64
Using socket port from npm package configuration: x64
Using socket port from npm package configuration: x64
Using socket port from npm package configuration: #{config.sockPort}
Using http port from npm package configuration: #{config.httpPort}
Starting socket on port 3002
Starting http server on port 3302
Is this normal?
Then using the script I had before and what worked, (changed the port to 3002) nothing happens.
Is that maybe related to the name change of node-webkit to nw.js?
Yes, i put it in so you know what happens. Although this:
Using socket port from npm package configuration: #{config.sockPort}
Using http port from npm package configuration: #{config.httpPort}
is a coffee script leftover from using single quotes instead of double quotes.. silly me. And this is clearly a mistake:
Using socket port from npm package configuration: x64
Using socket port from npm package configuration: x64
i'm pretty sure i'm just concatenating the wrong variable though, i'll check it out. I've tested with 0.11.5 and it seems to work fine, you don't get any errors or anything?
Just published 0.2.1, please try again. It should work as before though, but i did mess up in a few places.
Thanks. But it's strange, what happens is that when I run
npm start nw-snapshot
I get the normal messaged the server has been started, but when I run the build script, it just says starting nwbuild but the connection to the server never happens. The server is just quiet, never gives an error or info messages in the console. It seems that the socket connection doesn't get established.
I have set the npm variables to socket 3002 and http 3302, arch to x64, and then in the build script it also says client.connect(3002...
You did update your servers too right?
Are you running the server(s) in a VM? If that's the case, did you remember to forward the right ports?
I'm running the server locally on Mac, the same way it used to work before.
A bit confused, update the servers? I just updated the node-nw-snapshot package, the servers are part of it, right? Then i just used the set port settings. Or am I missing something? :)
Right, then updating the package is enough (was thinking you might use VM's). Well, then i'm sorta stumped. The tests run fine (they connect to the server locally too).
Does it work using the default ports?
Can you maybe provide your buildscript so i can try to reproduce it?
Default ports don't seem to work either. I've tried switching back to 3001 and 3301
Here's the gulpfile
var exec = require('child_process').exec;
var NodeWebkitDownloader = require('nw-snapshot').Downloader;
var gulp = require('gulp');
var gutil = require('gulp-util');
var uglify = require('gulp-uglify');
var ngAnnotate = require('gulp-ng-annotate');
gulp.task('uglify', function() {
gulp.src('all.js')
.pipe(ngAnnotate())
.pipe(uglify('all.js', {
mangle: false,
output: {
beautify: true
}
}))
.pipe(gulp.dest('dist/ready'))
});
// Connect to tcp://127.0.0.1:3001
// Server socket ports:
//
// osx32 servers will use 3001
// osx64 servers will use 3002
// win32 servers will use 3011
// win64 servers will use 3012
// linux32 servers will use 3021
// linux64 servers will use 3022
// Server http ports:
//
// osx32 servers will use 3301
// osx64 servers will use 3302
// win32 servers will use 3311
// win64 servers will use 3312
// linux32 servers will use 3321
// linux64 servers will use 3322
gulp.task('nwbuild', function(callback){
SnapshotClient = require('nw-snapshot').Client;
var client = new SnapshotClient("0.11.6", './app.nw', './services.js');
client.connect(3002, function(){
client.on('done', function(snapshot){
require('fs').writeFileSync(require('path').join(__dirname, 'snapshot.bin'), snapshot);
});
client.on('progress', function(err, iteration) {
// Will run each time an iteration has failed.
console.log("Iteration #" + iteration + " failed: " + err);
});
client.on('fail', function(err, tries){
console.log("Failed to compile snapshot. Tried " + tries + " times.");
client.disconnect();
});
client.on('done', function(snapshot){
console.log('-------------------');
console.log('SNAPSHOT SUCCESSFUL');
console.log('-------------------');
client.disconnect();
});
// Run a maximum of 5 iterations.
client.build(20);
});
});
I will then do
npm start nw-snapshot
and afterwards
gulp nwbuild
in another terminal.