Skip to content

Commit 6a2bb0f

Browse files
committed
Merge bitcoin/bitcoin#33151: subtree: update crc32c subtree
9a5d297 Squashed 'src/crc32c/' changes from b60d2b7334..efb8ea04e4 (fanquake) Pull request description: Sync the subtree with latest upstream. The changes here are a no-op, but pull them to fix the drive-by-typo-fixing: #33057. Includes bitcoin-core/crc32c-subtree#8. ACKs for top commit: maflcko: lgtm ACK 8ef8dd6 janb84: ACK 8ef8dd6 Tree-SHA512: b20a47514218206b934c4aa27ec667fb9b3ec7f7388a78725c52fc6e916358d2b9a2075a37808dbc2430b4c7816511ecf20e36bfe2fbd2d8a26bc8882a46d5e7
2 parents b43b8be + 8ef8dd6 commit 6a2bb0f

File tree

7 files changed

+111
-117
lines changed

7 files changed

+111
-117
lines changed

src/crc32c/.appveyor.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright 2021 The CRC32C Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file. See the AUTHORS file for names of contributors.
4+
5+
name: ci
6+
on: [push, pull_request]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build-and-test:
13+
name: >-
14+
CI
15+
${{ matrix.os }}
16+
${{ matrix.compiler }}
17+
${{ matrix.optimized && 'release' || 'debug' }}
18+
${{ matrix.shared_lib && 'shared' || 'static' }}
19+
${{ matrix.use_glog && 'glog' || 'no-glog' }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
compiler: [clang, gcc, msvc]
25+
os: [ubuntu-latest, macos-latest, windows-latest]
26+
optimized: [true, false]
27+
shared_lib: [true, false]
28+
use_glog: [true, false]
29+
exclude:
30+
# Our glog config doesn't work with shared libraries.
31+
- use_glog: true
32+
shared_lib: true
33+
# MSVC only works on Windows.
34+
- os: ubuntu-latest
35+
compiler: msvc
36+
- os: macos-latest
37+
compiler: msvc
38+
# Not testing with GCC on macOS.
39+
- os: macos-latest
40+
compiler: gcc
41+
# Only testing with MSVC on Windows.
42+
- os: windows-latest
43+
compiler: clang
44+
- os: windows-latest
45+
compiler: gcc
46+
# Not testing fringe configurations (glog, shared libraries) on Windows.
47+
- os: windows-latest
48+
use_glog: true
49+
- os: windows-latest
50+
shared_lib: true
51+
include:
52+
- compiler: clang
53+
CC: clang
54+
CXX: clang++
55+
- compiler: gcc
56+
CC: gcc
57+
CXX: g++
58+
- compiler: msvc
59+
CC:
60+
CXX:
61+
62+
env:
63+
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
64+
CMAKE_BUILD_TYPE: ${{ matrix.optimized && 'RelWithDebInfo' || 'Debug' }}
65+
CC: ${{ matrix.CC }}
66+
CXX: ${{ matrix.CXX }}
67+
BINARY_SUFFIX: ${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
68+
BINARY_PATH: >-
69+
${{ format(
70+
startsWith(matrix.os, 'windows') && '{0}\build\{1}\' || '{0}/build/',
71+
github.workspace,
72+
matrix.optimized && 'RelWithDebInfo' || 'Debug') }}
73+
74+
steps:
75+
- uses: actions/checkout@v2
76+
with:
77+
submodules: true
78+
79+
- name: Generate build config
80+
run: >-
81+
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}"
82+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
83+
-DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/install_test/
84+
-DBUILD_SHARED_LIBS=${{ matrix.shared_lib && '1' || '0' }}
85+
-DCRC32C_USE_GLOG=${{ matrix.use_glog && '1' || '0' }}
86+
87+
- name: Build
88+
run: >-
89+
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
90+
--config "${{ env.CMAKE_BUILD_TYPE }}"
91+
92+
- name: Run C++ API Tests
93+
run: ${{ env.BINARY_PATH }}crc32c_tests${{ env.BINARY_SUFFIX }}
94+
95+
- name: Run C API Tests
96+
run: ${{ env.BINARY_PATH }}crc32c_capi_tests${{ env.BINARY_SUFFIX }}
97+
98+
- name: Run Benchmarks
99+
run: ${{ env.BINARY_PATH }}crc32c_bench${{ env.BINARY_SUFFIX }}
100+
101+
- name: Test CMake installation
102+
run: cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install

src/crc32c/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Editors.
22
*.sw*
33
.DS_Store
4+
/.cache
45
/.vscode
56

67
# Build directory.

src/crc32c/.travis.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/crc32c/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ if(CRC32C_BUILD_TESTS)
368368
# Warnings as errors in Visual Studio for this project's targets.
369369
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
370370
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")
371+
372+
# The Windows SDK version currently on CI produces warnings when some
373+
# headers are #included using C99 compatibility mode or above. This
374+
# workaround can be removed once the Windows SDK on our CI is upgraded.
375+
set_property(TARGET crc32c_capi_tests
376+
APPEND PROPERTY COMPILE_OPTIONS "/wd5105")
371377
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
372378

373379
add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)

src/crc32c/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# CRC32C
22

3-
[![Build Status](https://travis-ci.org/google/crc32c.svg?branch=master)](https://travis-ci.org/google/crc32c)
4-
[![Build Status](https://ci.appveyor.com/api/projects/status/moiq7331pett4xuj/branch/master?svg=true)](https://ci.appveyor.com/project/pwnall/crc32c)
3+
[![Build Status](https://github.com/google/crc32c/actions/workflows/build.yml/badge.svg)](https://github.com/google/crc32c/actions/workflows/build.yml)
54

65
New file format authors should consider
76
[HighwayHash](https://github.com/google/highwayhash). The initial version of

src/crc32c/src/crc32c_sse42.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ uint32_t ExtendSse42(uint32_t crc, const uint8_t* data, size_t size) {
176176
}
177177
}
178178

179-
// Proccess the data in predetermined block sizes with tables for quickly
179+
// Process the data in predetermined block sizes with tables for quickly
180180
// combining the checksum. Experimentally it's better to use larger block
181181
// sizes where possible so use a hierarchy of decreasing block sizes.
182182
uint64_t l64 = l;

0 commit comments

Comments
 (0)