particle-iot/spark-cli

Bump serialport to 1.5.0

Closed this issue · 16 comments

See: https://github.com/voodootikigod/node-serialport/blob/master/changelog.md#version-146

Seems like 1.4.6 onwards there's a fix for issues in Windows.

1.) Need to test for any breaking changes for all spark serial related functions

2.) Test on a real Windows machine to figure out how things are going in terms of installation issues

I'm working on the automated testing using kitchen.ci to spin up some windows box, install spark-cli and do the installation testing.

Hope to have some good news soon.

Also asked for help in the community for people facing similar (windows related) issue: https://community.spark.io/t/spark-cli-on-windows8-1-x64/9997/5

@kennethlimcp great news RE: node-serialport. thanks!
kitchen CI sounds interesting as well. I'm curious to see what you come up with.

Tested working
1.) Mac OSx 10.9.5 node-serialport@1.4.6
2.) Microsoft Windows 7 Enterprise 6.1.7601 Service Pack 1 Build 7601@1.5.0 (1.4.6 failed)

@emilyrose, can you create a new branch with the serialport referenced to 1.5.0? I'm cooking up a simple bat file that will install all the windows dependencies and git clone the branch with the change to see how things go!

Steps taken

  • clone repo locally
  • edit package.json file to use 1.5.0 for serialport
  • cd to js folder and run sudo npm install
  • cd to bin folder
  • use node spark.js xxxxxxxxxx to test spark identify and spark setup wifi

@joegoggins, there's no good working image for windows as of now to test and kitchen.ci is also working on a windows integration in the next release. The closest i could get was for kitchen.ci to boot up windows successfully but stuck at getting a respond of it being up and running.

I'm hoping that we can test out installation on variants of windows start from XP to 8.1 and x32/x64.
Kitchen.ci definitely sounds like the right tool and i'm slightly familiar to set things up.

Meanwhile, i will grab a few official Windows x32 images, write a .bat file and install all the dependencies for Spark-cli to see what dependencies are required for a green build on all of them


Appveyor setup

1.) Using a Windows CI to test out the 1.5.0 installation
2.) My branch: https://github.com/kennethlimcp/spark-cli/tree/serialport/1.5.0
3.) Build sample: https://ci.appveyor.com/project/kennethlimcp/spark-cli/build/1.0.15

Some issues:
1.) Default Windows box is Server 2012
2.) Already pre-installed with required dependencies (can't test from fresh install)
3.) Unable to determine pass/fail installation yet

there are now pre-compiled binaries for serialport but in my tests, only 1.5.0 is working for windows platform

This is awesome! I will be happy to make a test branch for you if it will make things any easier for you.

This should also help with people trying to use io.js instead of node ;)

@whoisjake great point!

Hey @kennethlimcp , cool idea using Test Kitchen to verify that the CLI works on all platforms. Though this could be pretty awesome, setting it up right could prove tricky if you want to bridge serial communication between the host and the guest VM, and you might run into failing tests that are a result of misconfiguration here rather than a real failure. Maybe, maybe not--I'm not sure, worth mentioning though.

If you're interested in exploring this approach further for Windows, this looks like a promising project, linked to from the Chef "bento" project.

Great feedback @joegoggins! I think the main issue is to know which variant of windows is failing the installation and the failure is always one particular package, in this case serialport on windows.

There are no tests on spark-cli yet but I got a travis ci boilerplate on my forked repo working for now.

It would be nice to verify that this newer version of serialport works across majority of the windows variant confidently so that we can bump the version here and I can change my tutorial!

@joegoggins, i'm not able to build windows virtualbox images as it requires VMware fusion. It's just a pity that testing on Windows is really tough at this point in time.

@dmiddlecamp, will you be able to make the call on bumping this to V1.5.0? I think it should help much more people install Spark-cli smoothly since node-serialport is the only package being a showstopper everytime.

I can verify and demostrate that V1.5.0 installs since on the fresh windows copy: https://ci.appveyor.com/project/kennethlimcp/spark-cli/build/1.0.15

2/6 failed build on 1.5.0: https://ci.appveyor.com/project/kennethlimcp/spark-cli/build/1.0.36

Technically 1/6 since one is tested against io.js

4/6 failed build on 1.4.5: https://ci.appveyor.com/project/kennethlimcp/spark-cli/build/1.0.39

1.4.5 has this as the error

..\src\serialport_win.cpp(254): error C2039: 'New' : is not a member of 'v8::String' [C:\projects\spark-cli\js\node_modules\serialport\build\serialport.vcxproj]
          C:\Users\appveyor\.node-gyp\0.11.16\deps\v8\include\v8.h(1599) : see declaration of 'v8::String'
..\src\serialport_win.cpp(254): error C3861: 'New': identifier not found [C:\projects\spark-cli\js\node_modules\serialport\build\serialport.vcxproj]

Which appears to have been fixed:
serialport/node-serialport#459

And 1.5.0 has this:

LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [C:\projects\spark-cli\js\node_modules\serialport\build\serialport.vcxproj]

This screams of an ENV issue... I don't think that kernel32.lib would be missing on a Windows machine... If I search google for the error, every single result says that the SDK path was incorrect for the build... hence not being able to find kernel32.lib

What's strange is, how is it working for the other builds and not those two in particular? Weird

@whoisjake, good input. Obviously you can see a beginner at work and i might not 100% proficient in doing what i'm trying to do!

I wished i could spin up a ton of windows images but sadly that's not possible without some licensing + manual testing unlike what Appveyor testing. Kind of hard to replicate and test...

@kennethlimcp thanks for your hard work! just doing a touch of investigative work...

2 users who managed to install with 1.5.0 on windows:

https://community.spark.io/t/spark-cli-on-windows8-1-x64/9997/5

I've gone ahead and merged the PR by @kennethlimcp that bumps node-serialport to 1.5.0
Thanks to everyone that helped out with the Windows errors.

Closing this issue!