Modernize C builds with offline dependencies and portable runtime helpers (#3050)

Bundle pinned offline dependencies, remove libcork/libipset and submodule requirements, and add portable runtime helpers with relocatable static/shared library installations.

Add Clang static build validation for Linux/musl, macOS and Windows, real TCP/UDP and SIP003 interoperability coverage, and recorded performance tradeoffs. All 21 hosted checks pass at the reviewed PR head 8d504e6218.
This commit is contained in:
Max Lv
2026-09-11 13:42:11 +08:00
committed by GitHub
parent 8fe386b5c2
commit 201e70c4bd
120 changed files with 4631 additions and 1523 deletions
+11 -41
View File
@@ -1,44 +1,14 @@
#!/usr/bin/env bash
set -e
archive() {
export TARBALL_NAME=$1
export TARBALL_OUTDIR=$2
# archive this repo
cd "$(git rev-parse --show-toplevel)"
git archive HEAD --format=tar --prefix="${TARBALL_NAME}/" \
-o "${TARBALL_OUTDIR}/${TARBALL_NAME}.tar"
# archive submodules
git submodule update --init
git submodule foreach --quiet 'git archive HEAD --format=tar \
--prefix="${TARBALL_NAME}/${path}/" \
-o "${TARBALL_OUTDIR}/${TARBALL_NAME}-submodule-${path}-${sha1}.tar"
tar -n --concatenate --file="${TARBALL_OUTDIR}/${TARBALL_NAME}.tar" \
"${TARBALL_OUTDIR}/${TARBALL_NAME}-submodule-${path}-${sha1}.tar"'
gzip -c "${TARBALL_OUTDIR}/${TARBALL_NAME}.tar" > "${TARBALL_OUTDIR}/${TARBALL_NAME}.tar.gz"
# clean-up
git submodule foreach --quiet 'rm ${TARBALL_OUTDIR}/${TARBALL_NAME}-submodule-${path}-${sha1}.tar'
rm "${TARBALL_OUTDIR}/${TARBALL_NAME}.tar"
}
TARGET_TARBALL_NAME=shadowsocks-libev
TARGET_TARBALL_DIR=$(git rev-parse --show-toplevel)
while getopts "n:o:" opt
do
case ${opt} in
o)
TARGET_TARBALL_DIR=$(readlink -f -- $OPTARG)
;;
n)
TARGET_TARBALL_NAME=$OPTARG
;;
\?)
exit 1
;;
# Backward-compatible maintainer entrypoint for the offline release archive.
set -euo pipefail
root=$(git rev-parse --show-toplevel)
name=shadowsocks-libev
directory=$root
while getopts "n:o:" opt; do
case "$opt" in
n) name=$OPTARG ;;
o) directory=$OPTARG ;;
*) exit 1 ;;
esac
done
archive "${TARGET_TARBALL_NAME}" "${TARGET_TARBALL_DIR}"
exec python3 "$root/scripts/source_archive.py" "$directory/$name.tar.gz" --prefix "$name"