How to use bake with cygwinΒΆ

Why using Cygwin on Windows instead of the built-in command shell? There is one major reason: Cygwin supports colored output via ansi escape sequences. Note, that these steps differ depending on the Cygwin version, installed packages and configuration.

  1. Get rid of the cygdrive prefix

    ../_images/cygwin_mount.png

    As you see, “c:” is now “/c” and not “/cygdrive/c” anymore.

    Note

    In newer Cygwin versions, this is not permanent. To make it permanent, add the following line to /etc/fstab (can be found in your Cygwin installation directory):

    none / cygdrive binary,posix=0,user 0 0
    
  2. Get rid of the Cygwin ruby

    ../_images/cygwin_ruby.png

    Easiest way is to rename the Cygwin ruby, which makes the original ruby visible. This is only necessary if you have ruby installed in our Cygwin environment.

  3. Add tty to CYGWIN option

    ../_images/cygwin_tty.png

    “tty” must be added to the CYGWIN system variable.

  4. Switch to raw mode

    The ctrl-c handler in Cygwin only works for programs compiled with the correct Cygwin libs. This does not apply to most ruby installations. Hitting ctrl-c may interrupt the compiler, but bake does not get this signal.

    You can set the Cygwin console to raw mode:

    stty raw
    

    Now bake can read ctrl-c as raw character on stdin. Bake will abort after all subprocesses - like the running compilation steps - have returned.

  5. Start the build

    Use the parameter “-a black” or “-a white” depending on the background color of your shell. Depending on your Cygwin installation, you have to call “bake.bat” instead of “bake”. To avoid this, create an alias, e.g:

    alias bake=/c/Programme/_dev/Ruby192/bin/bake.bat