Unverified 提交 50fae4b0 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Use recvmmsg (#386)

Enable UV_UDP_RECVMMSG:

- Upgrade libuv to 1.37.0.
- Use uv_udp_init_ex() with UV_UDP_RECVMMSG flag.

Also fixes #384 by adding our own `uv.gyp` file.
上级 79358f69
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-arm
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-4.9 \
--arch=arm \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=arm-linux-androideabi-ar
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export LINK=arm-linux-androideabi-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=arm -DOS=android -f make-android
fi
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-arm64
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=aarch64-linux-android-4.9 \
--arch=arm64 \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=aarch64-linux-android-ar
export CC=aarch64-linux-android-gcc
export CXX=aarch64-linux-android-g++
export LINK=aarch64-linux-android-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=arm64 -DOS=android -f make-android
fi
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-x86
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=x86-4.9 \
--arch=x86 \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=i686-linux-android-ar
export CC=i686-linux-android-gcc
export CXX=i686-linux-android-g++
export LINK=i686-linux-android-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=x86 -DOS=android -f make-android
fi
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-x86_64
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=x86_64-4.9 \
--arch=x86_64 \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=x86_64-linux-android-ar
export CC=x86_64-linux-android-gcc
export CXX=x86_64-linux-android-g++
export LINK=x86_64-linux-android-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API -fPIC"
export CXXFLAGS="-D__ANDROID_API__=$API -fPIC"
export LDFLAGS="-fPIC"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=x86_64 -DOS=android -f make-android
fi
version: v1.18.0.build{build}
init:
- git config --global core.autocrlf true
install:
- cinst -y nsis
matrix:
fast_finish: true
allow_failures:
- platform: x86
configuration: Release
- platform: x64
configuration: Release
platform:
- x86
- x64
configuration:
- Release
build_script:
# Fixed tag version number if using a tag.
- cmd: if "%APPVEYOR_REPO_TAG%" == "true" set APPVEYOR_BUILD_VERSION=%APPVEYOR_REPO_TAG_NAME%
# vcbuild overwrites the platform variable.
- cmd: set ARCH=%platform%
- cmd: vcbuild.bat release %ARCH% shared
cache:
- C:\projects\libuv\build\gyp
{
'variables': {
'target_arch%': 'ia32', # set v8's target architecture
'host_arch%': 'ia32', # set v8's host architecture
'uv_library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
},
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-g' ],
'msvs_settings': {
'VCCLCompilerTool': {
'target_conditions': [
['uv_library=="static_library"', {
'RuntimeLibrary': 1, # /MTd static debug
}, {
'RuntimeLibrary': 3, # /MDd DLL debug
}],
],
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
'BasicRuntimeChecks': 3, # /RTC1
},
'VCLinkerTool': {
'LinkIncremental': 2, # enable incremental linking
},
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
},
'conditions': [
['OS != "zos"', {
'cflags': [ '-O0', '-fno-common', '-fwrapv' ]
}],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}]
]
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [
'-O3',
],
'msvs_settings': {
'VCCLCompilerTool': {
'target_conditions': [
['uv_library=="static_library"', {
'RuntimeLibrary': 0, # /MT static release
}, {
'RuntimeLibrary': 2, # /MD DLL release
}],
],
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
'OmitFramePointers': 'true',
'EnableFunctionLevelLinking': 'true',
'EnableIntrinsicFunctions': 'true',
},
'VCLibrarianTool': {
'AdditionalOptions': [
'/LTCG', # link time code generation
],
},
'VCLinkerTool': {
'LinkTimeCodeGeneration': 1, # link-time code generation
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
'LinkIncremental': 1, # disable incremental linking
},
},
'conditions': [
['OS != "zos"', {
'cflags': [
'-fdata-sections',
'-ffunction-sections',
'-fno-common',
'-fomit-frame-pointer',
],
}],
]
}
},
'msvs_settings': {
'VCCLCompilerTool': {
'StringPooling': 'true', # pool string literals
'DebugInformationFormat': 3, # Generate a PDB
'WarningLevel': 3,
'BufferSecurityCheck': 'true',
'ExceptionHandling': 1, # /EHsc
'SuppressStartupBanner': 'true',
'WarnAsError': 'false',
'AdditionalOptions': [
'/MP', # compile across multiple CPUs
],
},
'VCLibrarianTool': {
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
'RandomizedBaseAddress': 2, # enable ASLR
'DataExecutionPrevention': 2, # enable DEP
'AllowIsolation': 'true',
'SuppressStartupBanner': 'true',
'target_conditions': [
['_type=="executable"', {
'SubSystem': 1, # console executable
}],
],
},
},
'conditions': [
['OS == "win"', {
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
'defines': [
'WIN32',
# we don't really want VC++ warning us about
# how dangerous C functions are...
'_CRT_SECURE_NO_DEPRECATE',
# ... or that C implementations shouldn't use
# POSIX names
'_CRT_NONSTDC_NO_DEPRECATE',
],
'target_conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64'
}]
]
}],
['OS in "freebsd dragonflybsd linux openbsd solaris android aix"', {
'cflags': [ '-Wall' ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
'target_conditions': [
['_type=="static_library"', {
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
}],
],
'conditions': [
[ 'host_arch != target_arch and target_arch=="ia32"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x32"', {
'cflags': [ '-mx32' ],
'ldflags': [ '-mx32' ],
}],
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
[ 'OS=="solaris"', {
'cflags': [ '-pthreads' ],
'ldflags': [ '-pthreads' ],
}],
[ 'OS not in "solaris android zos"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
}],
[ 'OS=="aix" and target_arch=="ppc64"', {
'cflags': [ '-maix64' ],
'ldflags': [ '-maix64' ],
}],
],
}],
['OS=="mac"', {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'USE_HEADERMAP': 'NO',
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
},
'conditions': [
['target_arch=="ia32"', {
'xcode_settings': {'ARCHS': ['i386']},
}],
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
],
}],
['OS=="solaris"', {
'cflags': [ '-fno-omit-frame-pointer' ],
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
],
},
}
#!/usr/bin/env python
import os
import platform
import sys
try:
import multiprocessing.synchronize
gyp_parallel_support = True
except ImportError:
gyp_parallel_support = False
CC = os.environ.get('CC', 'cc')
script_dir = os.path.dirname(__file__)
uv_root = os.path.normpath(script_dir)
output_dir = os.path.join(os.path.abspath(uv_root), 'out')
sys.path.insert(0, os.path.join(uv_root, 'build', 'gyp', 'pylib'))
try:
import gyp
except ImportError:
print('You need to install gyp in build/gyp first. See the README.')
sys.exit(42)
def host_arch():
machine = platform.machine()
if machine == 'i386': return 'ia32'
if machine == 'AMD64': return 'x64'
if machine == 'x86_64': return 'x64'
if machine.startswith('arm'): return 'arm'
if machine.startswith('mips'): return 'mips'
return machine # Return as-is and hope for the best.
def run_gyp(args):
rc = gyp.main(args)
if rc != 0:
print('Error running GYP')
sys.exit(rc)
if __name__ == '__main__':
args = sys.argv[1:]
args.extend('-I common.gypi test/test.gyp'.split(' '))
args.append('--depth=' + uv_root)
# There's a bug with windows which doesn't allow this feature.
if sys.platform != 'win32':
if '-f' not in args:
args.extend('-f make'.split())
if 'eclipse' not in args and 'ninja' not in args:
args.extend(['-Goutput_dir=' + output_dir])
args.extend(['--generator-output', output_dir])
if not any(a.startswith('-Dhost_arch=') for a in args):
args.append('-Dhost_arch=%s' % host_arch())
if not any(a.startswith('-Dtarget_arch=') for a in args):
args.append('-Dtarget_arch=%s' % host_arch())
if not any(a.startswith('-Duv_library=') for a in args):
args.append('-Duv_library=static_library')
# Some platforms (OpenBSD for example) don't have multiprocessing.synchronize
# so gyp must be run with --no-parallel
if not gyp_parallel_support:
args.append('--no-parallel')
gyp_args = list(args)
print(gyp_args)
run_gyp(gyp_args)
...@@ -37,11 +37,6 @@ vgcore.* ...@@ -37,11 +37,6 @@ vgcore.*
Makefile Makefile
Makefile.in Makefile.in
# Generated by gyp for android
*.target.mk
/android-toolchain
/out/
/build/ /build/
/test/.libs/ /test/.libs/
......
...@@ -17,6 +17,7 @@ Imran Iqbal <imrani@ca.ibm.com> <imran@imraniqbal.org> ...@@ -17,6 +17,7 @@ Imran Iqbal <imrani@ca.ibm.com> <imran@imraniqbal.org>
Isaac Z. Schlueter <i@izs.me> Isaac Z. Schlueter <i@izs.me>
Jason Williams <necmon@yahoo.com> Jason Williams <necmon@yahoo.com>
Jesse Gorzinski <jgorzinski@gmail.com> Jesse Gorzinski <jgorzinski@gmail.com>
Jesse Gorzinski <jgorzinski@gmail.com> <jgorzins@us.ibm.com>
Justin Venus <justin.venus@gmail.com> <justin.venus@orbitz.com> Justin Venus <justin.venus@gmail.com> <justin.venus@orbitz.com>
Keno Fischer <kenof@stanford.edu> <kfischer+github@college.harvard.edu> Keno Fischer <kenof@stanford.edu> <kfischer+github@college.harvard.edu>
Keno Fischer <kenof@stanford.edu> <kfischer@college.harvard.edu> Keno Fischer <kenof@stanford.edu> <kfischer@college.harvard.edu>
......
...@@ -418,3 +418,10 @@ Dominique Dumont <dod@debian.org> ...@@ -418,3 +418,10 @@ Dominique Dumont <dod@debian.org>
Manuel BACHMANN <tarnyko@tarnyko.net> Manuel BACHMANN <tarnyko@tarnyko.net>
Marek Vavrusa <marek@vavrusa.com> Marek Vavrusa <marek@vavrusa.com>
TK-one <tk5641@naver.com> TK-one <tk5641@naver.com>
Irek Fakhrutdinov <ifakhrutdinov@rocketsoftware.com>
Lin Zhang <linroid@gmail.com>
毛毛 <srayuws@users.noreply.github.com>
Sk Sajidul Kadir <sheikh.sajid522@gmail.com>
twosee <twose@qq.com>
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Yash Ladha <yashladhapankajladha123@gmail.com>
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
project(libuv LANGUAGES C) project(libuv LANGUAGES C)
...@@ -114,7 +113,7 @@ if(WIN32) ...@@ -114,7 +113,7 @@ if(WIN32)
list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c) list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c)
else() else()
list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE) list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") if(NOT CMAKE_SYSTEM_NAME MATCHES "Android|OS390")
# TODO: This should be replaced with find_package(Threads) if possible # TODO: This should be replaced with find_package(Threads) if possible
# Android has pthread as part of its c library, not as a separate # Android has pthread as part of its c library, not as a separate
# libpthread.so. # libpthread.so.
...@@ -147,9 +146,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX") ...@@ -147,9 +146,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
_ALL_SOURCE _ALL_SOURCE
_LINUX_SOURCE_COMPAT _LINUX_SOURCE_COMPAT
_THREAD_SAFE _THREAD_SAFE
_XOPEN_SOURCE=500) _XOPEN_SOURCE=500
HAVE_SYS_AHAFS_EVPRODS_H)
list(APPEND uv_libraries perfstat) list(APPEND uv_libraries perfstat)
list(APPEND uv_sources src/unix/aix.c) list(APPEND uv_sources
src/unix/aix.c
src/unix/aix-common.c)
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Android") if(CMAKE_SYSTEM_NAME STREQUAL "Android")
...@@ -167,7 +169,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android") ...@@ -167,7 +169,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
src/unix/sysinfo-loadavg.c) src/unix/sysinfo-loadavg.c)
endif() endif()
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS/390") if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS390")
list(APPEND uv_sources src/unix/proctitle.c) list(APPEND uv_sources src/unix/proctitle.c)
endif() endif()
...@@ -221,10 +223,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") ...@@ -221,10 +223,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
list(APPEND uv_sources src/unix/openbsd.c) list(APPEND uv_sources src/unix/openbsd.c)
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "OS/390") if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
list(APPEND uv_defines PATH_MAX=255) list(APPEND uv_defines PATH_MAX=255)
list(APPEND uv_defines _AE_BIMODAL) list(APPEND uv_defines _AE_BIMODAL)
list(APPEND uv_defines _ALL_SOURCE) list(APPEND uv_defines _ALL_SOURCE)
list(APPEND uv_defines _ISOC99_SOURCE)
list(APPEND uv_defines _LARGE_TIME_API) list(APPEND uv_defines _LARGE_TIME_API)
list(APPEND uv_defines _OPEN_MSGQ_EXT) list(APPEND uv_defines _OPEN_MSGQ_EXT)
list(APPEND uv_defines _OPEN_SYS_FILE_EXT) list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
...@@ -237,9 +240,25 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS/390") ...@@ -237,9 +240,25 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS/390")
list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED) list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED)
list(APPEND uv_sources list(APPEND uv_sources
src/unix/pthread-fixes.c src/unix/pthread-fixes.c
src/unix/pthread-barrier.c
src/unix/os390.c src/unix/os390.c
src/unix/os390-syscalls.c) src/unix/os390-syscalls.c)
list(APPEND uv_cflags -Wc,DLL -Wc,exportall -Wc,xplink)
list(APPEND uv_libraries -Wl,xplink)
list(APPEND uv_test_libraries -Wl,xplink)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
list(APPEND uv_defines
_ALL_SOURCE
_LINUX_SOURCE_COMPAT
_THREAD_SAFE
_XOPEN_SOURCE=500)
list(APPEND uv_sources
src/unix/aix-common.c
src/unix/ibmi.c
src/unix/no-fsevents.c
src/unix/no-proctitle.c
src/unix/posix-poll.c)
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
...@@ -280,6 +299,37 @@ target_include_directories(uv_a ...@@ -280,6 +299,37 @@ target_include_directories(uv_a
target_link_libraries(uv_a ${uv_libraries}) target_link_libraries(uv_a ${uv_libraries})
if(LIBUV_BUILD_TESTS) if(LIBUV_BUILD_TESTS)
# Small hack: use ${uv_test_sources} now to get the runner skeleton,
# before the actual tests are added.
add_executable(
uv_run_benchmarks_a
${uv_test_sources}
test/benchmark-async-pummel.c
test/benchmark-async.c
test/benchmark-fs-stat.c
test/benchmark-getaddrinfo.c
test/benchmark-loop-count.c
test/benchmark-million-async.c
test/benchmark-million-timers.c
test/benchmark-multi-accept.c
test/benchmark-ping-pongs.c
test/benchmark-ping-udp.c
test/benchmark-pound.c
test/benchmark-pump.c
test/benchmark-sizes.c
test/benchmark-spawn.c
test/benchmark-tcp-write-batch.c
test/benchmark-thread.c
test/benchmark-udp-pummel.c
test/blackhole-server.c
test/dns-server.c
test/echo-server.c
test/run-benchmarks.c
test/runner.c)
target_compile_definitions(uv_run_benchmarks_a PRIVATE ${uv_defines})
target_compile_options(uv_run_benchmarks_a PRIVATE ${uv_cflags})
target_link_libraries(uv_run_benchmarks_a uv_a ${uv_test_libraries})
list(APPEND uv_test_sources list(APPEND uv_test_sources
test/blackhole-server.c test/blackhole-server.c
test/echo-server.c test/echo-server.c
...@@ -447,6 +497,10 @@ if(LIBUV_BUILD_TESTS) ...@@ -447,6 +497,10 @@ if(LIBUV_BUILD_TESTS)
add_test(NAME uv_test add_test(NAME uv_test
COMMAND uv_run_tests COMMAND uv_run_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
set_tests_properties(uv_test PROPERTIES ENVIRONMENT
"LIBPATH=${CMAKE_BINARY_DIR}:$ENV{LIBPATH}")
endif()
add_executable(uv_run_tests_a ${uv_test_sources}) add_executable(uv_run_tests_a ${uv_test_sources})
target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines}) target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags}) target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
......
...@@ -142,7 +142,6 @@ Bug fixes and features should come with tests. Add your tests in the ...@@ -142,7 +142,6 @@ Bug fixes and features should come with tests. Add your tests in the
If you add a new test file, it needs to be registered in three places: If you add a new test file, it needs to be registered in three places:
- `CMakeLists.txt`: add the file's name to the `uv_test_sources` list. - `CMakeLists.txt`: add the file's name to the `uv_test_sources` list.
- `Makefile.am`: add the file's name to the `test_run_tests_SOURCES` list. - `Makefile.am`: add the file's name to the `test_run_tests_SOURCES` list.
- `uv.gyp`: add the file's name to the `sources` list in the `run-tests` target.
Look at other tests to see how they should be structured (license boilerplate, Look at other tests to see how they should be structured (license boilerplate,
the way entry points are declared, etc.). the way entry points are declared, etc.).
......
2020.03.12, Version 1.35.0 (Stable) 2020.04.20, Version 1.37.0 (Stable)
Changes since version 1.36.0:
* timer: remove redundant check in heap compare (Yash Ladha)
* udp: add flag to enable recvmmsg(2) explicitly (Saúl Ibarra Corretgé)
2020.04.16, Version 1.36.0 (Stable), 533b738838ad8407032e14b6772b29ef9af63cfa
Changes since version 1.35.0:
* build: add aix-common.c for AIX cmake build (Jesse Gorzinski)
* zos: explicitly mark message queue events (Irek Fakhrutdinov)
* zos: move mq check out of loop to save cpu cycles (Irek Fakhrutdinov)
* zos: add checks to ensure behavior of epoll_wait (Irek Fakhrutdinov)
* src: add uv__reallocf() (Ben Noordhuis)
* build: ibmi support for cmake (Jesse Gorzinski)
* build: fix gyp build for Android API >= 28 (Lin Zhang)
* udp: return recvmmsg-ed datagrams in order (Saúl Ibarra Corretgé)
* zos,test: fix spawn_empty_env for shared library build (Richard Lau)
* zos: fix non-Release builds (Richard Lau)
* zos: fix return value on expired nanosleep() call (Richard Lau)
* build: fix z/OS cmake build (Richard Lau)
* test: add a bunch of ASSERT macros (Santiago Gimeno)
* test: remove unused extern declaration (Ben Noordhuis)
* test: canonicalize argv[0] in exepath test (Ben Noordhuis)
* test: simplify platform_init() (Ben Noordhuis)
* ibmi: Fix isatty EBADF handling and refactor (Kevin Adler)
* test: Test EBADF tty handling (Kevin Adler)
* build: make cmake build benchmarks (Ben Noordhuis)
* win: use RtlGenRandom from advapi32.dll directly (Ben Noordhuis)
* android: fix OOB write in uv_interface_addresses() (Lin Zhang)
* test: pass test when hostname is single character (毛毛)
* ibmi: set the highest process priority to -10 (Xu Meng)
* build: remove support for gyp (Ben Noordhuis)
* doc: add note to README on cross-compiling (Ben Noordhuis)
* fs: add uv_fs_lutime() (Sk Sajidul Kadir)
* unix: implement cpu_relax() for arm (David Carlier)
* linux: fix uv__accept4() (twosee)
* win: handle file paths in uv_fs_statfs() (erw7)
* unix: fix uv_os_environ() null pointer check (Rikard Falkeborn)
* win: fix uv_os_environ() null pointer check (Rikard Falkeborn)
* unix: fix compilation on macOS 32-bit architectures (Brad King)
* win: replace alloca() with stack-based array (Ben Noordhuis)
2020.03.12, Version 1.35.0 (Stable), e45f1ec38db882f8dc17b51f51a6684027034609
Changes since version 1.34.2: Changes since version 1.34.2:
......
...@@ -123,17 +123,9 @@ EXTRA_DIST = test/fixtures/empty_file \ ...@@ -123,17 +123,9 @@ EXTRA_DIST = test/fixtures/empty_file \
include \ include \
docs \ docs \
img \ img \
android-configure-arm \
android-configure-arm64 \
android-configure-x86 \
android-configure-x86_64 \
CONTRIBUTING.md \ CONTRIBUTING.md \
LICENSE \ LICENSE \
README.md \ README.md
vcbuild.bat \
common.gypi \
gyp_uv.py \
uv.gyp
...@@ -346,7 +338,8 @@ test_run_tests_CFLAGS += -D__EXTENSIONS__ \ ...@@ -346,7 +338,8 @@ test_run_tests_CFLAGS += -D__EXTENSIONS__ \
endif endif
if OS390 if OS390
test_run_tests_CFLAGS += -D_UNIX03_THREADS \ test_run_tests_CFLAGS += -D_ISOC99_SOURCE \
-D_UNIX03_THREADS \
-D_UNIX03_SOURCE \ -D_UNIX03_SOURCE \
-D_OPEN_SYS_IF_EXT=1 \ -D_OPEN_SYS_IF_EXT=1 \
-D_OPEN_SYS_SOCK_IPV6 \ -D_OPEN_SYS_SOCK_IPV6 \
......
...@@ -152,47 +152,14 @@ $ gpg --verify libuv-1.7.0.tar.gz.sign ...@@ -152,47 +152,14 @@ $ gpg --verify libuv-1.7.0.tar.gz.sign
## Build Instructions ## Build Instructions
For GCC there are two build methods: via autotools or via [GYP][]. For UNIX-like platforms, including macOS, there are two build methods:
GYP is a meta-build system which can generate MSVS, Makefile, and XCode autotools or [CMake][].
backends. It is best used for integration into other projects.
To build with autotools: For Windows, [CMake][] is the only supported build method and has the
following prerequisites:
```bash <details>
$ sh autogen.sh
$ ./configure
$ make
$ make check
$ make install
```
To build with [CMake](https://cmake.org/):
```bash
$ mkdir -p out/cmake ; cd out/cmake # create build directory
$ cmake ../.. -DBUILD_TESTING=ON # generate project with test
$ cmake --build . # build
$ ctest -C Debug --output-on-failure # run tests
# Or manually run tests:
$ ./out/cmake/uv_run_tests # shared library build
$ ./out/cmake/uv_run_tests_a # static library build
```
To build with GYP, first run:
```bash
$ git clone https://chromium.googlesource.com/external/gyp build/gyp
```
### Windows
Prerequisites:
* [Python 2.6 or 2.7][] as it is required
by [GYP][].
If python is not in your path, set the environment variable `PYTHON` to its
location. For example: `set PYTHON=C:\Python27\python.exe`
* One of: * One of:
* [Visual C++ Build Tools][] * [Visual C++ Build Tools][]
* [Visual Studio 2015 Update 3][], all editions * [Visual Studio 2015 Update 3][], all editions
...@@ -205,67 +172,44 @@ Prerequisites: ...@@ -205,67 +172,44 @@ Prerequisites:
[Git for Windows][] includes Git Bash [Git for Windows][] includes Git Bash
and tools which can be included in the global `PATH`. and tools which can be included in the global `PATH`.
To build, launch a git shell (e.g. Cmd or PowerShell), run `vcbuild.bat` </details>
(to build with VS2017 you need to explicitly add a `vs2017` argument),
which will checkout the GYP code into `build/gyp`, generate `uv.sln`
as well as the necesery related project files, and start building.
```console
> vcbuild
```
Or:
```console
> vcbuild vs2017
```
To run the tests:
```console
> vcbuild test
```
To see all the options that could passed to `vcbuild`:
```console
> vcbuild help
vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared]
Examples:
vcbuild.bat : builds debug build
vcbuild.bat test : builds debug build and runs tests
vcbuild.bat release bench: builds release build and runs benchmarks
```
### Unix To build with autotools:
For Debug builds (recommended) run:
```bash ```bash
$ ./gyp_uv.py -f make $ sh autogen.sh
$ make -C out $ ./configure
$ make
$ make check
$ make install
``` ```
For Release builds run: To build with [CMake][]:
```bash ```bash
$ ./gyp_uv.py -f make $ mkdir -p build
$ BUILDTYPE=Release make -C out
```
Run `./gyp_uv.py -f make -Dtarget_arch=x32` to build [x32][] binaries. $ (cd build && cmake .. -DBUILD_TESTING=ON) # generate project with tests
$ cmake --build build # add `-j <n>` with cmake >= 3.12
### OS X # Run tests:
$ (cd build && ctest -C Debug --output-on-failure)
Run: # Or manually run tests:
$ build/uv_run_tests # shared library build
$ build/uv_run_tests_a # static library build
```
To cross-compile with [CMake][] (unsupported but generally works):
```bash ```bash
$ ./gyp_uv.py -f xcode $ cmake ../.. \
$ xcodebuild -ARCHS="x86_64" -project out/uv.xcodeproj -configuration Release -alltargets -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_SYSTEM_VERSION=6.1 \
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc
``` ```
Using Homebrew: ### Install with Homebrew
```bash ```bash
$ brew install --HEAD libuv $ brew install --HEAD libuv
...@@ -277,110 +221,48 @@ Make sure that you specify the architecture you wish to build for in the ...@@ -277,110 +221,48 @@ Make sure that you specify the architecture you wish to build for in the
"ARCHS" flag. You can specify more than one by delimiting with a space "ARCHS" flag. You can specify more than one by delimiting with a space
(e.g. "x86_64 i386"). (e.g. "x86_64 i386").
### Android
Run:
For arm
```bash
$ source ./android-configure-arm NDK_PATH gyp [API_LEVEL]
$ make -C out
```
or for arm64
```bash
$ source ./android-configure-arm64 NDK_PATH gyp [API_LEVEL]
$ make -C out
```
or for x86
```bash
$ source ./android-configure-x86 NDK_PATH gyp [API_LEVEL]
$ make -C out
```
or for x86_64
```bash
$ source ./android-configure-x86_64 NDK_PATH gyp [API_LEVEL]
$ make -C out
```
The default API level is 24, but a different one can be selected as follows:
```bash
$ source ./android-configure-arm ~/android-ndk-r15b gyp 21
$ make -C out
```
Note for UNIX users: compile your project with `-D_LARGEFILE_SOURCE` and
`-D_FILE_OFFSET_BITS=64`. GYP builds take care of that automatically.
### Using Ninja
To use ninja for build on ninja supported platforms, run:
```bash
$ ./gyp_uv.py -f ninja
$ ninja -C out/Debug #for debug build OR
$ ninja -C out/Release
```
### Running tests ### Running tests
#### Build
Build (includes tests):
```bash
$ ./gyp_uv.py -f make
$ make -C out
```
#### Run all tests
```bash
$ ./out/Debug/run-tests
```
Some tests are timing sensitive. Relaxing test timeouts may be necessary Some tests are timing sensitive. Relaxing test timeouts may be necessary
on slow or overloaded machines: on slow or overloaded machines:
```bash ```bash
$ env UV_TEST_TIMEOUT_MULTIPLIER=2 ./out/Debug/run-tests # 10s instead of 5s $ env UV_TEST_TIMEOUT_MULTIPLIER=2 build/uv_run_tests # 10s instead of 5s
``` ```
#### Run one test #### Run one test
The list of all tests is in `test/test-list.h`. The list of all tests is in `test/test-list.h`.
This invocation will cause the `run-tests` driver to fork and execute `TEST_NAME` in a child process: This invocation will cause the test driver to fork and execute `TEST_NAME` in
a child process:
```bash ```bash
$ ./out/Debug/run-tests TEST_NAME $ build/uv_run_tests_a TEST_NAME
``` ```
This invocation will cause the `run-tests` driver to execute the test within the `run-tests` process: This invocation will cause the test driver to execute the test in
the same process:
```bash ```bash
$ ./out/Debug/run-tests TEST_NAME TEST_NAME $ build/uv_run_tests_a TEST_NAME TEST_NAME
``` ```
#### Debugging tools #### Debugging tools
When running the test from within the `run-tests` process (`run-tests TEST_NAME TEST_NAME`), tools like gdb and valgrind work normally. When running the test from within the test driver process
When running the test from a child of the `run-tests` process (`run-tests TEST_NAME`), use these tools in a fork-aware manner. (`build/uv_run_tests_a TEST_NAME TEST_NAME`), tools like gdb and valgrind
work normally.
When running the test from a child of the test driver process
(`build/uv_run_tests_a TEST_NAME`), use these tools in a fork-aware manner.
##### Fork-aware gdb ##### Fork-aware gdb
Use the [follow-fork-mode](https://sourceware.org/gdb/onlinedocs/gdb/Forks.html) setting: Use the [follow-fork-mode](https://sourceware.org/gdb/onlinedocs/gdb/Forks.html) setting:
``` ```
$ gdb --args out/Debug/run-tests TEST_NAME $ gdb --args build/uv_run_tests_a TEST_NAME
(gdb) set follow-fork-mode child (gdb) set follow-fork-mode child
... ...
...@@ -391,13 +273,14 @@ $ gdb --args out/Debug/run-tests TEST_NAME ...@@ -391,13 +273,14 @@ $ gdb --args out/Debug/run-tests TEST_NAME
Use the `--trace-children=yes` parameter: Use the `--trace-children=yes` parameter:
```bash ```bash
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log out/Debug/run-tests TEST_NAME $ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log build/uv_run_tests_a TEST_NAME
``` ```
### Running benchmarks ### Running benchmarks
See the section on running tests. See the section on running tests.
The benchmark driver is `out/Debug/run-benchmarks` and the benchmarks are listed in `test/benchmark-list.h`. The benchmark driver is `./uv_run_benchmarks_a` and the benchmarks are
listed in `test/benchmark-list.h`.
## Supported Platforms ## Supported Platforms
...@@ -413,8 +296,6 @@ that is detected by `autoconf`. ...@@ -413,8 +296,6 @@ that is detected by `autoconf`.
[IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/) [IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/)
describes the package in more detail. describes the package in more detail.
AIX support for filesystem events is not compiled when building with `gyp`.
### z/OS Notes ### z/OS Notes
z/OS creates System V semaphores and message queues. These persist on the system z/OS creates System V semaphores and message queues. These persist on the system
...@@ -426,12 +307,10 @@ Use the `ipcrm` command to manually clear up System V resources. ...@@ -426,12 +307,10 @@ Use the `ipcrm` command to manually clear up System V resources.
See the [guidelines for contributing][]. See the [guidelines for contributing][].
[CMake]: https://cmake.org/
[node.js]: http://nodejs.org/ [node.js]: http://nodejs.org/
[GYP]: http://code.google.com/p/gyp/
[guidelines for contributing]: https://github.com/libuv/libuv/blob/master/CONTRIBUTING.md [guidelines for contributing]: https://github.com/libuv/libuv/blob/master/CONTRIBUTING.md
[libuv_banner]: https://raw.githubusercontent.com/libuv/libuv/master/img/banner.png [libuv_banner]: https://raw.githubusercontent.com/libuv/libuv/master/img/banner.png
[x32]: https://en.wikipedia.org/wiki/X32_ABI
[Python 2.6 or 2.7]: https://www.python.org/downloads/
[Visual C++ Build Tools]: https://visualstudio.microsoft.com/visual-cpp-build-tools/ [Visual C++ Build Tools]: https://visualstudio.microsoft.com/visual-cpp-build-tools/
[Visual Studio 2015 Update 3]: https://www.visualstudio.com/vs/older-downloads/ [Visual Studio 2015 Update 3]: https://www.visualstudio.com/vs/older-downloads/
[Visual Studio 2017]: https://www.visualstudio.com/downloads/ [Visual Studio 2017]: https://www.visualstudio.com/downloads/
......
...@@ -47,8 +47,9 @@ All functionality related to the new platform must be implemented in its own ...@@ -47,8 +47,9 @@ All functionality related to the new platform must be implemented in its own
file inside ``src/unix/`` unless it's already done in a common file, in which file inside ``src/unix/`` unless it's already done in a common file, in which
case adding an `ifdef` is fine. case adding an `ifdef` is fine.
Two build systems are supported: autotools and GYP. Ideally both need to be Two build systems are supported: autotools and cmake. Ideally both need to be
supported, but if GYP does not support the new platform it can be left out. supported, but if one of the two does not support the new platform it can be
left out.
### Windows ### Windows
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ(2.57) AC_PREREQ(2.57)
AC_INIT([libuv], [1.35.0], [https://github.com/libuv/libuv/issues]) AC_INIT([libuv], [1.37.0], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4]) m4_include([m4/as_case.m4])
......
...@@ -100,7 +100,8 @@ Data types ...@@ -100,7 +100,8 @@ Data types
UV_FS_OPENDIR, UV_FS_OPENDIR,
UV_FS_READDIR, UV_FS_READDIR,
UV_FS_CLOSEDIR, UV_FS_CLOSEDIR,
UV_FS_MKSTEMP UV_FS_MKSTEMP,
UV_FS_LUTIME
} uv_fs_type; } uv_fs_type;
.. c:type:: uv_statfs_t .. c:type:: uv_statfs_t
...@@ -402,12 +403,17 @@ API ...@@ -402,12 +403,17 @@ API
.. c:function:: int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime, double mtime, uv_fs_cb cb) .. c:function:: int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime, double mtime, uv_fs_cb cb)
.. c:function:: int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime, double mtime, uv_fs_cb cb) .. c:function:: int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime, double mtime, uv_fs_cb cb)
.. c:function:: int uv_fs_lutime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime, double mtime, uv_fs_cb cb)
Equivalent to :man:`utime(2)` and :man:`futimes(3)` respectively. Equivalent to :man:`utime(2)`, :man:`futimes(3)` and :man:`lutimes(3)` respectively.
.. note:: .. note::
AIX: This function only works for AIX 7.1 and newer. It can still be called on older z/OS: `uv_fs_lutime()` is not implemented for z/OS. It can still be called but will return
versions but will return ``UV_ENOSYS``. ``UV_ENOSYS``.
.. note::
AIX: `uv_fs_futime()` and `uv_fs_lutime()` functions only work for AIX 7.1 and newer.
They can still be called on older versions but will return ``UV_ENOSYS``.
.. versionchanged:: 1.10.0 sub-second precission is supported on Windows .. versionchanged:: 1.10.0 sub-second precission is supported on Windows
......
...@@ -649,6 +649,16 @@ API ...@@ -649,6 +649,16 @@ API
On Windows, setting `PRIORITY_HIGHEST` will only work for elevated user, On Windows, setting `PRIORITY_HIGHEST` will only work for elevated user,
for others it will be silently reduced to `PRIORITY_HIGH`. for others it will be silently reduced to `PRIORITY_HIGH`.
.. note::
On IBM i PASE, the highest process priority is -10. The constant
`UV_PRIORITY_HIGHEST` is -10, `UV_PRIORITY_HIGH` is -7,
`UV_PRIORITY_ABOVE_NORMAL` is -4, `UV_PRIORITY_NORMAL` is 0,
`UV_PRIORITY_BELOW_NORMAL` is 15 and `UV_PRIORITY_LOW` is 39.
.. note::
On IBM i PASE, you are not allowed to change your priority unless you
have the *JOBCTL special authority (even to lower it).
.. versionadded:: 1.23.0 .. versionadded:: 1.23.0
.. c:function:: int uv_os_uname(uv_utsname_t* buffer) .. c:function:: int uv_os_uname(uv_utsname_t* buffer)
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论