Skip to content

Commit f1e79b5

Browse files
committed
Merge remote-tracking branch 'upstream/v1.x' into v1.x
2 parents 5df62a5 + 1464408 commit f1e79b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2478
-1026
lines changed

.github/workflows/CI-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
docs-src:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
1616
with:
1717
python-version: '3.9'
1818
cache: 'pip' # caching pip dependencies

.github/workflows/CI-sample.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [macos-latest, ubuntu-latest, windows-latest]
2222
runs-on: ${{matrix.os}}
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
- name: setup
2626
run: cmake -E make_directory ${{runner.workspace}}/libuv/docs/code/build
2727
- name: configure

.github/workflows/CI-unix.yml

+77-48
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
build-linux:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: configure
2222
run: |
2323
./autogen.sh
@@ -29,33 +29,67 @@ jobs:
2929
3030
build-android:
3131
runs-on: ubuntu-latest
32-
container: reactnativecommunity/react-native-android:2020-5-20
33-
# Work around an issue where the node from actions/checkout is too new
34-
# to run inside the long-in-the-tooth react-nactive-android container
35-
# image.
3632
env:
37-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
33+
ANDROID_AVD_HOME: /root/.android/avd
3834
steps:
39-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
4036
- name: Envinfo
4137
run: npx envinfo
42-
- name: Configure android arm64
43-
# see build options you can use in https://developer.android.com/ndk/guides/cmake
44-
run: |
45-
mkdir build
46-
cd build
47-
$ANDROID_HOME/cmake/3.10.2.4988404/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk/20.0.5594570/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 ..
48-
- name: Build android arm64
49-
run: |
50-
$ANDROID_HOME/cmake/3.10.2.4988404/bin/cmake --build build
51-
ls -lh build
38+
- name: Enable KVM
39+
run: |
40+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
41+
sudo udevadm control --reload-rules
42+
sudo udevadm trigger --name-match=kvm
43+
- name: Build and Test
44+
uses: reactivecircus/android-emulator-runner@v2
45+
with:
46+
api-level: 24
47+
arch: x86_64
48+
target: google_apis
49+
ram-size: 2048M
50+
emulator-options: -no-audio -no-window -gpu off -no-boot-anim -netdelay none -netspeed full -writable-system -no-snapshot-save -no-snapshot-load -no-snapshot
51+
disable-animations: true
52+
script: |
53+
echo "::group::Configure"
54+
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-24
55+
echo "::endgroup::"
56+
57+
echo "::group::Build"
58+
cmake --build build
59+
60+
## Correct some ld bugs that cause problems with libuv tests
61+
wget "https://github.com/termux/termux-elf-cleaner/releases/download/v2.2.1/termux-elf-cleaner" -P build
62+
chmod a+x build/termux-elf-cleaner
63+
build/termux-elf-cleaner --api-level 24 ./build/uv_run_tests
64+
build/termux-elf-cleaner --api-level 24 ./build/uv_run_tests_a
65+
66+
adb shell "su 0 setenforce 0" # to allow some syscalls like link, chmod, etc.
67+
68+
## Push the build and test fixtures to the device
69+
adb push build /data/local/tmp
70+
adb shell mkdir /data/local/tmp/build/test
71+
adb push test/fixtures /data/local/tmp/build/test
72+
echo "::endgroup::"
73+
74+
## Run the tests
75+
file build/uv_run_tests_a
76+
adb shell "cd /data/local/tmp/build && env UV_TEST_TIMEOUT_MULTIPLIER=5 ./uv_run_tests_a"
5277
5378
build-macos:
54-
runs-on: macos-12
79+
runs-on: ${{ matrix.os }}
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
os: [macos-13, macos-14]
5584
steps:
5685
- uses: actions/checkout@v4
5786
- name: Envinfo
5887
run: npx envinfo
88+
- name: Disable Firewall
89+
run: |
90+
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
91+
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 0
92+
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
5993
- name: Setup
6094
run: |
6195
brew install ninja automake libtool
@@ -86,7 +120,11 @@ jobs:
86120
make -C build-auto -j4
87121
88122
build-ios:
89-
runs-on: macos-12
123+
runs-on: ${{ matrix.os }}
124+
strategy:
125+
fail-fast: false
126+
matrix:
127+
os: [macos-13, macos-14]
90128
steps:
91129
- uses: actions/checkout@v4
92130
- name: Configure
@@ -100,45 +138,36 @@ jobs:
100138
ls -lh build-ios
101139
102140
build-cross-qemu:
103-
runs-on: ubuntu-latest
141+
runs-on: ubuntu-24.04
104142
name: build-cross-qemu-${{ matrix.config.target }}
105143

106144
strategy:
107145
fail-fast: false
108146
matrix:
109147
config:
110-
- {target: arm, toolchain: gcc-arm-linux-gnueabi, cc: arm-linux-gnueabi-gcc, qemu: qemu-arm-static }
111-
- {target: armhf, toolchain: gcc-arm-linux-gnueabihf, cc: arm-linux-gnueabihf-gcc, qemu: qemu-arm-static }
112-
- {target: aarch64, toolchain: gcc-aarch64-linux-gnu, cc: aarch64-linux-gnu-gcc, qemu: qemu-aarch64-static }
113-
- {target: riscv64, toolchain: gcc-riscv64-linux-gnu, cc: riscv64-linux-gnu-gcc, qemu: qemu-riscv64-static }
114-
- {target: ppc, toolchain: gcc-powerpc-linux-gnu, cc: powerpc-linux-gnu-gcc, qemu: qemu-ppc-static }
115-
- {target: ppc64, toolchain: gcc-powerpc64-linux-gnu, cc: powerpc64-linux-gnu-gcc, qemu: qemu-ppc64-static }
116-
- {target: ppc64le, toolchain: gcc-powerpc64le-linux-gnu, cc: powerpc64le-linux-gnu-gcc, qemu: qemu-ppc64le-static }
117-
- {target: s390x, toolchain: gcc-s390x-linux-gnu, cc: s390x-linux-gnu-gcc, qemu: qemu-s390x-static }
118-
- {target: mips, toolchain: gcc-mips-linux-gnu, cc: mips-linux-gnu-gcc, qemu: qemu-mips-static }
119-
- {target: mips64, toolchain: gcc-mips64-linux-gnuabi64, cc: mips64-linux-gnuabi64-gcc, qemu: qemu-mips64-static }
120-
- {target: mipsel, toolchain: gcc-mipsel-linux-gnu, cc: mipsel-linux-gnu-gcc, qemu: qemu-mipsel-static }
121-
- {target: mips64el,toolchain: gcc-mips64el-linux-gnuabi64, cc: mips64el-linux-gnuabi64-gcc,qemu: qemu-mips64el-static }
122-
- {target: arm (u64 slots), toolchain: gcc-arm-linux-gnueabi, cc: arm-linux-gnueabi-gcc, qemu: qemu-arm-static}
123-
- {target: aarch64 (u64 slots), toolchain: gcc-aarch64-linux-gnu, cc: aarch64-linux-gnu-gcc, qemu: qemu-aarch64-static}
124-
- {target: ppc (u64 slots), toolchain: gcc-powerpc-linux-gnu, cc: powerpc-linux-gnu-gcc, qemu: qemu-ppc-static}
125-
- {target: ppc64 (u64 slots), toolchain: gcc-powerpc64-linux-gnu, cc: powerpc64-linux-gnu-gcc, qemu: qemu-ppc64-static}
148+
- {target: arm, toolchain: gcc-arm-linux-gnueabi, cc: arm-linux-gnueabi-gcc, qemu: qemu-arm }
149+
- {target: armhf, toolchain: gcc-arm-linux-gnueabihf, cc: arm-linux-gnueabihf-gcc, qemu: qemu-arm }
150+
- {target: aarch64, toolchain: gcc-aarch64-linux-gnu, cc: aarch64-linux-gnu-gcc, qemu: qemu-aarch64 }
151+
- {target: riscv64, toolchain: gcc-riscv64-linux-gnu, cc: riscv64-linux-gnu-gcc, qemu: qemu-riscv64 }
152+
- {target: ppc, toolchain: gcc-powerpc-linux-gnu, cc: powerpc-linux-gnu-gcc, qemu: qemu-ppc }
153+
- {target: ppc64, toolchain: gcc-powerpc64-linux-gnu, cc: powerpc64-linux-gnu-gcc, qemu: qemu-ppc64 }
154+
- {target: ppc64le, toolchain: gcc-powerpc64le-linux-gnu, cc: powerpc64le-linux-gnu-gcc, qemu: qemu-ppc64le }
155+
- {target: s390x, toolchain: gcc-s390x-linux-gnu, cc: s390x-linux-gnu-gcc, qemu: qemu-s390x }
156+
- {target: mips, toolchain: gcc-mips-linux-gnu, cc: mips-linux-gnu-gcc, qemu: qemu-mips }
157+
- {target: mips64, toolchain: gcc-mips64-linux-gnuabi64, cc: mips64-linux-gnuabi64-gcc, qemu: qemu-mips64 }
158+
- {target: mipsel, toolchain: gcc-mipsel-linux-gnu, cc: mipsel-linux-gnu-gcc, qemu: qemu-mipsel }
159+
- {target: mips64el, toolchain: gcc-mips64el-linux-gnuabi64, cc: mips64el-linux-gnuabi64-gcc,qemu: qemu-mips64el }
160+
- {target: arm (u64 slots), toolchain: gcc-arm-linux-gnueabi, cc: arm-linux-gnueabi-gcc, qemu: qemu-arm }
161+
- {target: aarch64 (u64 slots), toolchain: gcc-aarch64-linux-gnu, cc: aarch64-linux-gnu-gcc, qemu: qemu-aarch64 }
162+
- {target: ppc (u64 slots), toolchain: gcc-powerpc-linux-gnu, cc: powerpc-linux-gnu-gcc, qemu: qemu-ppc }
163+
- {target: ppc64 (u64 slots), toolchain: gcc-powerpc64-linux-gnu, cc: powerpc64-linux-gnu-gcc, qemu: qemu-ppc64 }
126164

127165
steps:
128-
- uses: actions/checkout@v2
129-
- name: Install QEMU
130-
# this ensure install latest qemu on ubuntu, apt get version is old
131-
env:
132-
QEMU_SRC: "http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu"
133-
QEMU_VER: "qemu-user-static_7\\.2+dfsg-.*_amd64.deb$"
134-
run: |
135-
DEB=`curl -s $QEMU_SRC/ | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | grep $QEMU_VER | tail -1`
136-
wget $QEMU_SRC/$DEB
137-
sudo dpkg -i $DEB
138-
- name: Install ${{ matrix.config.toolchain }}
166+
- uses: actions/checkout@v4
167+
- name: Install qemu and ${{ matrix.config.toolchain }}
139168
run: |
140169
sudo apt update
141-
sudo apt install ${{ matrix.config.toolchain }} -y
170+
sudo apt install qemu-user qemu-user-binfmt ${{ matrix.config.toolchain }} -y
142171
- name: Configure with ${{ matrix.config.cc }}
143172
run: |
144173
mkdir build

.github/workflows/CI-win.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ jobs:
2929
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, config: UBSAN}
3030
- {toolchain: Visual Studio 17 2022, arch: arm64, server: 2022}
3131
steps:
32-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v4
3333
- name: Build
3434
run:
3535
cmake -S . -B build -DBUILD_TESTING=ON
3636
-G "${{ matrix.config.toolchain }}" -A ${{ matrix.config.arch }}
37-
${{ matrix.config.config == 'ASAN' && '-DASAN=on -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded' ||
38-
matrix.config.config == 'UBSAN' && '-DUBSAN=on' || '' }}
37+
${{ matrix.config.config == 'ASAN' && '-DASAN=on -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded' || '' }}
3938

4039
cmake --build build --config RelWithDebInfo
4140

@@ -81,7 +80,7 @@ jobs:
8180
- {arch: i686, server: 2022, libgcc: dw2 }
8281
- {arch: x86_64, server: 2022, libgcc: seh }
8382
steps:
84-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
8584
- name: Install mingw32 environment
8685
run: |
8786
sudo apt update
@@ -99,7 +98,7 @@ jobs:
9998
`${{ matrix.config.arch }}-w64-mingw32-gcc -print-file-name=libatomic-1.dll` \
10099
build/usr/bin
101100
- name: Upload build artifacts
102-
uses: actions/upload-artifact@v3
101+
uses: actions/upload-artifact@v4
103102
with:
104103
name: mingw-${{ matrix.config.arch }}
105104
path: build/usr/**/*
@@ -117,7 +116,7 @@ jobs:
117116
- {arch: x86_64, server: 2022}
118117
steps:
119118
- name: Download build artifacts
120-
uses: actions/download-artifact@v2
119+
uses: actions/download-artifact@v4
121120
with:
122121
name: mingw-${{ matrix.config.arch }}
123122
- name: Test

.github/workflows/sanitizer.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
sanitizers-linux:
1717
runs-on: ubuntu-22.04
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
- name: Setup
2121
run: |
2222
sudo apt-get install ninja-build
@@ -67,7 +67,7 @@ jobs:
6767
./build-ubsan/uv_run_tests_a
6868
6969
sanitizers-macos:
70-
runs-on: macos-12
70+
runs-on: macos-13
7171
steps:
7272
- uses: actions/checkout@v4
7373

@@ -104,14 +104,14 @@ jobs:
104104
sanitizers-windows:
105105
runs-on: windows-2022
106106
steps:
107-
- uses: actions/checkout@v2
107+
- uses: actions/checkout@v4
108108
- name: Setup
109109
run: |
110110
choco install ninja
111111
112112
# Note: clang shipped with VS2022 has an issue where the UBSAN runtime doesn't link.
113113
- name: Install LLVM and Clang
114-
uses: KyleMayes/install-llvm-action@v1
114+
uses: KyleMayes/install-llvm-action@v2
115115
with:
116116
version: "17"
117117

.mailmap

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Aaron Bieber <[email protected]> <[email protected]>
44
55
66
7+
78
89
910
Bert Belder <[email protected]> <user@ChrUbuntu.(none)>
@@ -18,6 +19,7 @@ David Carlier <[email protected]>
1819
Devchandra Meetei Leishangthem <[email protected]>
1920
2021
Frank Denis <[email protected]>
22+
2123
2224
Isaac Z. Schlueter <[email protected]>
2325
Jason Williams <[email protected]>
@@ -37,6 +39,7 @@ Michael Neumann <[email protected]> <[email protected]>
3739
3840
Nicholas Vavilov <[email protected]>
3941
42+
4043
Rasmus Christian Pedersen <[email protected]>
4144
Rasmus Christian Pedersen <[email protected]> <[email protected]>
4245

AUTHORS

+23
Original file line numberDiff line numberDiff line change
@@ -567,3 +567,26 @@ Ardi Nugraha <[email protected]>
567567
Anton Bachin <[email protected]>
568568
Trevor Flynn <[email protected]>
569569
570+
Viacheslav Muravyev <[email protected]>
571+
Anthony Alayo <[email protected]>
572+
Thomas Walter <[email protected]>
573+
574+
575+
Farzin Monsef <[email protected]>
576+
577+
josedelinux <[email protected]>
578+
Hüseyin Açacak <[email protected]>
579+
Uilian Ries <[email protected]>
580+
Olivier Valentin <[email protected]>
581+
郑苏波 (Super Zheng) <[email protected]>
582+
583+
Ian Butterworth <[email protected]>
584+
握猫猫 <[email protected]>
585+
Zuohui Yang <[email protected]>
586+
Edigleysson Silva (Edy) <[email protected]>
587+
Raihaan Shouhell <[email protected]>
588+
589+
590+
Poul T Lomholt <[email protected]>
591+
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
592+
Thad House <[email protected]>

CMakeLists.txt

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.10)
22

33
if(POLICY CMP0091)
44
cmake_policy(SET CMP0091 NEW) # Enable MSVC_RUNTIME_LIBRARY setting
@@ -81,15 +81,20 @@ if(TSAN)
8181
endif()
8282

8383
if(UBSAN)
84+
cmake_minimum_required(VERSION 3.13)
8485
list(APPEND uv_defines __UBSAN__=1)
8586
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|GNU|Clang")
86-
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined")
87-
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined")
88-
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined")
89-
elseif(MSVC)
90-
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=undefined")
87+
add_compile_options("-fsanitize=undefined" "-fno-sanitize-recover=undefined")
88+
if (NOT WIN32)
89+
add_link_options("-fsanitize=undefined")
90+
endif()
91+
if(MSVC)
92+
add_compile_options("/Oy-")
93+
else()
94+
add_compile_options("-fno-omit-frame-pointer")
95+
endif()
9196
else()
92-
message(SEND_ERROR "UndefinedBehaviorSanitizer support requires clang, gcc, or msvc. Try again with -DCMAKE_C_COMPILER.")
97+
message(SEND_ERROR "UndefinedBehaviorSanitizer support requires clang or gcc. Try again with -DCMAKE_C_COMPILER.")
9398
endif()
9499
endif()
95100

@@ -181,7 +186,7 @@ set(uv_sources
181186
src/version.c)
182187

183188
if(WIN32)
184-
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602 _CRT_DECLARE_NONSTDC_NAMES=0)
189+
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0A00 _CRT_DECLARE_NONSTDC_NAMES=0)
185190
list(APPEND uv_libraries
186191
psapi
187192
user32
@@ -662,6 +667,7 @@ if(LIBUV_BUILD_TESTS)
662667
test/test-thread-affinity.c
663668
test/test-thread-equal.c
664669
test/test-thread.c
670+
test/test-thread-name.c
665671
test/test-thread-priority.c
666672
test/test-threadpool-cancel.c
667673
test/test-threadpool.c

0 commit comments

Comments
 (0)