Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .cache/cppcheck/.gitkeep
Empty file.
18 changes: 9 additions & 9 deletions .github/INTEROPERABILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ We admit only the cohort's registered IPv4 addresses on TCP ports 18731 and 1873

We configure the controller identity with these claims:

Field | Value
--- | ---
Issuer | https://token.actions.githubusercontent.com
Subject | repo:RsyncProject/rsync:ref:refs/heads/master
repository_id | 266877886
repository_owner_id | 166180282
event_name | workflow_run
workflow_ref | RsyncProject/rsync/.github/workflows/interoperability*.yml@refs/heads/master
runner_environment | github-hosted
| Field | Value |
| ------------------- | ----------------------------------------------------------------------------- |
| Issuer | https://token.actions.githubusercontent.com |
| Subject | repo:RsyncProject/rsync:ref:refs/heads/master |
| repository_id | 266877886 |
| repository_owner_id | 166180282 |
| event_name | workflow_run |
| workflow_ref | RsyncProject/rsync/.github/workflows/interoperability\*.yml@refs/heads/master |
| runner_environment | github-hosted |

We give endpoint jobs no federated identity. The controller independently checks PR change selection before requesting authority. Endpoint jobs check the current CI attempt and selected workflow revision without rereading the PR diff.

Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
name: pre-commit
on:
pull_request:
push:
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
RAW_LOG: pre-commit.log
CS_XML: pre-commit.xml
CPPCHECK_VERSION: 2.21.0
steps:
# In case we are satisfied with cppcheck in ubuntu-latest
# - run: sudo apt-get update && sudo apt-get install cppcheck uncrustify
# In case we build cppcheck
- run: sudo apt-get update && sudo apt-get install -y build-essential git uncrustify

#
# Setup cppcheck
#
- name: Restore cppcheck from cache
id: cache-cppcheck
uses: actions/cache/restore@v5
with:
path: ~/cppcheck-install
key: cppcheck-${{ env.CPPCHECK_VERSION }}-${{ runner.os }}-${{ hashFiles('~/cppcheck-install/cppcheck-build-stamp') }}

- name: Build and install cppcheck
if: steps.cache-cppcheck.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch ${{ env.CPPCHECK_VERSION }} https://github.com/danmar/cppcheck.git
cd cppcheck
make -j$(nproc) FILESDIR=/usr/local/share/cppcheck
mkdir -p ~/cppcheck-install
make DESTDIR=~/cppcheck-install install FILESDIR=/usr/local/share/cppcheck
echo "$(date +%s)-$(uname -a)" > ~/cppcheck-install/usr/local/share/cppcheck/cppcheck-build-stamp
- name: Install cppcheck from cache or build
run: |
sudo mkdir -p /usr/local/share/cppcheck
sudo cp ~/cppcheck-install/usr/bin/cppcheck /usr/local/bin/
sudo cp -r ~/cppcheck-install/usr/local/share/cppcheck/* /usr/local/share/cppcheck/

- name: Save cppcheck to cache
if: steps.cache-cppcheck.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ~/cppcheck-install
key: cppcheck-${{ env.CPPCHECK_VERSION }}-${{ runner.os }}-${{ hashFiles('~/cppcheck-install/cppcheck-build-stamp') }}

# Project specific
- uses: actions/checkout@v6

#
# Remove existing cache files (before restoring, after checkout)
#
- run: |
find .cache -type f ! -name .gitkeep -delete
find .cache -type d -empty -delete

- run: python -m pip install pre-commit
- uses: actions/cache/restore@v5
if: github.event_name == 'pull_request'
with:
path: .cache/cppcheck
key: cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.ref_name }}-
cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.base_ref }}-
cppcheck-${{ env.CPPCHECK_VERSION }}-cache-
- uses: actions/cache/restore@v5
if: github.event_name != 'pull_request'
with:
path: .cache/cppcheck
key: cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.ref_name }}-
cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.base_ref }}-
cppcheck-${{ env.CPPCHECK_VERSION }}-cache-
- uses: actions/cache/restore@v5
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit hooks
env:
# uncrustify is skipped until the formatting rules are clarified
# (uncrustify.cfg is added by this flow, but not enforced yet)
SKIP: no-commit-to-branch,uncrustify
run: |
set -o pipefail
mkdir -p .cache/cppcheck
pre-commit gc
pre-commit run --hook-stage manual --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
- uses: actions/cache/save@v5
if: ${{ ! cancelled() }}
with:
path: .cache/cppcheck
key: cppcheck-${{ env.CPPCHECK_VERSION }}-cache-${{ github.ref_name }}-${{ github.sha }}
- name: Convert Raw Log to Checkstyle format (launch action)
uses: mdeweerd/logToCheckStyle@v2025.1.1
if: ${{ failure() }}
with:
in: ${{ env.RAW_LOG }}
# out: ${{ env.CS_XML }}
- uses: actions/cache/save@v5
if: ${{ ! cancelled() }}
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Provide log as artifact
uses: actions/upload-artifact@v7
if: ${{ ! cancelled() }}
with:
name: precommit-logs
path: |
${{ env.RAW_LOG }}
${{ env.CS_XML }}
retention-days: 2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ aclocal.m4
.deps
/*.exe
*.dSYM/
/.cache
198 changes: 198 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
---
exclude:
(?x)^(
old_versions/|
popt/|
zlib/|
rsync-web/|
params\.c$|
config\.guess$|config\.status$|config\.sub$|
configure$|configure\.sh$|
install-sh$|
shconfig$|shconfig\.in$)
repos:
- repo: https://github.com/executablebooks/mdformat
# Do this before other tools "fixing" the line endings
rev: 2d496dbc18e31b83a1596685347ffe0b6041daf0 # 1.0.0
hooks:
- id: mdformat
name: Format Markdown
stages: [manual]
entry: mdformat # Executable to run, with fixed options
language: python
types: [markdown]
# --wrap 80 dropped (commented): upstream-maintained markdown has long
# lines the hook would rewrite (rsync.1.md, rsyncd.conf.5.md, NEWS.md,
# testsuite/README.md)
# args: [--wrap, '80', --number]
args: [--number]
additional_dependencies:
- mdformat-toc
- mdformat-gfm
- mdformat-beautysh
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
hooks:
# - id: no-commit-to-branch
# args: [--branch, main]
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: mixed-line-ending
- id: check-builtin-literals
- id: check-ast
- id: check-merge-conflict
- id: check-executables-have-shebangs
# check-shebang-scripts-are-executable is intentionally not enabled:
# scripts keep their shebangs without the executable bit (upstream
# #1189) — they are not meant to be invoked directly, so modes stay
# as in master.
- id: check-docstring-first
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-toml
- repo: https://github.com/lovesegfault/beautysh.git
rev: 885128fe2600889194c69fa19326cf55a3462777 # v6.4.3
hooks:
- id: beautysh
exclude: ^(config.guess|config.sub|rsync-ssl)$
args: [--indent-size=4]
additional_dependencies:
- setuptools
- repo: https://github.com/codespell-project/codespell
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # v2.4.3
hooks:
- id: codespell
# scripts/updateCodespellIgnoreFile.sh updates the ignore file.
# deapon-parm.awk no longer exists on master; config.guess/config.sub
# stay excluded; vendored zlib/ and popt/ are not corrected.
exclude: ^(configure\.ac|config\.guess|config\.sub|wildtest\.txt)$|^(zlib|popt)/
args:
- --builtin=clear,informal,names
# Sargeant: NEWS.md credits contributor "Will Sargeant"; do not "fix"
# abd: deliberate non-matching string in t_iwildmatch.c test cases
- --ignore-words-list=te,uptodate,siz,mis,ake,chang,ue,cna,devine,seein,noo,servent,tim,parms,unx,blong,sorce,Sargeant,abd
# - -xscripts/codespell-lines-ignore.txt
# - --toml
# - pyproject.toml
additional_dependencies:
- tomli
- repo: https://github.com/pocc/pre-commit-hooks
rev: 82434ac5752cd3b40f6e65e7751c054157accc0b # v1.5.0
# Install dependencies on windows:
# choco install llvm uncrustify cppcheck
hooks:
- id: uncrustify
stages: [manual]
# vendored code and C test fixtures are not application code
exclude: ^(zlib|popt)/|^testsuite/fixtures/chmod-error\.c$
args: [--replace, --no-backup, -c, uncrustify.cfg, -l, C]
- id: cppcheck
stages: [manual]
exclude: ^(case_N\.h|testsuite/fixtures/chmod-error\.c)$|^(zlib|popt)/
args:
- --quiet
- --force
- --platform=unix32
- --language=c
- --cppcheck-build-dir=.cache/cppcheck/
- -Uisblank
- -DSIZEOF_CHARP=8
- -DZLIB_CONST
- -DICONV_OPTION
- -DCAN_CHMOD_SYMLINK
- -DCAN_CHOWN_SYMLINK
- -DCAN_SET_NSEC
- -DCAN_SET_SYMLINK_TIMES
- -DLOG_AUTH
- -DLOG_AUTHPRIV
- -DLOG_CRON
- -DLOG_DAEMON
- -DLOG_FTP
- -DLOG_KERN
- -DLOG_LOCAL0
- -DLOG_LOCAL1
- -DLOG_LOCAL2
- -DLOG_LOCAL3
- -DLOG_LOCAL4
- -DLOG_LOCAL5
- -DLOG_LOCAL6
- -DLOG_LOCAL7
- -DLOG_LPR
- -DLOG_MAIL
- -DLOG_NDELAY
- -DLOG_NEWS
- -DLOG_SYSLOG
- -DLOG_USER
- -DLOG_UUCP
- -DSUPPORT_ACLS
- -DSUPPORT_ACL_FD
- -DSUPPORT_CRTIMES
- -DSUPPORT_HARD_LINKS
- -DSUPPORT_IDN
- -DSUPPORT_IO_PRIORITY
- -DSUPPORT_LINKS
- -DSUPPORT_LZ4
- -DSUPPORT_NICE_PRIORITY
- -DSUPPORT_PREALLOCATION
- -DSUPPORT_XATTRS
- -DSUPPORT_XXH3
- -DSUPPORT_XXHASH
- -DSUPPORT_ZSTD
- -DNORETURN=
- -DPOPT_fprintf=fprintf
# config.h is generated (gitignored), so cppcheck never sees it in CI.
# Define HAVE_GETGROUPS so the real getgroups() code paths are analyzed
# (upstream #1195: without this, cppcheck suggests const on the buffer
# that getgroups() writes into).
- -DHAVE_GETGROUPS
#- -DVARN="value" # For static analysis
- -I.
- '--template={file}({line}): {severity} ({id}): {message}'
- --inline-suppr
- --check-level=exhaustive
- --suppress=unmatchedSuppression
- --suppress=checkersReport
- --suppress=internalError
# - --suppress=constParameterPointer
- --suppress=variableScope
- --suppress=constParameterPointer
- --suppress=constParameterCallback
- --suppress=unusedFunction
- --suppress=missingIncludeSystem
# Generated headers (config.h, git-version.h, default-cvsignore.h,
# default-dont-compress.h, daemon-parm.h, help-rsync*.h, rounding.h)
# are gitignored and absent on a fresh checkout; -I. above resolves
# them at the project root once the build has generated them.
# Suppress the resulting missingInclude notices in the files that
# include them (filename only, no line numbers — they shift easily).
- --suppress=missingInclude:usage.c
- --suppress=missingInclude:flist.c
- --suppress=missingInclude:log.c
- --suppress=missingInclude:loadparm.c
- --suppress=missingInclude:lib/snprintf.c
- --suppress=missingInclude:testsuite/tools/dirfd-probe.c
- --suppress=missingInclude:rsync.h
- --suppress=shiftTooManyBits:byteorder.h
- --suppress=unusedStructMember:rsync.h
- --suppress=unusedStructMember:lib/pool_alloc.c
- --suppress=unusedStructMember:lib/sysacls.h
- --suppress=missingInclude:lib/sysacls.h

- repo: https://github.com/cpplint/cpplint
rev: 350702a4d39395571bd118c9a3cff0a573488d61 # 2.0.2
hooks:
- id: cpplint
stages: [manual]
exclude: ^(zlib|popt)/|^testsuite/fixtures/chmod-error\.c$
args: ["--filter=-legal/copyright,-build/header_guard,-build/include_dir,-build/include_subdir,-readability/braces,-readability/casting,-readability/multiline_comment,-whitespace/blank_line,-whitespace/braces,-whitespace/comma,-whitespace/indent,-whitespace/line_length,-whitespace/newline,-whitespace/operators,-whitespace/parens,-whitespace/semicolon,-whitespace/tab"]
additional_dependencies:
- cpplint>=1.6.1
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: a6564f5d57444e123433a5c9af733e3975c77229 # v0.11.0.1-1
hooks:
- id: shellcheck
exclude: ^(config\.guess|config\.sub)$
# exclude: (?x)^(__NONE__)$
# args: [-x,-e1007,-e1009,-e1072,-e1073]
6 changes: 2 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,11 @@ target package metadata directories.
## libidn2

The [libidn2 library][5] converts an internationalized domain name into the
IDNA A-label ("Punycode") form that a resolver understands. Installing this
IDNA A-label ("Punycode") form that a resolver understands. Installing this
development library lets rsync connect to a daemon whose name has non-ASCII
characters in it, and lets a daemon's "hosts allow" & "hosts deny" settings be
written the same way.

[5]: https://www.gnu.org/software/libidn/#libidn2

## Package summary

To help you get the libraries installed, here are some package install commands
Expand Down Expand Up @@ -314,7 +312,7 @@ is to append the following to config.h:
[2]: http://facebook.github.io/zstd/
[3]: https://lz4.github.io/lz4/
[4]: https://www.openssl.org/docs/man1.0.2/man3/crypto.html
[5]: http://www.ipv6.org/impl/mac.html
[5]: https://www.gnu.org/software/libidn/#libidn2
[6]: https://download.samba.org/pub/rsync/generated-files/
[ppa]: https://launchpad.net/~rsyncproject/+archive/ubuntu/rsync
[ppa-latest]: https://launchpad.net/~rsyncproject/+archive/ubuntu/rsync-latest
Loading
Loading