New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron support #20
Electron support #20
Conversation
Woot, my hero!! I'll take a look, hopefully it resolves both issues :-D |
I've tested with |
Also note that once the node-gyp build method has been proven, you may want to remove your Makefile and use node-gyp to do your release builds so that there is only a single build system to keep up to date. |
Ideally, there should be an automated way to build all these binaries, like with Travis or AppVeyor, because at the moment, I'm building them all manually. It's just when I was building this library I went with what I knew and I wanted to get something out quickly. And I had bad experiences with node-gyp back when it first came out as well and I'm sure it's gotten better now. Regardless, I want to take a close look at this entire library when robot 2.1 is released. Ideally I want to get everything over to ES6 and Nan as well as leverage more asynchronous functionality. But let's start with this and see if it solves the immediate issues with Electron/Webkit. |
Had chance to test the windows build... there were some minor issues for which I found simple solutions, but there's a kinda major one that's giving me problems - apparently VS 2010+ throws fits if two source files (and thus also resulting obj files) have the same name, even if they are in different directories. See here for a general discussion of this issue: |
Okay, got it sorted out by using an intermediate |
Updated and tested Linux build support - now builds cleanly on all three platforms. :-D |
@p120ph37: Hey there, great work! I'm working on getting this merged but I have a few questions. The first is, do we really need the Second, while I know the Ideally, I want everything to work as it did before but have the node-gyp option available for people that are unable to install precompiled binaries, or are using electron, etc. For robot-js 2.0, I'm thinking that we'll probably drop Node 0.12 support, convert everything to ES6, drop the custom project files in favor of node-gyp and maybe make use of nan (although the way I'm doing it now isn't the worst thing in the world, we'll see when Node 8 is released). But the pre-compiled feature is still great I think, it's how node-sass does it. |
"do we really need the The problem is that The other possible way (besides parsing the header files directly) would be to add a dev dependency on "what's going to happen during a typical The normal "Ideally, I want everything to work as it did before but have the node-gyp option available for people that are unable to install precompiled binaries, or are using electron, etc." Yep, that's what I was figuring too. |
Thank you for answering my questions and for all your hard work. I'll run a few more tests here then we should be good to go! And yes I agree, I'd like to look more into standardizing the development of this addon for the future with tools like |
Although explicitly calling node-gyp rebuild can work without this, this makes use of robot-js from the various electron build tools work more smoothly.
@dkrutsko, I've done a bunch of work in p120ph37/robot-js/prebuilt to convert things to the @karliky, if you would like to try out my |
It's funny you mention With regards to your changes, thanks again, I think you're doing incredible work with improving electron and compiler support. With regards to hosting binaries on GitHub, I'm already doing that but through a custom domain. For Continuous Integration, I'm a bit annoyed there isn't one CI that handles all three platforms for everything (unless something changed). Last time I looked, I needed both a Travis and AppVeyor system to handle compilation and testing on all three platforms. But for sure, the types, timer and maybe a few more tests can be performed automatically for integration testing. But I think you'd be hard-pressed to find something that can test the core of the library. Especially when some results require manual verification. For separating robot from robot-js, I actually finally discovered that |
Yeah, the setup I have on my branch uses both Travis and AppVeyor, both of which are free for open-source projects. I'd have preferred to use just Travis for all platforms, but unfortunately they seem not to consider Windows a priority right now. AppVeyor isn't bad, but it's not open-source like Travis is, so you have to trust the docs a bit more rather that reading the source like you can for Travis. It also uses a config format that is very similar to Travis, but not exactly compatible, which can be confusing. I'm not sure what exactly is holding Travis back from releasing Windows support - they already use GCE, which is exactly what AppVeyor uses. They have commented that they are unhappy with the scripting available in Windows, but PowerShell seems to work well enough as shown by AppVeyor, and there's also the option of using Bash via Cygwin or msys/mingw... I have successfully run the types and timer tests via automation, but for a quick sanity check, I have it just running the types test right now. I think all of the tests could technically be orchestrated with the help of a separate Electron process which would act as a target for automation, or with other a-priori knowledge like hard-coding the virtual frame-buffer size in the X start-up command, and then validating that the Screen object reads the same dimensions, but some of the tests would take a bit of work to set up and harvest results from a separate Electron process, so I haven't done anything too detailed yet. |
Yeah it sounds like a lot of work trying to get something automated up and running. But regardless, when I'm back from vacation I'd like to get Node 8 support out along with this PR integrated. Then we can focus on the new things. Ideally, I still want to get the new C++ version of robot out with the new features before going full ES6 with robot-js but we'll see, some of the new features are hard to implement (like overlay windows and such). |
Well, npm@5 is out now and rather broken for |
@karliky You're going to need to compile robot-js for ABI version 53. The one you have, 48, is for Node 6. That being said, you should be able to use @p120ph37's version to compile using node-gyp. If you run into compilation errors, take a look at this PR. There's also in-depth compiling instructions available here. I know it really sucks at the moment, and robot-js 1.1 will hopefully fix all these issues. It'll also add Node 8+ support, if it's currently broken. I just have to find the time to get everything merged in between the other projects I'm working on :-/ |
@karliky, if you use my "prebuilt" branch, you don't need to use "electron-rebuild" at all. That tool is for rebuilding from source (which is possible for each platform natively, but the point of my "prebuilt" branch is to avoid that, since it's not possible to cross-build for win32 from darwin). In order to get the correct binaries when using my "prebuilt" branch, the best way to do it is to add an Here is my
This will make things work correctly for local development (when running your project using the
The The windows platform in my case is a little special since A perhaps easier way to do it if you don't mind unused additional binaries getting packaged into your distributable package would be to just install the binaries for all three environments at once. To do that, you can just add some calls to
If you do that, then Also note: |
You guys rock my world, I just got it working 💯 👍 🥇 Here is what I did in case anyone needs help with this:
Enjoy! :) |
You rock @karliky. I'm like the worst project manager in the world for being so far behind schedule. But if I can get what I'm working on to work, it'll more than make up for it! By the way, did any of you have a chance to test the dev build with Node 8? Does it actually compile? |
I don't want to install node@8 on my dev machine yet (not a fan of nvm on mac), but I can add node@8 to the build for Travis/Appveyor and see if it implodes. One tricky part is that |
@p120ph37 Really? I'm a huge fan on NVM on Mac, Haven't had any problems. But for Node, if 8 works then 8.1 should work no problem since the V8 versions are compatible across major node releases. We'll see though, I'm hoping nothing broke since 7. |
As promised in discussion on Robot#20
Yeah, the ABI from 8 to 8.1 should be the same, but |
CI build is looking good so far. 8.0.0 built and passed the "types" test. |
Merged to prebuilt, build finished, and binaries available for ABI 57 now. |
@p120ph37: Okay, I've been avoiding this project for far too long! But no more, I'm not doing anything else until I get this sorted out. First of all, I was quite impressed by your prebuilt branch and I'd like to import as much stuff from there as possible, including all the CI stuff. Second, I was looking at node-sass as they have a pretty good pipeline going (i.e. If no precompiled binaries were found, it auto-compiles them using node-gyp). So I'll work on getting everything set up and integrated on the dev branch. While all this is happening, I'd like to also extend an invitation to both @p120ph37 and @karliky to join the robot project as official collaborators. Let me know if you're interested in this and I'll add you to the team! My overall goal is to work on releasing robot 2.1 and then possibly rewriting robot-js using ES6 and NaN. There's a lot of work ahead and I want to get serious about it. |
Of course I want to contribute to robot as collaborator! 👍 🥇 |
@dkrutsko gitter is fine! Thank you! |
Re: Issue #2 & #4