Skip to content

Latest commit

 

History

History
125 lines (94 loc) · 4.48 KB

CONTRIBUTING.md

File metadata and controls

125 lines (94 loc) · 4.48 KB

Contributing to TMBASIC

Table of Contents


Project dependencies

graph TD;
    tmbasic-->compiler;
    test-->compiler;
    test-->vm;
    runner-->vm;
    compiler-->shared;
    vm-->shared;
Loading

Build for Linux and Windows

Linux and Windows builds must be produced on a Linux build machine. Ubuntu Linux is recommended.

  1. Install git and Docker. Give your user account permission to run docker.

    sudo apt-get update -y && \
    sudo apt-get upgrade -y && \
    sudo apt-get install -y git && \
    sudo curl -fsSL https://get.docker.com -o get-docker.sh && \
    sudo sh get-docker.sh && \
    sudo usermod -aG docker $(whoami) && \
    sudo reboot
    
  2. Clone the git repository.

    git clone https://github.com/tmbasic-lang/tmbasic.git
    cd tmbasic
    
  3. Start the build environment and compile TMBASIC.

    cd build
    ./dev.sh
    make
    

    This will create a development build for Linux suitable for debugging. This build of TMBASIC will be unable to produce executables for other platforms because it does not contain the necessary builds of the interpreter.

    Use one of the linux-*.sh or win-*.sh scripts instead of dev.sh to produce a build for a particular target platform.

  4. Type exit to leave the build environment.

Build for macOS

  1. Install Xcode (version 12 or higher).

  2. Install Hombrew and use it to brew install awscli fileicon.

  3. aws configure -- enter your AWS credentials. You need this to access the requester-pays S3 bucket tmbasic which contains premade build environments.

  4. Start the build environment and compile:

    cd build
    ./mac-x64.sh
    make
    

    Use ./mac-arm64.sh instead to build for Apple Silicon.

  5. Type exit to leave the build environment.

Use Visual Studio Code for development and debugging

  1. Install the ms-vscode.cpptools, ms-vscode-remote.remote-containers, and ms-azuretools.vscode-docker extensions in Visual Studio Code.
  2. Start the container using the instructions above.
  3. In Visual Studio Code, click "View" > "Command Palette..." and run the "Remote-Containers: Attach to Running Container..." command. OR: switch to the Docker tab, right-click on the container > "Attach Visual Studio Code".
  4. Choose the /tmbasic-dev container.
  5. Choose the /code directory.

If your Docker engine is running on another machine, modify the above steps:

  1. Install the ms-vscode-remote.remote-ssh extension too.
  2. Download the Docker client EXE and stick it somewhere on your PATH.
  3. Start dev.sh on the remote machine.
  4. In VSCode, press Ctrl+Shift+P and run the "Remote-SSH: Connect to host..." command to connect to the remote machine.
  5. Continue with the original steps.

Take screenshots for the website

SVG screenshots would have been nice, but they get garbled in some browsers (Chrome on Android). Instead, we will just take regular PNG screenshots.

  • Windows 10 at 175% scaling
  • PuTTY
  • Terminal size: 80x24
  • Window > Appearance
    • Cursor appearance: Underline
    • Font: Consolas 14pt
    • Font quality: Antialiased
  • Window > Colours > ANSI Cyan: 58, 150, 221

Crop to the console area including the one pixel black outline. Post-process with:

pngcrush -brute -reduce -ow screenshot.png

Update third party dependencies

  1. In build/, run scripts/depsCheck.sh. Update build/scripts/depsDownload.sh and build/files/mingw.sh.
  2. In build/, run scripts/depsDownload.sh to pull the latest version of each dep.
  3. In build/downloads/, rm sysroot-* ; aws s3 sync . s3://tmbasic/deps/ --acl public-read --size-only
  4. Commit as "Update deps".
  5. Check for new Alpine releases. Search for alpine: to find the Dockerfiles to update. Commit as "Update Alpine".