Skip to content

Commit

Permalink
Squashed 'libusb/' changes from 6bf2db6..d52e355
Browse files Browse the repository at this point in the history
d52e355 libusb 1.0.27
055d852 configure.ac: Bump libtool library version
853a5ea examples/hotplugtest: Tone down message about failed open
fdff3cd configure.ac: Do not build umockdev if --enable-debug-log is used
2fad5a8 libusb 1.0.27-rc2
6558778 docs: Add more references in libusb_option section
a5483bc core: Allow setting global log callback after first libusb_init()
d09d341 core: Don't overwrite the log callback on every global libusb_set_option()
0929a2b docs: Prefer use of libusb_init_context() over old libusb_init()
d587c55 xcode: Add files from other backends into the Xcode project
46dfded xcode: Move some options from Xcode project to xcconfig file
66e63d6 Correct some spelling and add codespell config file
b4f877f darwin: locationID is 32-bit, not 64-bit
5e4b389 Replace all http://libusb.info/ with https
9a4ec8b Document backend functions that already lock dev_handle->lock
f080aec Fix docs about backend functions that lock itransfer->lock
7719ae5 io: Change remove_from_flying_list() to not lock flying_transfers_lock itself
f9ae36b windows: Downgrade get_guid DeviceInterfaceGUID warning to info
7b53ee1 libusb.h: Rename ZERO_SIZED_ARRAY to LIBUSB_FLEXIBLE_ARRAY
7ab9c93 core: Add missing mutex acquisition when manipulating active_contexts_list
a8fba21 Change libusb_init_option to fix libusb_set_option() on big-endian
56d8f3c io: Fix incorrect alignment in allocation in libusb_alloc_transfer
20fb751 descriptor: Prevent string descriptor buffer overread
a91657a darwin: Avoid error checking regression
9401e6c darwin: Revert seemingly harmless introduction of temporary variable
5ad1d99 core: Fix -Wswitch warnings by including all enum values in switch
31dfa14 ChangeLog updates
37dee8f msvc: Add tests/init_context project to MSVC
7c3d9ec tests/stress_mt: Ignore device descriptor mismatch for Windows HID
5f9abfb tests/stress_mt: Ignore some unavailable devices on Windows
c2e1507 tests/set_option: Allow no devices in test_no_discovery
b272470 libusb.h: Avoid UNREFERENCED_PARAMETER macro on GCC/clang
87d6686 tests/stress_mt: Stop early if any device fails
ebfbf19 tests/set_option: Avoid use-after-free in case of test failure
cc3df77 libusb 1.0.27-rc1
52bb0ed tests: Use AM_LDFLAGS for -static flag to allow LDFLAGS override
43db4d9 .gitignore: Ignore test binaries and logs
56cee16 tests/umockdev: Avoid unknown warning option on older gcc
dac541d Revert "windows: Add option for WinUSB RAW_IO endpoint policy"
066a77f webusb: Wasm+WebUSB backend fixes and improvements
1ca2bc1 darwin: add testing for IOKit version fallbacks
13a6953 darwin: add abstraction for IOUSBDeviceInterface
cf6946d darwin: add abstraction for IOUSBInterfaceInterface
33e92b6 darwin: add get_running_version helper
43c6fe0 ci: ensure testsuite log is dumped on failure
f0d1ff3 ci: dump test suite output on test failure
d82b3d2 ci: do not hard code test names for CI
30a4434 CI: Add Linux and MSYS build with logging disabled
a8f7701 CI: Simplify Linux job description
f2ebac6 windows: Include enumeration details in debug output
5eed745 windows: Avoid warning with logging disabled
80493dd core: Avoid warning with logging disabled
ae3685e stress_mt: Return error if device count varies
a8d3cd8 tests/stress_mt: Test open/transfer/close on available devices
bd91a0c CI: Enable Emscripten build
fd31502 Add WebUSB testing via node-usb
9de0fef core: Avoid possible data race in log_v()
dfed0d1 CI: Pass the extra warnings flags to CXXFLAGS too
143338c CI: Tell tests that we don't have any devices
c0057c3 CI: Enable Address Sanitizer (ASAN) where supported
e28fa30 CI: Run cross-platform tests on all platforms
5fa085e testlib: Don't count skipped tests as failures
6d2abd0 tests: Mark callbacks as LIBUSB_CALL
c4285dd windows: Cover all enumeration passes explicitly in switch statements
d291eec Revert "core: Remove select case not possibly reached"
acc7b9d tests: Fix builds with logging disabled
fdab67b windows: Allow device GUIDs missing terminating characters or separators
d66ffcd darwin: fix potential crash at darwin_exit
0a2f511 examples/hotplugtest: Match any device by default
67ac8a0 windows: Recognize Samsung composite device driver
24d7928 descriptor: Guard against corrupted descriptor length field
4b732d9 windows: No longer wait for device to get an active configuration
c875f15 windows: Define bus numbers without using HCD
1313049 tests: Remove unused function in init_context.c
188a913 Add HACKING file with hints on proper commits

git-subtree-dir: libusb
git-subtree-split: d52e355
  • Loading branch information
Youw committed Feb 15, 2024
1 parent 544385c commit 886418d
Show file tree
Hide file tree
Showing 60 changed files with 2,417 additions and 1,407 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = strerror.c,AUTHORS
ignore-words-list = numer,ser,xwindows
19 changes: 13 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,33 @@ jobs:
- uses: actions/checkout@v3

- name: setup prerequisites
shell: bash
run: |
sudo apt update
sudo apt install autoconf automake libtool libudev-dev m4
- name: bootstrap
shell: bash
run: ./bootstrap.sh

- name: netlink
shell: bash
run: .private/ci-build.sh --build-dir build-netlink -- --disable-udev
# Disable tests for netlink as it doesn't seem to work in the CI environment.
run: .private/ci-build.sh --build-dir build-netlink --no-test -- --disable-udev

- name: udev
shell: bash
run: .private/ci-build.sh --build-dir build-udev -- --enable-udev

- name: debug-log
shell: bash
run: .private/ci-build.sh --build-dir build-debug -- --enable-debug-log

- name: disable-log
run: .private/ci-build.sh --build-dir build-nolog -- --disable-log

- uses: mymindstorm/setup-emsdk@v13

- 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
12 changes: 7 additions & 5 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-autotools
- name: CI-Build
run: |
echo 'Running in MSYS2!'
./bootstrap.sh
./.private/ci-build.sh --build-dir build-msys2
- 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
6 changes: 5 additions & 1 deletion .github/workflows/msys2_clang32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ jobs:
run: |
echo 'Running in MSYS2!'
./bootstrap.sh
./.private/ci-build.sh --build-dir build-msys2-clang32
# Disabling tests as there is some issue that prevents libtool from
# finalizing its executable wrappers.
# Perhaps this one https://github.com/msys2/MSYS2-packages/issues/1351
# but it only occurs on clang32 configuration.
./.private/ci-build.sh --build-dir build-msys2-clang32 --no-test
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Makefile.in
*.lo
*.o
*.js
!/tests/webusb-test-shim/*.js
*.wasm
*.html
libtool
Expand All @@ -21,6 +22,7 @@ depcomp
configure
aclocal.m4
compile
test-driver
config.guess
config.h*
!msvc/config.h
Expand All @@ -40,7 +42,13 @@ examples/fxload
examples/hotplugtest
examples/sam3u_benchmark
examples/testlibusb
tests/init_context
tests/macos
tests/set_option
tests/stress
tests/stress_mt
tests/*.log
tests/*.trs
android/libs
android/obj
*.exe
Expand Down
6 changes: 5 additions & 1 deletion .private/appveyor_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ echo "Bootstrapping ..."
./bootstrap.sh
echo ""

exec .private/ci-build.sh --build-dir "${builddir}" --install -- "--prefix=${installdir}"
extra_args=""
if [ "${Configuration}" == "Release" ]; then
extra_args="--no-asan"
fi
exec .private/ci-build.sh --build-dir "${builddir}" --install ${extra_args} -- "--prefix=${installdir}"
27 changes: 26 additions & 1 deletion .private/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
set -e

builddir=
scriptdir=$(dirname $(readlink -f "$0"))
install=no
test=yes
asan=yes

while [ $# -gt 0 ]; do
case "$1" in
Expand All @@ -19,6 +22,14 @@ while [ $# -gt 0 ]; do
install=yes
shift
;;
--no-test)
test=no
shift
;;
--no-asan)
asan=no
shift
;;
--)
shift
break;
Expand Down Expand Up @@ -52,14 +63,28 @@ cflags+=" -Wpointer-arith"
cflags+=" -Wredundant-decls"
cflags+=" -Wswitch-enum"

# enable address sanitizer
if [ "${asan}" = "yes" ]; then
cflags+=" -fsanitize=address"
fi

echo ""
echo "Configuring ..."
CFLAGS="${cflags}" ../configure --enable-examples-build --enable-tests-build "$@"
CFLAGS="${cflags}" CXXFLAGS="${cflags}" ../configure --enable-examples-build --enable-tests-build "$@"

echo ""
echo "Building ..."
make -j4 -k

if [ "${test}" = "yes" ]; then
# Load custom shim for WebUSB tests that simulates Web environment.
export NODE_OPTIONS="--require ${scriptdir}/../tests/webusb-test-shim/"
if ! make check ; then
cat tests/test-suite.log
exit 1
fi
fi

if [ "${install}" = "yes" ]; then
echo ""
echo "Installing ..."
Expand Down
8 changes: 2 additions & 6 deletions .private/ci-container-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ CFLAGS+=" -Wredundant-decls"
CFLAGS+=" -Wswitch-enum"
export CFLAGS
export CXXFLAGS="\${CFLAGS}"
echo ""
echo "Configuring ..."
/source/configure --enable-examples-build --enable-tests-build
Expand All @@ -61,11 +63,5 @@ make -j4 -k
echo ""
echo "Running umockdev tests ..."
tests/umockdev
echo "Running stress tests ..."
tests/stress
tests/stress_mt
EOG
EOF


2 changes: 1 addition & 1 deletion .private/wbs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ o Additional information:
http://windows.libusb.info/#Driver_Installation
- The MinGW and MS generated DLLs are fully interchangeable, provided that you
use the import libs provided or generate one from the .def also provided.
- If you find any issue, please visit http://libusb.info/ and check the
- If you find any issue, please visit https://libusb.info/ and check the
Support section
22 changes: 22 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ Copyright © 2013-2018 Chris Dickens <[email protected]>
Other contributors:
Aaron Luft
Adam Korcz
Addison Crump
Adrian Bunk
Adrien Destugues
Akshay Jaggi
Alan Ott
Alan Stern
Aleksandr Mezin
Alexander Mot
Alexander Pyhalov
Alexander Schlarb
Alexander Stein
Alex Feinman
Alex Vatchenko
Andrew Aldridge
Andrew Fernandes
Expand All @@ -44,6 +47,7 @@ Bence Csokas
Benjamin Berg
Benjamin Dobell
Bohdan Tymkiv
Brad Smith
Brent Rector
Bruno Harbulot
Carl Karsten
Expand All @@ -59,7 +63,9 @@ David Moore
Dmitry Fleytman
Dmitry Kostjuchenko
Dmitry Zakablukov
Dominik Boehi
Doug Johnston
Edgar Fuß
Evan Hunter
Evan Miller
Fabrice Fontaine
Expand All @@ -68,6 +74,7 @@ Felipe Balbi
Florian Albrechtskirchinger
Francesco Montorsi
Francisco Facioni
Francis Hart
Frank Li
Frederik Carlier
Freek Dijkstra
Expand All @@ -84,6 +91,7 @@ Ido Yariv
Igor Anokhin
Ihor Dutchak
Ilya Konstantinov
Ingvar Stepanyan
Jakub Klama
James Hanko
Jeffrey Nichols
Expand All @@ -98,6 +106,7 @@ Joost Muller
Josh Gao
Joshua Blake
Joshua Hou
Joshua M. Clulow
Juan Cruz Viotti
Julian Scheel
Justin Bischoff
Expand All @@ -112,11 +121,13 @@ Lars Wirzenius
Lei Chen
Léo Lam
Liang Yunwang
Lonnie Abelbeck
Luca Longinotti
Luz Paz
Mac Wang
Marco Trevisan (Treviño)
Marcus Meissner
Mario Kleiner
Mark Kuo
Markus Heidelberg
Martin Ettl
Expand All @@ -136,20 +147,26 @@ Moritz Fischer
Nancy Li
Nia Alarie
Nicholas Corgan
Niklas Gürtler
Omri Iluz
Orhan aib Kavrakoglu
Orin Eman
Ozkan Sezer
Pablo Prietz
Patrick Stewart
Paul Cercueil
Paul Fertser
Paul Qureshi
Pekka Nikander
Petr Pazourek
Philémon Favrod
Pino Toscano
Rob Walker
Romain Vimont
Roman Kalashnikov
Rosen Penev
Ryan Hileman
Ryan Metcalfe
Ryan Schmidt
Saleem Rashid
Sameeh Jubran
Expand All @@ -158,13 +175,15 @@ Sebastian Pipping
Sebastian von Ohr
Sergey Serb
Shawn Hoffman
Simon Chan
Simon Haggett
Simon Newton
Slash Gordon
Stefan Agner
Stefan Tauner
Steinar H. Gunderson
Stephen Groat
Sylvain Fasel
Theo Buehler
Thomas Röfer
Tim Hutt
Expand All @@ -187,6 +206,7 @@ William Orr
William Skellenger
Xiaofan Chen
Yegor Yefremov
Zeng Guang
Zhiqiang Liu
Zoltán Kovács
Сергей Валерьевич
Expand All @@ -199,4 +219,6 @@ parafin
RipleyTom
Seneral
saur0n
SomeAlphabetGuy
winterrace
xloem
21 changes: 19 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
For detailed information about the changes below, please see the git log or
visit: http://log.libusb.info
For detailed information about the changes below, please see the git log
or visit: http://log.libusb.info

2024-01-31: v1.0.27
* New libusb_init_context API to replace libusb_init
* New libusb_get_max_alt_packet_size API
* New libusb_get_platform_descriptor API (BOS)
* Allow setting log callback with libusb_set_option/libusb_init_context
* New WebAssembly + WebUSB backend using Emscripten
* Fix regression in libusb_set_interface_alt_setting
* Fix sync transfer completion race and use-after-free
* Fix hotplug exit ordering
* Linux: NO_DEVICE_DISCOVERY option set per context
* macOS: Fix missing device list cleanup locking
* macOS: Do not clear device data toggle for newer OS versions
* macOS: Fix running binaries on older OS than build host
* Windows: Allow claiming multiple associated interfaces
* Windows: Ignore non-configured devices instead of waiting
* Windows: Improved root hub detection

2022-04-10: v1.0.26
* Fix regression with transfer free's after closing device
Expand Down
25 changes: 25 additions & 0 deletions HACKING
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Contributing to libusb
**********************

For larger changes or API changes/extensions it may be wise to first
discuss on the mailing list or in the issue tracker before larger
coding efforts are initiated.

If you extend or change the API make sure documentation is updated.
Please run make -C doc and check for any Doxygen warnings.

Commit messages should be formatted to 72 chars width and have a
free-standing summary line. See for instance "Commit Guidelines" on
https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project
or https://cbea.ms/git-commit/ about how to make well-formed commit
messages.

Put detailed information in the commit message itself, which will end
up in the git history. On the other hand the description that you fill
in the GitHub pull request web page does not go anywhere.

For copyright reasons it is preferable to have your full name in the
commit author field. Do not update the AUTHOR file yourself, the
maintainers will update it as part of the release preparation.

Please don't touch version_nano.h in your patches or pull requests.
4 changes: 2 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
For the latest libusb news, please refer to the ChangeLog file, or visit:
http://libusb.info
For the latest libusb news, please refer to the ChangeLog file, or visit:
https://libusb.info
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ be ported to other operating systems. Please see the [PORTING](PORTING)
file for more information.

libusb homepage:
http://libusb.info/
https://libusb.info/

Developers will wish to consult the API documentation:
http://api.libusb.info
Expand Down
Loading

0 comments on commit 886418d

Please sign in to comment.