Building atom/docs on Windows


#1

Hello, I’m trying to build atom/docs on Windows, but it’s proving a little difficult to get all dependencies in place. I try running “bundle install” and whenever it complains about some dependency missing, I go and figure out how to get that dependency for Windows:

  • DevKit
  • curl
  • unzip

Before proceeding further, I thought that maybe I’m just approaching it in the wrong way. Has anyone tried to build atom/docs on Windows before? Is there a better way to get set up to do this? I know that all of these dependencies are common and easily available on Linux and Mac OS X, but for various reasons, I’m using Windows right now, and I’d still like to contribute to Atom :smile:.


#2

@raelyard, by any chance have you tried to build the docs repo?


#3

I hadn’t cloned it until now and I see that one’s using Rake to build. I’ve had lots of trouble, too, with setting up Ruby environments on Windows. So much so that I’ve often used Ubuntu when I wanted to do some Rails work. Making that work for an easy setup, though, is something I really want to do, anyway. I’ll spend some cycles tomorrow seeing where I can get on that and how much I can script.


#4

Thanks. I’d be happy to help as well. So far, it’s the kindlegen gem that seems to have a lot of dependencies that are a bit more difficult to acquire on Windows, such as curl and unzip.

There could be other dependencies that I haven’t gotten to yet, but then I found this: https://github.com/tdtds/kindlegen/commit/97c3e68c20cbc56851a808ca7ac53e7e0975aaa9 . It suggests curl and unzip may be the only other dependencies required.

One possibility I was thinking of was simply using PowerShell to create “curl” and “unzip” commands that use the existing commands in Windows to do these things. For example, “curl” would just be a simple PowerShell script that runs “Invoke-WebRequest”.


#5

It looks like I at least got “bundle install” to work :smile: Here are the changes that were necessary: https://github.com/mlalkaka/docs/commit/00b70cb5fd84a64efb89c52f5397283e348f6c39. This still requires the user to install Ruby and DevKit manually, but at least it would take care of the more obscure dependencies of curl and unzip. Now that I’ve figured out what was wrong, however, I don’t think this change is actually appropriate in atom/docs. It probably belongs in the kindlegen project for its Windows build.

The next problem seems to be that building the docs doesn’t work for any format other than HTML.

> bundle exec rake book:build
Converting to HTML...
 -- HTML output at atom.html
Converting to EPub...
marshal data too short
  Use --trace for backtrace
 -- Epub output at atom.epub
Converting to Mobi (kf8)...
marshal data too short
  Use --trace for backtrace
 -- Mobi output at atom.mobi
Converting to PDF... (this one takes a while)
The system cannot find the path specified.
 -- PDF  output at atom.pdf

Is that a known issue? If not, I’m guessing I’m still missing something or the other.


#6

I think you’ll find this an improvement in simplicity:

Ruby and DevTools just worked for me on a fresh installation on a new machine (much easier than I remembered - looks like big improvements since the last time I tried this).

Haven’t looked at the problem of doc formats yet, but will try that as well (though not right now).


#7

Thanks! I didn’t know about chocolatey, but that’s a much better way to get dependencies (and software in general).


#8

Yes, Chocolatey is a great tool and one of the reasons I don’t think there’s much missing in Windows vs other platforms. You might like BoxStarter as well:
http://boxstarter.org/


#9

I’m having the same experience on
bundle exec rake book:build

Works great on Mac.
I think there will be a simple solution for this to get it going on Windows, but it will take some understanding I don’t have at the moment.