Skip to content

Linux guest support (two small changes) #132

@adil192

Description

@adil192

Is your feature request related to a problem?

I want to use Linux instead of macOS since Linux is much faster.

I managed to hack it into working. I'll document my hacks here instead of a PR since I'm not overly familiar with Swift/macOS development.

What solution would you like?

  1. getRunnerDownloadURL is hardcoded to use osx. Please can you make this configurable to linux?

  2. didConnect uses open -a Terminal ~/.start-runner.sh.

    try await connection.executeCommand("open -a Terminal \(startRunnerScriptFilePath)")

    On Linux, this can be changed to just ~/.start-runner.sh.

What alternatives have you considered?

For now, I'm using these workarounds:

  1. Install the runner manually with the instructions at https://github.com/organizations/saber-notes/settings/actions/runners/new?arch=arm64&os=linux (your URL will differ).

  2. Add a shim at /usr/local/bin/open:

    #!/bin/bash
    # Tartelet tries to use `open -a Terminal ~/start-runner.sh`
    # but `open` doesn't exist on Linux. Fake it.
    
    set -e
    
    if [[ "$1" != "-a" ]]; then
      echo "open shim: expected -a as 1st arg" >&2
      exit 1
    fi
    if [[ "$2" != "Terminal" ]]; then
      echo "open shim: expected Terminal as 2nd arg" >&2
      exit 1
    fi
    if [[ -z "$3" ]]; then
      echo "open shim: missing command" >&2
      exit 1
    fi
    
    shift 2
    exec "$@"

    And of course make it executable chmod +x /usr/local/bin/open.

  3. I also needed to install zsh.

Any additional context?

It works with these hacks:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions