Skip to content

Commit 349216b

Browse files
committed
Merge commit '7025d76d94779dd94b83a68598b871dff091f54e' as 'third_party/fmt'
2 parents 0fd7947 + 7025d76 commit 349216b

File tree

132 files changed

+82935
-0
lines changed

Some content is hidden

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

132 files changed

+82935
-0
lines changed

third_party/fmt/.clang-format

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Run manually to reformat a file:
2+
# clang-format -i --style=file <file>
3+
Language: Cpp
4+
BasedOnStyle: Google
5+
IndentPPDirectives: AfterHash
6+
IndentCaseLabels: false
7+
AlwaysBreakTemplateDeclarations: false
8+
DerivePointerAlignment: false
9+
AllowShortCaseLabelsOnASingleLine: true
10+
QualifierAlignment: Left
11+
AlignConsecutiveShortCaseStatements:
12+
Enabled: true
13+
AcrossEmptyLines: true
14+
AcrossComments: true
15+
AlignCaseColons: false
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions" # Necessary to update action hashes.
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
# Allow up to 3 opened pull requests for github-actions versions.
8+
open-pull-requests-limit: 3
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!--
2+
Please make sure that the problem reproduces on the current master before
3+
submitting an issue.
4+
If possible please provide a repro on Compiler Explorer:
5+
https://godbolt.org/z/fxccbh53W.
6+
-->
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
Please read the contribution guidelines before submitting a pull request:
3+
https://github.com/fmtlib/fmt/blob/master/CONTRIBUTING.md.
4+
By submitting this pull request, you agree to license your contribution(s)
5+
under the terms outlined in LICENSE.rst and represent that you have the right
6+
to do so.
7+
-->
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CIFuzz
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
Fuzzing:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Build fuzzers
12+
id: build
13+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@92182553173581f871130c71c71b17f003d47b0a
14+
with:
15+
oss-fuzz-project-name: 'fmt'
16+
dry-run: false
17+
language: c++
18+
19+
- name: Run fuzzers
20+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@92182553173581f871130c71c71b17f003d47b0a
21+
with:
22+
oss-fuzz-project-name: 'fmt'
23+
fuzz-seconds: 300
24+
dry-run: false
25+
language: c++
26+
27+
- name: Upload crash
28+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
29+
if: failure() && steps.build.outcome == 'success'
30+
with:
31+
name: artifacts
32+
path: ./out/artifacts
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: doc
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-22.04
11+
12+
steps:
13+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
14+
15+
- name: Add Ubuntu mirrors
16+
run: |
17+
# Github Actions caching proxy is at times unreliable
18+
# see https://github.com/actions/runner-images/issues/7048
19+
printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt
20+
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
21+
sudo sed -i 's~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:/etc/apt/mirrors.txt~' /etc/apt/sources.list
22+
23+
- name: Create build environment
24+
run: |
25+
sudo apt update
26+
sudo apt install doxygen
27+
pip install mkdocs-material==9.5.25 mkdocstrings==0.26.1 mike==2.1.1
28+
cmake -E make_directory ${{runner.workspace}}/build
29+
# Workaround https://github.com/actions/checkout/issues/13:
30+
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
31+
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
32+
33+
- name: Build
34+
working-directory: ${{runner.workspace}}/build
35+
run: $GITHUB_WORKSPACE/support/mkdocs deploy dev
36+
37+
- name: Deploy
38+
env:
39+
KEY: "${{secrets.KEY}}"
40+
if: env.KEY != '' && github.ref == 'refs/heads/master'
41+
working-directory: ${{runner.workspace}}/fmt/build/fmt.dev
42+
run: git push https://$KEY@github.com/fmtlib/fmt.dev.git
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.h'
7+
- '**.cc'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
format_code:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
17+
18+
- name: Install clang-format
19+
run: |
20+
wget https://apt.llvm.org/llvm.sh
21+
sudo bash ./llvm.sh 17
22+
sudo apt install clang-format-17
23+
24+
- name: Run clang-format
25+
run: |
26+
find include src -name '*.h' -o -name '*.cc' | \
27+
xargs clang-format-17 -i -style=file -fallback-style=none
28+
git diff --exit-code
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: linux
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-22.04
11+
strategy:
12+
matrix:
13+
cxx: [g++-4.9, g++-11, clang++-3.6, clang++-11]
14+
build_type: [Debug, Release]
15+
std: [11]
16+
shared: [""]
17+
include:
18+
- cxx: g++-4.9
19+
- cxx: clang++-3.6
20+
- cxx: g++-11
21+
build_type: Debug
22+
std: 14
23+
install: sudo apt install g++-11
24+
- cxx: g++-11
25+
build_type: Debug
26+
std: 17
27+
- cxx: g++-11
28+
build_type: Debug
29+
std: 20
30+
install: sudo apt install g++-11
31+
- cxx: g++-13
32+
build_type: Release
33+
std: 23
34+
install: sudo apt install g++-13
35+
shared: -DBUILD_SHARED_LIBS=ON
36+
- cxx: clang++-11
37+
build_type: Debug
38+
std: 17
39+
cxxflags: -stdlib=libc++
40+
install: sudo apt install clang-11 libc++-11-dev libc++abi-11-dev
41+
- cxx: clang++-11
42+
install: sudo apt install clang-11
43+
- cxx: clang++-11
44+
build_type: Debug
45+
fuzz: -DFMT_FUZZ=ON -DFMT_FUZZ_LINKMAIN=ON
46+
std: 17
47+
install: sudo apt install clang-11
48+
- cxx: clang++-14
49+
build_type: Debug
50+
std: 20
51+
- cxx: clang++-14
52+
build_type: Debug
53+
std: 20
54+
cxxflags: -stdlib=libc++
55+
install: sudo apt install libc++-14-dev libc++abi-14-dev
56+
57+
steps:
58+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
59+
60+
- name: Set timezone
61+
run: sudo timedatectl set-timezone 'Europe/Kyiv'
62+
63+
- name: Install GCC 4.9
64+
run: |
65+
sudo apt update
66+
sudo apt install libatomic1 libc6-dev libgomp1 libitm1 libmpc3
67+
# https://launchpad.net/ubuntu/xenial/amd64/g++-4.9/4.9.3-13ubuntu2
68+
wget --no-verbose \
69+
http://launchpadlibrarian.net/230069137/libmpfr4_3.1.3-2_amd64.deb \
70+
http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb \
71+
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
72+
http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
73+
http://launchpadlibrarian.net/253728426/libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
74+
http://launchpadlibrarian.net/253728432/libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
75+
http://launchpadlibrarian.net/253728314/gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
76+
http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
77+
http://launchpadlibrarian.net/253728399/cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
78+
http://launchpadlibrarian.net/253728404/gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
79+
http://launchpadlibrarian.net/253728401/g++-4.9_4.9.3-13ubuntu2_amd64.deb
80+
sudo dpkg -i \
81+
libmpfr4_3.1.3-2_amd64.deb \
82+
libasan1_4.9.3-13ubuntu2_amd64.deb \
83+
libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
84+
libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
85+
libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
86+
libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
87+
gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
88+
gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
89+
cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
90+
gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
91+
g++-4.9_4.9.3-13ubuntu2_amd64.deb
92+
if: ${{ matrix.cxx == 'g++-4.9' }}
93+
94+
- name: Install Clang 3.6
95+
run: |
96+
sudo apt update
97+
sudo apt install libtinfo5
98+
# https://code.launchpad.net/ubuntu/xenial/amd64/clang-3.6/1:3.6.2-3ubuntu2
99+
wget --no-verbose \
100+
http://launchpadlibrarian.net/230019046/libffi6_3.2.1-4_amd64.deb \
101+
http://launchpadlibrarian.net/445346109/libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
102+
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
103+
http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
104+
http://launchpadlibrarian.net/445346128/libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
105+
http://launchpadlibrarian.net/445346113/libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
106+
http://launchpadlibrarian.net/445346131/libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
107+
http://launchpadlibrarian.net/445346022/libobjc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
108+
http://launchpadlibrarian.net/254405108/libllvm3.6v5_3.6.2-3ubuntu2_amd64.deb \
109+
http://launchpadlibrarian.net/254405097/libclang-common-3.6-dev_3.6.2-3ubuntu2_amd64.deb \
110+
http://launchpadlibrarian.net/254405101/libclang1-3.6_3.6.2-3ubuntu2_amd64.deb \
111+
http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
112+
http://launchpadlibrarian.net/254405091/clang-3.6_3.6.2-3ubuntu2_amd64.deb
113+
sudo dpkg -i \
114+
libffi6_3.2.1-4_amd64.deb \
115+
libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
116+
libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
117+
libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
118+
libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
119+
libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
120+
libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
121+
libobjc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
122+
libllvm3.6v5_3.6.2-3ubuntu2_amd64.deb \
123+
libclang-common-3.6-dev_3.6.2-3ubuntu2_amd64.deb \
124+
libclang1-3.6_3.6.2-3ubuntu2_amd64.deb \
125+
gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
126+
clang-3.6_3.6.2-3ubuntu2_amd64.deb
127+
if: ${{ matrix.cxx == 'clang++-3.6' }}
128+
129+
- name: Add repositories for newer GCC
130+
run: |
131+
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
132+
if: ${{ matrix.cxx == 'g++-13' }}
133+
134+
- name: Add Ubuntu mirrors
135+
run: |
136+
# GitHub Actions caching proxy is at times unreliable
137+
# see https://github.com/actions/runner-images/issues/7048.
138+
mirrors=/etc/apt/mirrors.txt
139+
printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | \
140+
sudo tee $mirrors
141+
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append $mirrors
142+
sudo sed -i \
143+
"s~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:$mirrors~" \
144+
/etc/apt/sources.list
145+
146+
- name: Create build environment
147+
run: |
148+
sudo apt update
149+
${{matrix.install}}
150+
sudo apt install locales-all
151+
cmake -E make_directory ${{runner.workspace}}/build
152+
153+
- name: Configure
154+
working-directory: ${{runner.workspace}}/build
155+
env:
156+
CXX: ${{matrix.cxx}}
157+
CXXFLAGS: ${{matrix.cxxflags}}
158+
run: |
159+
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
160+
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
161+
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
162+
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
163+
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON \
164+
${{matrix.fuzz}} ${{matrix.shared}} $GITHUB_WORKSPACE
165+
166+
- name: Build
167+
working-directory: ${{runner.workspace}}/build
168+
run: |
169+
threads=`nproc`
170+
cmake --build . --config ${{matrix.build_type}} --parallel $threads
171+
172+
- name: Test
173+
working-directory: ${{runner.workspace}}/build
174+
run: ctest -C ${{matrix.build_type}}
175+
env:
176+
CTEST_OUTPUT_ON_FAILURE: True
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: macos
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
os: [macos-13, macos-14]
13+
build_type: [Debug, Release]
14+
std: [11, 17, 20]
15+
shared: [""]
16+
exclude:
17+
- { os: macos-13, std: 11 }
18+
- { os: macos-13, std: 17 }
19+
include:
20+
- os: macos-14
21+
std: 23
22+
build_type: Release
23+
shared: -DBUILD_SHARED_LIBS=ON
24+
25+
runs-on: '${{ matrix.os }}'
26+
27+
steps:
28+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
29+
30+
- name: Set timezone
31+
run: sudo systemsetup -settimezone 'Europe/Minsk'
32+
33+
- name: Select Xcode 14.3 (macOS 13)
34+
run: sudo xcode-select -s "/Applications/Xcode_14.3.app"
35+
if: ${{ matrix.os == 'macos-13' }}
36+
37+
- name: Create Build Environment
38+
run: cmake -E make_directory ${{runner.workspace}}/build
39+
40+
- name: Configure
41+
working-directory: ${{runner.workspace}}/build
42+
run: |
43+
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.shared}} \
44+
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
45+
-DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
46+
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
47+
48+
- name: Build
49+
working-directory: ${{runner.workspace}}/build
50+
run: |
51+
threads=`sysctl -n hw.logicalcpu`
52+
cmake --build . --config ${{matrix.build_type}} --parallel $threads
53+
54+
- name: Test
55+
working-directory: ${{runner.workspace}}/build
56+
run: ctest -C ${{matrix.build_type}}
57+
env:
58+
CTEST_OUTPUT_ON_FAILURE: True

0 commit comments

Comments
 (0)