Hacking on Tailscale for Perl

Prerequisites

Building

Build the Rust shared library:

cd /path/to/tailscale-rs
cargo build --release -p ts_ffi

Build the Go test helper:

cd testenv
go build -o testenv .

Or use Makefile.dev to do both:

make -f Makefile.dev all

Running the integration tests

make -f Makefile.dev test

Or manually:

TS_LIB_PATH=/path/to/tailscale-rs/target/release prove -Ilib t/

The tests start a local testcontrol server (Go), a DERP relay, and a STUN server, then create two Perl nodes on the test tailnet and verify they can exchange an HTTP request.

Releasing

  1. Bump the $VERSION in lib/Tailscale.pm.

  2. Build a distribution tarball:

perl Makefile.PL
make manifest
make disttest
make dist

This produces Tailscale-X.XX.tar.gz.

  1. Upload to CPAN:
cpan-upload Tailscale-X.XX.tar.gz

cpan-upload authenticates to PAUSE (the CPAN upload server). It reads credentials from ~/.pause:

user BRADFITZ
password your-pause-password

The file must not be world-readable (chmod 600 ~/.pause).

You can also pass -u USERNAME on the command line and be prompted for the password interactively, which avoids storing it on disk.

If you don't have cpan-upload installed:

cpanm CPAN::Uploader

You need a PAUSE account to upload.

Project layout

lib/
  Tailscale.pm              Main module (FFI bindings)
  Tailscale/
    TcpStream.pm            TCP stream wrapper
    TcpListener.pm          TCP listener wrapper
    HttpServer.pm           Minimal HTTP server
examples/
  http-client.pl            Demo HTTP client
  http-server.pl            Demo HTTP server
t/
  integration.t             Integration tests (requires Go + Rust)
testenv/
  main.go                   Go test helper (testcontrol + DERP + STUN)
  go.mod / go.sum

Changes to tailscale-rs

The Perl bindings require several patches to tailscale-rs that aren't yet upstream as of 2026-04-15. This is all a work in progress.