{% extends "base.html" %} {% block title %}Bootstrapping instructions{% endblock %} {% block content %}

Bootstrapping instructions

Installing a Linux Terminal

Installing Cygwin

If you already have a Cygwin install, rename it so that it doesn't get overwritten (something like "[install name]-old").

Download the Cygwin setup executable using this mirror, and then run the following from a terminal (both Command Prompt and Windows Powershell work)

    $ setup-x86_64.exe -O -R C:\cygwin64 -s {{ request.url.scheme }}://{{ request.url.netloc }}/cygwin -P curl,python3,rsync -q

The Cygwin install sometimes hangs even when it is finished, hit Enter to return to a command prompt.

Installing MSYS2

MSYS2 is a lightweight Linux environment which provides compiler support for the more modern programming languages used in the backend of Murfey's package dependencies.

The Murfey server supports the forwarding of download requests to client PCs that cannot access the wider internet. Download the MSYS2 setup executable using this mirror, and run the executable using the default settings.

By default, MSYS2 comes with preset lists of mirrors and servers that it installs its packages from. These will need to be disabled, and replaced with URLs of the same format that point to the Murfey server the client PC is connected to.

These lists can be found in the following folder, if the default installation options were chosen:

    C:\msys64\etc\pacman.d\mirrorlist.{environment}

This is an example of how the URL to the Murfey server should look like:

    Server = https://repo.msys2.org/mingw/x86_64/  # Original URL
    Server = {{ request.url.scheme }}://{{ request.url.netloc }}/msys2/mingw/x86_64  # Murfey URL

MSYS2 comes with multiple environments, but UCRT64 is the most modern one. In order for the Murfey client to be able to install and run its dependencies properly, the following packages will need to be installed in the UCRT64 environment. This can be achieved using the following commands:

    $ pacman -Syu --disable-download-timeout  # Downloads the package database and searches for updates
    $ pacman -S rsync --disable-download-timeout
    $ pacman -S mingw-w64-python-pip --disable-download-timeout
    $ pacman -S mingw-w64-x86_64-rust --disable-download-timeout

Installing Windows Terminal

There is currently a bug with MSYS2 terminals on Windows 10 that prevents its user interface from working properly. Our current solution is to use Microsoft's Windows Terminal as a wrapper for MSYS2.

The latest release of Windows Terminal can be downloaded directly from GitHub, or through this mirror. This will download a ZIP file, which can be extracted to a directory of your choosing and used out of the box.

In order to run the UCRT64 environment in Windows Terminal, Windows Terminal will need to be directed to it by adding a dictionary entry in its settings JSON file. To do so:

  1. Open Windows Terminal.
  2. Click on the dropdown arrow to the right of the "new tab" button on the title bar.
  3. Click "Settings" (alternatively, use the "Ctrl + ," keyboard shortcut).
  4. On the bottom left corner of the window, click on the "Open JSON file" option. This will bring up the JSON file managing Windows Terminal's settings in your default code editor.
  5. Under "profiles" > "list", Add this dictionary entry for UCRT64:
      "profiles":
      {
          "defaults": {},
          "list":
          [
              {
                  "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                  "hidden": false,
                  "name": "Windows PowerShell"
              },
              {
                  "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                  "hidden": false,
                  "name": "Command Prompt"
              },
              {
                  "guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
                  "name": "UCRT64 / MSYS2",
                  "commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64",
                  "startingDirectory": "C:/msys64/home/%USERNAME%",
                  "icon": "C:/msys64/ucrt64.ico"
              }
          ]
      },
  1. Additionally, if you want Windows Terminal to always start using UCRT64, you can replace the "defaultProfile" key with the "guid" value of UCRT64.
  2. Save your changes and close.

With these changes, you should now be able to run UCRT64 in the Windows Terminal.

Setting Up Python

Once Python and pip are installed in the terminal, you have the option to install Murfey in either the base environment or a virtual environment. The base environment is simpler, but uninstallation of the Python packages in the future could potentially interfere with the base environment's functionality.

Setting Up a Virtual Environment

To set up a virtual environment, run the following commands:

    $ pip install virtualenv --index-url {{ request.url.scheme }}://{{ request.url.netloc }}/pypi --trusted-host {{ request.url.hostname }}
    $ virtualenv your-env-name  # Create the virtual environment
    $ source your-env-name/bin/activate  # Activate the virtual environment

Installing Murfey

You can install Murfey in the Python environment (the base one or a virtual environment) in either the Cygwin or UCRT64 terminal using the following commands:

    $ pip install murfey[client] --index-url {{ request.url.scheme }}://{{ request.url.netloc }}/pypi --trusted-host {{ request.url.hostname }}
{% endblock %}