add broken ass source for now

This commit is contained in:
2026-07-28 22:28:01 +02:00
commit 3176370951
174 changed files with 53679 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
name: Android
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
abi: [arm64-v8a, armeabi-v7a, x86_64]
api: [21]
env:
ANDROID_ABI: ${{ matrix.abi }}
ANDROID_API: ${{ matrix.api }}
NDK_OUT_DIR: ${{ github.workspace }}/out/${{ matrix.abi }}
NDK_LIBS_DIR: ${{ github.workspace }}/libs/${{ matrix.abi }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Show ANDROID_NDK_ROOT
run: |
echo "ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT}"
test -d "${ANDROID_NDK_ROOT}" || (echo "ANDROID_NDK_ROOT not set or invalid" && exit 1)
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y file
- name: Build with ndk-build
working-directory: android/jni
run: |
mkdir -p "${NDK_OUT_DIR}" "${NDK_LIBS_DIR}"
"${ANDROID_NDK_ROOT}/ndk-build" -j \
APP_ABI="${ANDROID_ABI}" \
APP_PLATFORM="android-${ANDROID_API}" \
NDK_OUT="${NDK_OUT_DIR}" \
NDK_LIBS_OUT="${NDK_LIBS_DIR}"
- name: Show outputs
run: |
set -euxo pipefail
find "${NDK_LIBS_DIR}" -maxdepth 2 -type f -print0 | xargs -0 ls -lh || true
file "${NDK_LIBS_DIR}/"* || true
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: libusb-android-${{ matrix.abi }}-api${{ matrix.api }}
path: |
libs/${{ matrix.abi }}/
if-no-files-found: error
+82
View File
@@ -0,0 +1,82 @@
name: linux
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: setup prerequisites
run: |
sudo apt update
sudo apt install -y autoconf automake libtool libudev-dev m4 pkg-config clang llvm
- name: bootstrap
run: ./bootstrap.sh
- name: netlink
# Disable tests for netlink as it doesn't seem to work in the CI environment.
run: .private/ci-build.sh --werror --build-dir build-netlink --no-test -- --disable-udev
- name: udev
run: .private/ci-build.sh --werror --build-dir build-udev -- --enable-udev
- name: debug-log
run: .private/ci-build.sh --werror --build-dir build-debug -- --enable-debug-log
- name: disable-log
run: .private/ci-build.sh --werror --build-dir build-nolog -- --disable-log
- uses: mymindstorm/setup-emsdk@v16
- run: npm ci
working-directory: tests/webusb-test-shim
- name: emscripten
run: emconfigure .private/ci-build.sh --build-dir build-emscripten -- --host=wasm32-unknown-emscripten
- name: umockdev test
run: .private/ci-container-build.sh docker.io/amd64/ubuntu:rolling
# --- Sanitizers + BOS fuzzer smoke, inside linux job (PRs only) ---
- name: Sanitized rebuild (ASan/UBSan + hardening flags)
if: ${{ github.event_name == 'pull_request' }}
env:
CC: clang
CXX: clang++
CFLAGS: "-O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fstack-protector-all -ftrivial-auto-var-init=pattern -Wwrite-strings"
CXXFLAGS: "-O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fstack-protector-all -ftrivial-auto-var-init=pattern -Wwrite-strings"
LDFLAGS: "-fsanitize=address,undefined"
run: |
rm -rf build-asan
mkdir -p build-asan
cd build-asan
CC=$CC CXX=$CXX CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ../configure
make -j
- name: Stage install (pkg-config + runtime)
if: ${{ github.event_name == 'pull_request' }}
run: |
make -C build-asan install DESTDIR="$PWD/build-asan/stage"
echo "PKG_CONFIG_PATH=$PWD/build-asan/stage/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$PWD/build-asan/stage/usr/local/lib" >> $GITHUB_ENV
- name: Build & smoke BOS descriptor fuzzer (C, sanitized, bounded)
if: ${{ github.event_name == 'pull_request' }}
env:
ASAN_OPTIONS: "detect_leaks=0:allocator_may_return_null=1"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
run: |
# Compile against the STAGED headers/libs (DESTDIR), not /usr/local
clang -std=c99 tests/fuzz/fuzz_bos_descriptor.c \
-I"$PWD/build-asan/stage/usr/local/include/libusb-1.0" \
-fsanitize=fuzzer,address,undefined -fno-omit-frame-pointer \
-fstack-protector-all -ftrivial-auto-var-init=pattern -Wwrite-strings \
-L"$PWD/build-asan/stage/usr/local/lib" -lusb-1.0 \
-o fuzz_bos_descriptor
./fuzz_bos_descriptor tests/fuzz/corpus/bos \
-seed=1 -runs=200 -max_total_time=15 -timeout=5 -rss_limit_mb=1536 -print_final_stats=1
# --- end sanitizers + fuzzer smoke ---
+36
View File
@@ -0,0 +1,36 @@
name: macOS
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run
# sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job
# can access it
- uses: actions/checkout@v6
- name: setup prerequisites
shell: bash
run: |
brew update
brew install autoconf automake libtool m4
- name: bootstrap
shell: bash
run: ./bootstrap.sh
- name: compile
shell: bash
run: .private/ci-build.sh --build-dir build
- name: Xcode
shell: bash
run: cd Xcode && xcodebuild -project libusb.xcodeproj
+23
View File
@@ -0,0 +1,23 @@
name: MSYS2 build
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-autotools
- name: bootstrap
run: ./bootstrap.sh
- name: Build
# GCC on MSYS2 doesn't have ASAN support (but Clang does).
run: ./.private/ci-build.sh --build-dir build-msys2 --no-asan
- name: Build with logging disabled
run: ./.private/ci-build.sh --build-dir build-msys2-nolog --no-asan -- --disable-log
@@ -0,0 +1,29 @@
name: MSYS2 aarch64 clang64
on: [push, pull_request]
jobs:
build:
runs-on: windows-11-arm
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
- uses: msys2/setup-msys2@v2
with:
msystem: clangarm64
update: true
install: git mingw-w64-clang-aarch64-cc mingw-w64-clang-aarch64-autotools
- name: CI-Build
run: |
echo 'Running in MSYS2!'
./bootstrap.sh
./.private/ci-build.sh --no-asan --build-dir build-msys2-clang64-aarch64
- uses: actions/upload-artifact@v7
with:
name: build-msys2-clang64-aarch64
path: |
build-msys2-clang64-aarch64/libusb/.libs/libusb-1.0.dll.a
build-msys2-clang64-aarch64/libusb/.libs/libusb-1.0.a
build-msys2-clang64-aarch64/libusb/.libs/libusb-1.0.dll
@@ -0,0 +1,21 @@
name: MSYS2 clang64 build
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
- uses: msys2/setup-msys2@v2
with:
msystem: clang64
update: true
install: git mingw-w64-clang-x86_64-cc mingw-w64-clang-x86_64-autotools
- name: CI-Build
run: |
echo 'Running in MSYS2!'
./bootstrap.sh
./.private/ci-build.sh --build-dir build-msys2-clang64
+49
View File
@@ -0,0 +1,49 @@
name: Windows build and Package
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os:
- 'windows-2022'
- 'windows-2025'
configuration:
- 'Debug'
- 'Release'
- 'Debug-MT'
- 'Release-MT'
- 'Debug-Hotplug'
- 'Release-Hotplug'
- 'Debug-Hotplug-MT'
- 'Release-Hotplug-MT'
architecture:
- 'Win32'
- 'x64'
- 'ARM64'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v3
- name: Build solution
run: |
msbuild msvc/libusb.sln /m -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.architecture }}
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: build-${{ matrix.os }}-${{ matrix.configuration }}-${{ matrix.architecture }}
path: |
build/**/*.exe
build/**/dll/libusb-1.0.dll
build/**/dll/libusb-1.0.lib
build/**/dll/libusb-1.0.exp
build/**/dll/libusb-1.0.pdb
build/**/lib/libusb-1.0.lib