Skip to content

Toolchain packages and CI

packaging/ builds the toolchain packages (clang, lld, the LLVM tools, JWlink and every sysroot, for Linux and Windows hosts), and GitHub Actions runs it:

  • .github/workflows/toolchain.yml builds both packages and runs packaging/smoke-test.sh on them in emu2 and Wine, for every push to main and every pull request here. clang-dos/llvm, picolibc, JWlink, win16-sdk and win32-sdk call it for their own pull requests, with their commit in place of the default branch. Run it by hand (Actions > Toolchain > Run workflow) for other branches; the packages are the run's artifacts.
  • .github/workflows/release.yml publishes them: a tag v* pushed here makes a release of that name, and the nightly pre-release is rebuilt every night when any of the eight repositories has changed. Besides the packages it has each sysroot alone (clang-dos-sysroot-NAME.tar.xz).

Using the nightly instead of building

Other repositories' CI, and anyone who only needs the compiler, can take the nightly instead of building the suite. The nightly's assets are replaced in place, so its links (such as https://github.com/clang-retro/dos-sdk/releases/download/nightly/clang-dos-linux-x86_64.tar.xz) do not change.

# In a workflow: unpacks the Linux package, puts bin on PATH and sets
# $CLANG_DOS to it.
- uses: clang-retro/dos-sdk/.github/actions/setup-toolchain@main
- run: clang --config=winxp.cfg -O2 hello.c -o hello.exe
# Only some sysroots, into a directory of your choice:
- uses: clang-retro/dos-sdk/.github/actions/setup-toolchain@main
  with:
    sysroots: i8086-msdos,win2k-xp
    path: sysroots
packaging/get-toolchain.sh ~/clang-dos                  # the Linux package
packaging/get-toolchain.sh -H windows ~/clang-dos-win   # the Windows one
packaging/get-toolchain.sh -s win2k-xp,i8086-msdos ~/sysroots
packaging/get-toolchain.sh -t v0.2.0 ~/clang-dos        # a release

Each checks the files against the release's SHA256SUMS.

The LLVM build is the slow part, about two hours for Linux and three for Windows on GitHub's runners. Each LLVM commit is built once per host and kept in the Actions cache, and ccache makes a new commit quick. A cold Windows build that does not fit in one job stops in time to save its ccache, so running the workflow again finishes it.

The scripts also work outside CI, one step each:

LLVM_SRC=~/llvm PREFIX=$PWD/llvm-linux sh packaging/build-llvm.sh linux
LLVM_SRC=~/llvm PREFIX=$PWD/llvm-windows sh packaging/build-llvm.sh windows
JWLINK_SRC=~/jwlink sh packaging/build-jwlink.sh linux bin/jwlink
JWLINK_SRC=~/jwlink sh packaging/build-jwlink.sh windows bin/jwlink.exe
MINGW_SRC=~/mingw-w64 WIN32_SDK=~/win32-sdk sh packaging/build-widl.sh linux widl-linux
MINGW_SRC=~/mingw-w64 WIN32_SDK=~/win32-sdk sh packaging/build-widl.sh windows widl-windows
BIN=$PWD/llvm-linux/bin LLVM_SRC=~/llvm PICOLIBC_SRC=~/picolibc \
  WIN16_SDK=~/win16-sdk WIN32_SDK=~/win32-sdk \
  MINGW_SRC=~/mingw-w64 LIBUNICOWS_SRC=~/libunicows-1.1.2 \
  sh packaging/build-sysroot.sh i8086-msdos sysroots/i8086-msdos   # and so on
LLVM_PREFIX=$PWD/llvm-linux JWLINK=bin/jwlink SYSROOTS=$PWD/sysroots \
  WIDL_DIR=$PWD/widl-linux LLVM_SRC=~/llvm PICOLIBC_SRC=~/picolibc JWLINK_SRC=~/jwlink \
  WIN16_SDK=~/win16-sdk WIN32_SDK=~/win32-sdk \
  sh packaging/assemble.sh linux clang-dos-linux-x86_64

The DOS sysroot is built with the JWlink in BIN, so put jwlink there first. packaging/README.md is the README inside the package.