Skip to content
brlbr edited this page Mar 17, 2022 · 13 revisions

Babun officially lacks 64-bit support.

Cygwin itself only recently stabilized 64-bit support – a self-sacrificial act of superheroic volunteerism that should have happened sooner but, for all the standard reasons, didn't. [Read: no money; no time.]

I Want My 64-bit and I Want It Now

An official 64-bit Babun release is only in the gestational planning stages, which means several months to years (not kidding) away. Until that utopic Elysium of unicycle-riding unicorns arrives, users requiring 64-bit support are recommended to either:

  • (Recommended.) Manually install a new 64-bit Cygwin environment not supporting Babun via the official 64-bit Cygwin installer. Babun won't be available, of course, but Cygwin itself will be. This approach has the benefit of actually working in all other respects. (Which, you know, is kinda nice.)
  • (Not recommended.) Manually install a new 64-bit Cygwin environment supporting Babun via the unofficial instructions below. Babun will remain available in an unsupported manner liable to catastrophically fail and take all of your hard-earned data with it in a blazing fireball of glory. This approach is recommended only for seasoned CLI veterans. (You know who you are. If the surnames Stallman and Torvalds mean nothing to you, this ain't you, babe.)

I Choose the Hard Way

While not recommended, manually installing Babun into new or existing 64-bit Cygwin environments is feasible.

The following instructions assume Babun to have been installed by the Administrator user to C:\Documents and Settings\Administrator\.babun. That's usually the case. If that's not the case on your machine, modify the instructions below accordingly.

The following instructions also apply to users manually installing Babun into existing 32-bit Cygwin environments. With only minor and hopefully obvious changes (e.g., ignore the "Instruct Babun to use the current 64-bit version of Cygwin" instruction), the steps are functionally the same.

Let's begin.

  1. If Babun has not been installed:

    1. Download and run the official 32-bit Babun installer.
    2. Install Babun to the default location C:\Documents and Settings\Administrator\.babun.
  2. Else (i.e., if Babun has already been installed):

    1. Close all Babun processes, including all open shells and terminals.
    2. Open the Windows Task Manager (e.g., via the traditional three-finger <Ctrl-Alt-Delete> salute or the easier <Ctrl-Shift-Esc>).
    3. Kill all running Babun daemons, typically identifiable by the telltale suffix " *32" (e.g., "ssh-agent.exe *32", a common Babun daemon for SSH users).
    4. Close the Windows Task Manager.
  3. Open the Windows Explorer.

  4. Move C:\Documents and Settings\Administrator\.babun\cygwin to C:\Documents and Settings\Administrator\.babun\cygwin-32, thus preserving your existing 32-bit Babun environment in the probable event of failure. You may continue to use this environment by manually running the C:\Documents and Settings\Administrator\.babun\cygwin\bin\mintty.exe executable from the Windows Explorer.

  5. If 64-bit Cygwin has not been installed:

    1. Download and run the official 64-bit Cygwin installer.
    2. Choose "Install from Internet."
    3. Under "Root Location," enter C:\Documents and Settings\Administrator\.babun\cygwin.
    4. Click "Next."
    5. Click "Yes."
    6. Click "Next" twice.
    7. Choose the closest mirror.
    8. Click "Next."
    9. Mark the following packages for installation by expanding the subtree containing each such package and clicking the "Skip" label adjacent to that package's name:
      1. Under the "Devel" subtree:
        • git.
      2. Under the "Editors" subtree:
        • The CLI editor of your choice (e.g., vim).
      3. Under the "Net" subtree:
        • curl.
      4. Under the "Shells" subtree:
        • zsh.
      5. Under the "Utils" subtree:
        • dos2unix.
      6. Under the "Web" subtree:
        • wget.
    10. Click "Next" twice.
    11. Click "Finish."
  6. Else (i.e., if 64-bit Cygwin has already been installed):

    1. Install all requisite packages listed above by re-running the previously downloaded 64-bit Cygwin installer and following the same instructions as above.
  7. Open a 64-bit Cygwin terminal (e.g., by double-clicking the new Cygwin64 Terminal icon installed to the desktop).

  8. Copy all user-specific dotfiles and dot directories from the 32- to 64-bit Cygwin environment in a manner preserving both symbolic links and file metadata:

     $ cp -a /cygdrive/c/Documents\ and\ Settings/Administrator/.babun/cygwin-32/home/Administrator/.* ~/
    
  9. Copy all system-wide configuration files required by Babun in the same manner:

     $ cp -a /cygdrive/c/Documents\ and\ Settings/Administrator/.babun/cygwin-32/etc/{group,minttyrc,nanorc,passwd,vimrc} /etc
    
  10. Copy the Babun codebase in the same manner:

     $ cp -a /cygdrive/c/Documents\ and\ Settings/Administrator/.babun/cygwin-32/usr/local/bin/* /usr/local/bin/
     $ cp -a /cygdrive/c/Documents\ and\ Settings/Administrator/.babun/cygwin-32/usr/local/etc/* /usr/local/etc/
    
  11. Create empty files required by the Babun installer:

     $ touch /etc/postinstall/symlinks_repair.sh
    
  12. Remove all cached Babun metadata:

     $ rm -rf /usr/local/etc/babun/{external,home,installed,stamps}
    
  13. If you have permission issues when you run the steps below I found that there are acl settings preventing you from creating a new directory with permission to then modify it. If you encounter this then try this line:

     $ setfacl -k /usr/local/etc/babun
    
  14. Reinstall Babun:

     $ bash -l /usr/local/etc/babun/source/babun-core/tools/init.sh
     $ bash -l /usr/local/etc/babun/source/babun-core/plugins/install.sh
    
  15. Instruct Babun to use the current 64-bit version of Cygwin:

     $ echo 'export CYGWIN_VERSION=x86_64' >> ~/.babunrc
    
  16. Update installed cygwin version for babun:

     $ uname -r | cut -d\( -f1 > /usr/local/etc/babun/installed/cygwin
    
  17. Close the 64-bit Cygwin terminal.

  18. Open a 64-bit Babun terminal (e.g., by double-clicking the existing babun icon previously installed to the desktop).

  19. Install all remaining core Babun packages. This includes gcc, whose package name has changed from simply gcc to gcc-core in newer Cygwin versions and hence must be explicitly passed as a separate argument:

     $ pact install gcc-core $(cat /usr/local/etc/babun/source/babun-packages/conf/cygwin.x86.packages | tr '\n' ' ')		
    

Congratulations. Your sanity may be spent, but you now sport an insane 64-bit Babun environment.

What Could Possibly Go Wrong?

If you see the message below when executing pact install, make sure that $babun/installed/cygwin contains the correct cygwin version.

$ pact install
-------------------------------------------------------------------------------
CRITICAL: The underlying Cygwin version is outdated!
It's forbidden to install new packages as they may fail to work.
Execute 'babun update' and follow the instructions to update Cygwin.
If you know what you are doing add '--force' flag to proceed.
-------------------------------------------------------------------------------
Clone this wiki locally