Skip to content

CLAUDE.md: note ficlone copy-then-delete/rollback and orphan data-safety #1175

CLAUDE.md: note ficlone copy-then-delete/rollback and orphan data-safety

CLAUDE.md: note ficlone copy-then-delete/rollback and orphan data-safety #1175

Workflow file for this run

name: C/C++ CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
push:
branches: master
paths:
- '**'
- '!**.yml'
- '!**/.github'
- '!**.md'
- '!docker/**'
- '!packaging/**'
- '!**.txt'
- '**/c-cpp.yml'
pull_request:
branches: master
paths:
- '**'
- '!**.yml'
- '!**/.github'
- '!**.md'
- '!docker/**'
- '!packaging/**'
- '!**.txt'
- '**/c-cpp.yml'
env:
TERM: xterm
BTRFS_IMG: test/rmw-btrfs-test.img
BCACHEFS_IMG: test/rmw-bcachefs-test.img
jobs:
build:
name: ${{ matrix.name }}-${{ matrix.os }}-${{ matrix.cc }}
strategy:
fail-fast: false
matrix:
name: [default]
os: [ubuntu-22.04, ubuntu-24.04]
cc: [gcc, clang]
include:
- name: Slackware
os: ubuntu-latest
container: 'andy5995/slackware-build-essential:15.0'
- name: Alpine
os: ubuntu-latest
container: andy5995/rmw:build-env-alpine
setup_options: -Db_sanitize=none
- name: OpenSuse-Tumbleweed
os: ubuntu-latest
container: andy5995/rmw:build-env-tumbleweed
runs-on: ${{ matrix.os }}
needs:
- various
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Set CC
run: |
CC=${{ matrix.cc }}
if [ "$CC" = "gcc" ] || [ -z "$CC" ]; then
CC=gcc
CXX=g++
else
CC=clang
CXX=clang++
fi
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
- name: Show info
run: |
export -p
echo '${{ toJSON(matrix) }}'
- if: ${{ matrix.container == null }}
run: |
sudo apt update
sudo apt-get install -y \
gettext \
libglib2.0-dev \
meson \
ninja-build \
strace
- if: ${{ contains(matrix.container, 'alpine') }}
run: |
apk update
apk upgrade
- if: ${{ contains(matrix.container, 'tumbleweed') }}
run: |
zypper --non-interactive refresh
zypper --non-interactive update
- name: Configure
run: meson setup builddir ${SETUP_OPTIONS:-} ${{ matrix.setup_options }}
- name: Build
run: |
cd builddir
ninja -v
- name: Test
run: cd builddir && meson test -v
macos:
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-latest]
runs-on: ${{ matrix.os }}
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
needs:
- build
steps:
- uses: actions/checkout@v6
- name: Cache Homebrew packages
uses: actions/cache@v5
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-${{ matrix.os }}-brew-${{ hashFiles('.github/workflows/c-cpp.yml') }}
restore-keys: ${{ runner.os }}-${{ matrix.os }}-brew-
- name: Show info
run: |
export -p
echo '${{ toJSON(matrix) }}'
- run: |
brew update
brew install \
canfigger \
gettext \
glib \
meson \
ninja \
ncurses \
pkg-config \
- name: Configure
run: meson setup builddir
- name: Build
run: |
meson compile -v -C builddir
- name: Test
run: |
meson test -v -C builddir
various:
name: Test Various Build Configurations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Cache btrfs Image
uses: actions/cache@v5
id: btrfs-img-cache
with:
path: ${{ env.BTRFS_IMG }}
key: ${{ hashFiles('test/rmw-btrfs-test.img.sha256sum') }}
- if: ${{ steps.btrfs-img-cache.outputs.cache-hit != 'true' }}
run: curl -L -o "$BTRFS_IMG" 'https://www.dropbox.com/scl/fi/57g3ixd3w3tuz4qoc2zp1/rmw-btrfs-test.img?rlkey=yc7krtntswsa1bwz0sbugy4gi&st=hkgrht05&dl=0'
- name: Test btrfs image existence
run: test -f "$BTRFS_IMG"
- name: Cache bcachefs Image
uses: actions/cache@v5
id: bcachefs-img-cache
with:
path: ${{ env.BCACHEFS_IMG }}
key: ${{ hashFiles('test/rmw-bcachefs-test.img.sha256sum') }}
- if: ${{ steps.bcachefs-img-cache.outputs.cache-hit != 'true' }}
run: curl -L -o "$BCACHEFS_IMG" 'https://www.dropbox.com/scl/fi/key20cj08ca9engqt5kzi/rmw-bcachefs-test.img?rlkey=th6zw1ar7t0dy9m7qzah5wvq9&st=nrwczcqn&dl=0'
- name: Test bcachefs image existence
run: test -f "$BCACHEFS_IMG"
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get install --no-install-recommends -y \
attr \
faketime \
gettext \
libglib2.0-dev \
meson \
ninja-build \
strace \
xvfb
- name: Configure with nls
run: meson setup builddir
- name: Build
run: meson compile -C builddir
- name: meson dist
run: cd builddir && meson dist --include-subprojects
- name: meson dist without gettext installed
run: |
sudo apt remove -y gettext
cd builddir
meson setup --wipe -Dnls=false
meson dist --include-subprojects
- name: Without curses or nls
run: |
cd builddir
meson configure -Dwithout-curses=true -Dnls=false
meson test -v
- name: Epochalypse test
run: |
rm -rf builddir
meson setup builddir -Db_sanitize=none
cd builddir
meson test -v --setup=epochalypse --suite=rmw
- name: with sanitizers
run: |
cd builddir
meson setup --wipe \
-Db_sanitize=address,undefined \
-Db_lundef=false
meson test -v
- name: with lto and FORTIFY
run: |
cd builddir
meson setup --wipe \
-Db_sanitize=none \
-Dc_args=-D_FORTIFY_SOURCE=3 \
-Dbuildtype=debugoptimized \
-Db_lto=true
meson test -v