Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Windows support #198

Closed
mcandre opened this Issue · 10 comments

3 participants

@mcandre

Could we get Windows support for cask? When I try to install cask, I get an error.

Trace:

C:\Users\andrew\Desktop\src>curl -fsSkL https://raw.github.com/cask/cask/master/
go | python
Cloning into '$HOME/.cask'...
remote: Reusing existing pack: 2904, done.
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 2908 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2908/2908), 793.27 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1621/1621), done.
Checking connectivity... done
Traceback (most recent call last):
  File "<stdin>", line 100, in <module>
  File "<stdin>", line 90, in main
  File "<stdin>", line 61, in bootstrap_cask
  File "C:\Python27\lib\subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Python27\lib\subprocess.py", line 709, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

The installer seems to be trying to clone the cask code into $HOME/.cask, which means a literal $HOME folder in Windows. Could $HOME be replaced with expanduser for better cross-platform support? http://stackoverflow.com/a/4028943/350106

@rejeep
Owner

@lunaryorn Can you take this one since it's all Python-land!?

@lunaryorn
Owner

@rejeep Do we actually have “official” Windows support in Cask?

I don't have a Windows system to test. I can make the suggested change, but ultimately I'm unable to debug or test it, so I'd rather not go as far as to promise Windows support.

What's your policy on this?

@rejeep
Owner

@rejeep Do we actually have “official” Windows support in Cask?

No and I will not be the one supporting it if we do add it. I was thinking though, that since bin/cask is now written in Python, it may work.

We could always change the suggestion above and Cask might work on Windows if we are lucky. I don't think that you or me should do anything more about it. If someone wants Windows support, they would have to maintain it as well.

@lunaryorn
Owner

@rejeep I'll make the change then.

@lunaryorn lunaryorn closed this issue from a commit
@lunaryorn lunaryorn [Fix #198] Don't rely on $HOME
$HOME doesn't work reliably on Windows.  Instead, we use
os.path.expanduser as suggested by @mcandre.
c6a30da
@lunaryorn lunaryorn closed this in c6a30da
@lunaryorn
Owner

@mcandre I replaced $HOME with os.path.expanduser and os.path.join. That should make the installer work on Windows.

Please note however, that we do not support Cask on Windows, and that Cask will not generally work on Windows. Most parts should more or less work, since the underlying Emacs features are platform-independent, but other parts (notably cask exec) rely on specific Unix features and will probably never work on Windows.

@lunaryorn
Owner

@rejeep Shit, a typo in go. Will fix it...

@lunaryorn
Owner

@rejeep Fixed in fa36d15

@rejeep
Owner

@lunaryorn Great, thanks! :)

@mcandre

Thanks to the $HOME -> expanduser change, I was able to get a little bit further in the initial install.

Trace:

C:\Users\andrew>curl -fsSkL https://raw.github.com/cask/cask/master/go | python
Cloning into 'C:\Users\andrew\.cask'...
remote: Reusing existing pack: 2919, done.
Rremote: Total 2919 (delta 0), reused 0 (delta 0)        KiB/s
Receiving objects: 100% (2919/2919), 793.23 KiB | 926.00 KiB/s, done.
Resolving deltas: 100% (1630/1630), done.
Checking connectivity... done
Traceback (most recent call last):
  File "<stdin>", line 100, in <module>
  File "<stdin>", line 90, in main
  File "<stdin>", line 62, in bootstrap_cask
  File "C:\Python27\lib\subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Python27\lib\subprocess.py", line 709, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

The bootstrapping script seems to have some difficulty running. This could be due to Window's serious lack of support for shebangs.

For this reason, it might help during bootstrap to explicitly call python .../cask, rather than cask by itself, and/or add a script alongside cask as cask.bat, that does the same thing.

Here's an example .bat file in another project that does this:

https://github.com/mcandre/specs/tree/master/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.