Skip to content

Commit eda85bb

Browse files
committed
更新第三方库uriparser,支持路径包含unicode特殊字符的情况
1 parent 17b7ee0 commit eda85bb

File tree

21 files changed

+382
-123
lines changed

21 files changed

+382
-123
lines changed

3rd/uriparser/.github/workflows/build-and-test.yml

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,70 @@ on:
1212
jobs:
1313
build_and_test:
1414
name: Build and test
15-
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
include:
18+
- name: Native Linux
19+
cmake_args: >-
20+
-DCMAKE_C_COMPILER=clang-13
21+
-DCMAKE_CXX_COMPILER=clang++-13
22+
cflags: >-
23+
-fsanitize=address,undefined,leak
24+
-fno-sanitize-recover=all
25+
-fno-omit-frame-pointer
26+
ldflags: >-
27+
-fsanitize=address
28+
- name: MingGW on Linux
29+
cmake_args: >-
30+
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc
31+
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++
32+
-DCMAKE_SYSTEM_NAME=Windows
33+
-DWIN32=ON
34+
-DMINGW=ON
35+
runs-on: ubuntu-20.04
1636
steps:
17-
- uses: actions/checkout@v2.3.4
37+
- uses: actions/checkout@v2.4.0
1838

19-
- name: Add Clang/LLVM repositories
39+
- name: Add Clang/LLVM repositories (Non-MinGW)
40+
if: "${{ ! contains(matrix.cmake_args, 'mingw') }}"
2041
run: |-
2142
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
22-
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main'
43+
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
2344
2445
- name: Install build dependencies
2546
run: |-
47+
sudo apt-get update
2648
sudo apt-get install --yes --no-install-recommends -V \
27-
clang-11 \
2849
cmake \
2950
doxygen \
3051
graphviz \
31-
llvm-11 \
3252
lzip \
3353
qhelpgenerator-qt5 \
3454
qtchooser
3555
56+
- name: Install build dependencies (MinGW)
57+
if: "${{ contains(matrix.cmake_args, 'mingw') }}"
58+
run: |-
59+
sudo dpkg --add-architecture i386 # for wine32
60+
sudo apt-add-repository ppa:ondrej/php -y # due to libwine:i386 conflicts
61+
sudo apt-get update # again, due to new architecture
62+
sudo apt-get install --yes --no-install-recommends -V \
63+
mingw-w64 \
64+
wine-stable \
65+
wine32
66+
67+
- name: Install build dependencies (Non-MinGW)
68+
if: "${{ ! contains(matrix.cmake_args, 'mingw') }}"
69+
run: |-
70+
sudo apt-get install --yes --no-install-recommends -V \
71+
clang-13 \
72+
llvm-13
73+
3674
- name: Build, test and install
3775
run: |-
76+
set -x
3877
sed 's,:,\n,g' <<<"${PATH}"
39-
clang --version
78+
cmake --version
4079
4180
GTEST_VERSION=1.8.1
4281
GTEST_PREFIX=~/.local/
@@ -45,10 +84,15 @@ jobs:
4584
tar xf release-${GTEST_VERSION}.tar.gz
4685
(
4786
cd googletest-release-${GTEST_VERSION}/
87+
88+
# Silence warning "Compatibility with CMake < 2.8.12 will be removed"
89+
find -name CMakeLists.txt -print -exec sed 's/cmake_minimum_required.*/cmake_minimum_required(VERSION 3.0.2)/' -i {} \;
90+
4891
cmake \
4992
-DBUILD_SHARED_LIBS=ON \
5093
-DCVF_VERSION=${GTEST_VERSION} \
5194
-DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX} \
95+
${{ matrix.cmake_args }} \
5296
.
5397
make
5498
make install
@@ -61,17 +105,15 @@ jobs:
61105
62106
-O1
63107
-g
64-
-fsanitize=address,undefined,leak
65-
-fno-sanitize-recover=all
66-
-fno-omit-frame-pointer
108+
${{ matrix.cflags }}
67109
68110
-Wall
69111
-Wextra
70112
-pedantic
71113
)
72114
CFLAGS="${compile_flags[*]} -std=c89"
73115
CXXFLAGS="${compile_flags[*]} -std=c++98"
74-
LDFLAGS='-g -fsanitize=address'
116+
LDFLAGS='-g ${{ matrix.ldflags }}'
75117
cmake_args=(
76118
-DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX}
77119
@@ -80,20 +122,29 @@ jobs:
80122
-Wdeprecated
81123
-Werror=deprecated
82124
83-
-DCMAKE_C_COMPILER=clang-11
84-
-DCMAKE_CXX_COMPILER=clang++-11
85125
-DCMAKE_C_FLAGS="${CFLAGS}"
86126
-DCMAKE_CXX_FLAGS="${CXXFLAGS}"
87127
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
88128
-DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}"
89129
-DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}"
90130
131+
${{ matrix.cmake_args }}
132+
91133
-DURIPARSER_WARNINGS_AS_ERRORS=ON
92134
)
93135
cmake "${cmake_args[@]}" -DCMAKE_INSTALL_INCLUDEDIR=include123 ..
94136
95137
make VERBOSE=1 all
96138
139+
# NOTE: We need to copy some .dll files next to the
140+
# Windows binaries so that they are ready to be executed
141+
if [[ "${{ matrix.cmake_args }}" == *mingw* ]]; then
142+
cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libgcc_s_sjlj-1.dll ./
143+
cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libstdc++-6.dll ./
144+
cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll ./
145+
cp "${GTEST_PREFIX}"/bin/libgtest.dll ./
146+
fi
147+
97148
make VERBOSE=1 test ARGS=--verbose
98149
cat Testing/Temporary/LastTest.log
99150
@@ -106,11 +157,19 @@ jobs:
106157
pushd cmake/test_find_package
107158
cmake "${cmake_args[@]}" .
108159
make VERBOSE=1
109-
./hello
160+
if [[ "${{ matrix.cmake_args }}" == *mingw* ]]; then
161+
cp "${GTEST_PREFIX}"/bin/liburiparser-1.dll ./
162+
wine ./hello.exe
163+
else
164+
./hello
165+
fi
110166
popd
111167
112168
git fetch --tags --unshallow origin # for "git describe" in make-distcheck.sh
113169
114-
./make-distcheck.sh -DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX} # without AddressSanitizer
170+
GTEST_PREFIX="${GTEST_PREFIX}" \
171+
./make-distcheck.sh \
172+
-DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX} \
173+
${{ matrix.cmake_args }}
115174
116175
! git status | fgrep -A100 'Untracked files:' # works best at the very end

3rd/uriparser/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/.idea/
12
/config.h
23
/build/
4+
/cmake-build-debug/
35
/CMakeCache.txt
46
/CMakeDoxyfile.in
57
/CMakeDoxygenDefaults.cmake

3rd/uriparser/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cmake_minimum_required(VERSION 3.11)
4040

4141
project(uriparser
4242
VERSION
43-
0.9.5
43+
0.9.6
4444
LANGUAGES
4545
C
4646
)

3rd/uriparser/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ please check out [https://uriparser.github.io/](https://uriparser.github.io/).
1818

1919

2020
# Example use from an existing CMake project
21+
2122
```cmake
22-
project(hello VERSION 1.0)
23+
cmake_minimum_required(VERSION 3.3)
24+
25+
project(hello VERSION 1.0.0)
2326
2427
find_package(uriparser 0.9.2 CONFIG REQUIRED char wchar_t)
2528

3rd/uriparser/THANKS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Adam Frisby
22
Adam Gross
3-
Adeodato Sim�
4-
Adrian Manrique
3+
Adeodato Sim?Adrian Manrique
54
Alexander Klink
5+
Alexander Richardson
66
Arkadiusz Miskiewicz
77
Andreas Sturmlechner
88
Blair Sadewitz
@@ -44,9 +44,10 @@ myd7349
4444
Periklis Akritidis
4545
Philip de Nier
4646
Radu Hociung
47+
Rafael Fontenelle
4748
Ralf S. Engelschall
4849
Rakesh Pandit
49-
RenRebe
50+
Ren?Rebe
5051
Richard Hodges
5152
Robert Buchholz
5253
Robert Kausch

3rd/uriparser/appveyor.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configuration:
4141
# - Release
4242

4343
environment:
44-
GTEST_VERSION: 1.8.1
44+
GTEST_VERSION: 1.10.0
4545

4646
# https://www.appveyor.com/docs/windows-images-software/
4747
matrix:
@@ -65,19 +65,30 @@ environment:
6565
CMAKE_GENERATOR: Visual Studio 15 2017 Win64
6666
PLATFORM: x64
6767

68+
# Visual Studio 2019, 32 bit
69+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
70+
CMAKE_GENERATOR: Visual Studio 16 2019
71+
COMMON_CMAKE_ARGS: -A Win32
72+
73+
# Visual Studio 2019, 64 bit
74+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
75+
CMAKE_GENERATOR: Visual Studio 16 2019
76+
COMMON_CMAKE_ARGS: -A x64
77+
6878
before_build:
6979
- curl -fsSL -o release-%GTEST_VERSION%.zip https://github.com/google/googletest/archive/release-%GTEST_VERSION%.zip
7080
- unzip -q release-%GTEST_VERSION%.zip
7181
- cd googletest-release-%GTEST_VERSION%
7282
- cmake
7383
-G "%CMAKE_GENERATOR%"
7484
-DCVF_VERSION=%GTEST_VERSION%
85+
%COMMON_CMAKE_ARGS%
7586
.
7687
- cmake --build . --config Release -- /m
7788
# BEGIN Enrich folder to make FindGTest.cmake happy
7889
- md googletest\lib
79-
- copy googlemock\gtest\Release\gtest.lib googletest\lib
80-
- copy googlemock\gtest\Release\gtest_main.lib googletest\lib
90+
- copy lib\Release\gtest.lib googletest\lib
91+
- copy lib\Release\gtest_main.lib googletest\lib
8192
# END
8293
- cd ..
8394
- mkdir build
@@ -89,6 +100,7 @@ before_build:
89100
-DURIPARSER_BUILD_DOCS=OFF
90101
-DURIPARSER_MSVC_RUNTIME=/MT
91102
-DURIPARSER_WARNINGS_AS_ERRORS=ON
103+
%COMMON_CMAKE_ARGS%
92104
..
93105

94106
build:

3rd/uriparser/cmake/test_find_package/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/Makefile
44
/cmake_install.cmake
55
/hello
6+
/hello.exe
7+
/liburiparser-1.dll

3rd/uriparser/doc/preprocess.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
#! /bin/sh
1+
#! /usr/bin/env bash
22
# Run GCC preprocessor and delete empty lines
3-
cpp -DURI_DOXYGEN -DURI_NO_UNICODE -C -I ../include $1 | sed -e '/^$/d' -e 's/COMMENT_HACK//g'
3+
: ${CPP:=cpp}
4+
"${CPP}" -DURI_DOXYGEN -DURI_NO_UNICODE -C -I ../include "$1" | sed -e '/^$/d' -e 's/COMMENT_HACK//g'

3rd/uriparser/include/uriparser/Uri.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* 6db8b5726a796167bb96b3d83ff9ac6792a01474dbe3778deb3c2a25d60b3693 (0.9.5+)
1+
/* 0beb20dace01f4b2fa24c3bf9f7e8e616f621e4697260805a2b63a4d190e64c0 (0.9.6+)
22
*
33
* uriparser - RFC 3986 URI parsing library
44
*
@@ -769,7 +769,7 @@ URI_PUBLIC int URI_FUNC(WindowsFilenameToUriString)(const URI_CHAR * filename,
769769

770770
/**
771771
* Extracts a Unix filename from a %URI string.
772-
* The destination buffer must be large enough to hold len(uriString) + 1 - 7
772+
* The destination buffer must be large enough to hold len(uriString) + 1 - 5
773773
* characters in case of an absolute %URI or len(uriString) + 1 in case
774774
* of a relative %URI.
775775
*

3rd/uriparser/include/uriparser/UriBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/* Version */
5656
#define URI_VER_MAJOR 0
5757
#define URI_VER_MINOR 9
58-
#define URI_VER_RELEASE 5
58+
#define URI_VER_RELEASE 6
5959
#define URI_VER_SUFFIX_ANSI ""
6060
#define URI_VER_SUFFIX_UNICODE URI_ANSI_TO_UNICODE(URI_VER_SUFFIX_ANSI)
6161

0 commit comments

Comments
 (0)