We use Github Classroom for the projects and in-class workspace. So that you can work in class, follow these steps to get Github and Haskell working on the Trinity Linux machines.
If you do not have one, make a Github account with your Trinity email address.
I suggest your account name be or contain your NetID (i.e. tdoe).
If you have not used Git before, set up your user name and email. Replace Taylor Doe with your name, and tdoe with your NetID (Trinity user name).
git config --global user.name "Taylor Doe"
git config --global user.email tdoe@trinity.edu
Set up a Github SSH key.
Check if you have an existing SSH key by typing ls -al ~/.ssh and looking for id_rsa.pub
If you don't have a key, generate one:
ssh-keygen -t rsa -b 4096 -C "tdoe@trinity.edu"
When you're prompted to "Enter a file in which to save the key," press Enter.
cat ~/.ssh/id_rsa.pub
Select and copy the output (your public key)
Go to https://github.com/settings/ssh/new
Use any title, I suggest "Trinity Linux"
Paste the key into the second bock
Click "Add SSH Key."
We will be using a workspace repository during class
Click the workspace assignment link
If necessary, authorize Github Classroom
Find your NetID in the roster and link it to your Github account.
If your NetID isn't there, you can skip this step.
Join the team for your class time
Clone the repository to your Linux account
Click on the green Clone or download button.
The box should read "Clone with SSH"
If the box reads "Clone with HTTPS", click "Use SSH."
If that is not available, you did not set up your SSH key correctly.
Click the copy button next to the link.
git clone <link>
You can change the repository name safely (for instance: to csci2322/workspace)
When released, click on the projects' Github Classroom links to create your own repository with code.
For help with git, check Using Git
Run the following commands on the Trinity Linux machines.
These load Haskell automatically and link the required libraries to run the project.
echo 'command -v ghci &> /dev/null || module load haskell' >> ~/.bashrc
mkdir -p ~/.ghc/x86_64-linux-9.4.8
ln -s ~sfogarty/.ghc/x86_64-linux-9.4.8/package.conf.d ~/.ghc/x86_64-linux-9.4.8/package.conf.d
To get use your home computer, you will need to connect to Github on your home machine. You can follow the analogue to steps 1-3 above for your operating system, use Github Desktop, or possibly Github with VSCode.
These instructions are for installing Haskell on your home computer. Please do not use these on the linux machines.
Open a Powershell session and run the following line
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; try { Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true } catch { Write-Error $_ }
You can install anywhere you like. I recommend you install the haskell-language-server, do not install stack, and do install the MSys2 toolchain. If you already have mingw installed, you may not need to install the MSys2 toolchain.
Please let me knwo if these steps work for you.
Download the csci2322_testing_framework.zip and unzip it.
Open a terminal, go to the csci2322_testing_framework directory, and execute the following commands.
cabal update
cabal v1-install happy
cabal v1-install
This will probably take a long time. If you get an error, use where cabal to see where cabal was installed
To run the projects in Powershell, you will need to install make. The easiest way to do this is using chocolatey. Run powershell as an administrator, and then run this commands:
Set-ExecutionPolicy AllSigned
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install make
After it’s done, go into your project directory and try to make the project.
Note: Linux distributions vary in ways that should not impact these instructions. Debian and Arch derivatives, such as Ubuntu and Manjaro respectively, are most common, and both should be near identical in their installation process.
Run the following command in a terminal.
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
The default options are all reasonable. If this does not work on your machine, try installing any missing packages the script lists as requirements. If that fails, please contact Dr. Fogarty.
Please let me know if this works for you.
Download the csci2322_testing_framework.zip
Open a terminal, go to the directory containing the zip file, and execute the following commands.
unzip csci2322_testing_framework.zip -d csci2322_testing_framework
cd csci2322_testing_framework
cabal update
cabal v1-install happy
cabal v1-install
This will take a while. After it’s done, go into your project directory and try to make the project.