Documenter.jl travis.genkeys "which which" error on Windows?

documenter

#1

Hi all,

I am trying my best to move over to Documenter from simple .md files and I have been struggling with the (seemingly) last few steps to get it up and running. When using documenter, I cannot generate the Travis keys as similarly mentioned in this thread.

I have so far:

– pip installed mkdocs and verified cmd-> mkdocs builds locally
I have even used mkdocs gh-deploy to get something up and working.

–I cannot find the thread again, but somewhere I found a thread that mentioned you have to download Ruby, which I did from here and run gem install travis.

– I have also tried commenting out the ~4 which blah statements in my downloaded, to no success.

– I am usually using Github for Desktop (the GUI), which comes with a GitShell utility. I wasn’t sure if that was different than pure Git, so I also installed just Git. Although I can do GitShell -> ssh- genkey which generates files fine

I’ve probably seen other pertinent threads on documenter but all the my links are purple right now so I can’t tell anything apart.

So I guess my question is: is this some windows issue or just something else and how do I get around it? I have never heard of which, and googling lead me to this.

Output:

julia> using Documenter
julia> Travis.genkeys("ForestBiometrics")
ERROR: could not spawn `which which`: no such file or directory (ENOENT)
Stacktrace:
 [1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::Base.DevNullStream, ::Base.DevNullStream, ::Base.DevNullStream) at .\process.jl:360
 [2] #375 at .\process.jl:512 [inlined]
 [3] setup_stdio(::Base.##375#376{Cmd}, ::Tuple{Base.DevNullStream,Base.DevNullStream,Base.DevNullStream}) at .\process.jl:499
 [4] #spawn#374(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{Base.DevNullStream,Base.DevNullStream,Base.DevNullStream}) at .\process.jl:511
 [5] (::Base.#kw##spawn)(::Array{Any,1}, ::Base.#spawn, ::Cmd, ::Tuple{Base.DevNullStream,Base.DevNullStream,Base.DevNullStream}) at .\<missing>:0
 [6] #genkeys#1(::String, ::Function, ::String) at C:\Users\XXX\.julia\v0.6\Documenter\src\Documenter.jl:616
 [7] genkeys(::String) at C:\Users\XXXX\.julia\v0.6\Documenter\src\Documenter.jl:616

#2

Travis.genkeys has not really been tested on Windows as far as I know, and it’s written in a way that it assumes a UNIX-y environment. To add the keys on Windows it’s probably easiest to generate the keys manually (with ssh-keygen) and then add the public key to GitHub and the private key as a hidden environment variable called DOCUMENTER_KEY on Travis.

Feel free to open an issue to track this – it would be good to have either documentation on how to do this on Windows, or fix genkeys in a way that it would work out of the box.


#3

Might be worth taking a look at PackageGenerator. Only modification needed for windows would be giving the path to ssh-keygen (which is packaged with git).


#4

Also, git packages a whole bunch of unix tools, including which, in C:\Program Files\Git\usr\bin. Might be worth temporarily adding to your path if you are gonna stick with Documenter


#5

What the process with generating the keys manually with ssh-keygen look like?

The Gitshell command generates a file(no file suffix?) and a microsoft publisher document (both readable in a text editor). Do I just copy and paste the strings in those files to travis and github or do I have to move the files to some directory?


#6

Yup, those are the ones. Those files are both actually simple text files, so you should open them with Notepad or some other text editor. The one without an extension is the private key and .pub file is the public key. The contents of those files have to be copied to Travis and GitHub. See the Documenter manual for details – the procedure is the same as for Travis.genkeys (it just runs ssh-keygen for you and prints out the keys).