Compare commits
6
Commits
29d0997ca3
...
60881419b8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60881419b8 | ||
|
|
e9c904a86b | ||
|
|
789ae8cbb9 | ||
|
|
d70e6a2455 | ||
|
|
8a5168f232 | ||
|
|
742d920aa1 |
+31
-7
@@ -19,9 +19,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
. /etc/os-release
|
||||||
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||||
|
echo "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
clang git nodejs pre-commit
|
clang-21 git nodejs pre-commit
|
||||||
|
for tool in clang clang++; do
|
||||||
|
sudo update-alternatives --install /usr/bin/${tool} ${tool} /usr/bin/${tool}-21 100
|
||||||
|
done
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -57,12 +63,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
. /etc/os-release
|
||||||
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||||
|
echo "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
build-essential ccache clang cmake gcc g++ \
|
build-essential ccache clang-21 cmake gcc g++ \
|
||||||
libc6-dbg llvm mold ninja-build python3 valgrind zstd
|
libc6-dbg llvm-21 lld-21 mold ninja-build python3 valgrind zstd
|
||||||
sudo curl -Ls "https://dl.min.io/client/mc/release/linux-amd64/mc" \
|
sudo curl -Ls "https://dl.min.io/client/mc/release/linux-amd64/mc" \
|
||||||
-o /usr/local/bin/mc && sudo chmod +x /usr/local/bin/mc
|
-o /usr/local/bin/mc && sudo chmod +x /usr/local/bin/mc
|
||||||
|
for tool in clang clang++ llvm-ar llvm-nm llvm-ranlib llvm-objcopy llvm-cov llvm-symbolizer lld ld.lld; do
|
||||||
|
sudo update-alternatives --install /usr/bin/${tool} ${tool} /usr/bin/${tool}-21 100
|
||||||
|
done
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -124,14 +136,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
. /etc/os-release
|
||||||
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||||
|
echo "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
biber build-essential ccache clang cmake devscripts \
|
biber build-essential ccache clang-21 cmake devscripts \
|
||||||
latexmk libc6-dbg llvm mold ninja-build rpm \
|
latexmk libc6-dbg llvm-21 lld-21 mold ninja-build rpm \
|
||||||
texlive-bibtex-extra texlive-fonts-recommended \
|
texlive-bibtex-extra texlive-fonts-recommended \
|
||||||
texlive-latex-extra texlive-pictures valgrind zstd
|
texlive-latex-extra texlive-pictures valgrind zstd
|
||||||
sudo curl -Ls "https://dl.min.io/client/mc/release/linux-$(dpkg --print-architecture)/mc" \
|
sudo curl -Ls "https://dl.min.io/client/mc/release/linux-$(dpkg --print-architecture)/mc" \
|
||||||
-o /usr/local/bin/mc && sudo chmod +x /usr/local/bin/mc
|
-o /usr/local/bin/mc && sudo chmod +x /usr/local/bin/mc
|
||||||
|
for tool in clang clang++ llvm-ar llvm-nm llvm-ranlib llvm-objcopy llvm-cov llvm-symbolizer lld ld.lld; do
|
||||||
|
sudo update-alternatives --install /usr/bin/${tool} ${tool} /usr/bin/${tool}-21 100
|
||||||
|
done
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -212,12 +230,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
. /etc/os-release
|
||||||
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||||
|
echo "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
build-essential ccache clang cmake gcovr \
|
build-essential ccache clang-21 cmake gcovr \
|
||||||
libc6-dbg llvm mold ninja-build python3 valgrind zstd
|
libc6-dbg llvm-21 lld-21 mold ninja-build python3 valgrind zstd
|
||||||
sudo curl -Ls "https://dl.min.io/client/mc/release/linux-amd64/mc" \
|
sudo curl -Ls "https://dl.min.io/client/mc/release/linux-amd64/mc" \
|
||||||
-o /usr/local/bin/mc && sudo chmod +x /usr/local/bin/mc
|
-o /usr/local/bin/mc && sudo chmod +x /usr/local/bin/mc
|
||||||
|
for tool in clang clang++ llvm-ar llvm-nm llvm-ranlib llvm-objcopy llvm-cov llvm-symbolizer lld ld.lld; do
|
||||||
|
sudo update-alternatives --install /usr/bin/${tool} ${tool} /usr/bin/${tool}-21 100
|
||||||
|
done
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
+14
-2
@@ -383,13 +383,25 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND BUILD_TESTING)
|
|||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
find_program(HARDENING_CHECK hardening-check)
|
find_program(HARDENING_CHECK hardening-check)
|
||||||
if(HARDENING_CHECK)
|
if(HARDENING_CHECK)
|
||||||
|
# Not all versions of hardening-check support the same options, so query
|
||||||
|
# the help output before using architecture-specific skips.
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${HARDENING_CHECK} --help
|
||||||
|
OUTPUT_VARIABLE hardening_check_help
|
||||||
|
ERROR_VARIABLE hardening_check_help
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set(hardening_check_arch_flags "")
|
||||||
# Control flow integrity (CET) is x86-only and branch protection (PAC/BTI)
|
# Control flow integrity (CET) is x86-only and branch protection (PAC/BTI)
|
||||||
# is arm64-only, so ignore whichever doesn't apply.
|
# is arm64-only, so ignore whichever doesn't apply.
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR
|
||||||
STREQUAL arm64)
|
STREQUAL arm64)
|
||||||
set(hardening_check_arch_flags --nocfprotection)
|
if(hardening_check_help MATCHES "nocfprotection")
|
||||||
|
list(APPEND hardening_check_arch_flags --nocfprotection)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(hardening_check_arch_flags --nobranchprotection)
|
if(hardening_check_help MATCHES "nobranchprotection")
|
||||||
|
list(APPEND hardening_check_arch_flags --nobranchprotection)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
add_test(
|
add_test(
|
||||||
NAME hardening_check
|
NAME hardening_check
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ class ConflictSet:
|
|||||||
ctypes.POINTER(ctypes.c_int),
|
ctypes.POINTER(ctypes.c_int),
|
||||||
ctypes.c_int,
|
ctypes.c_int,
|
||||||
)
|
)
|
||||||
|
self._lib.ConflictSet_check.restype = None
|
||||||
|
|
||||||
self._lib.ConflictSet_addWrites.argtypes = (
|
self._lib.ConflictSet_addWrites.argtypes = (
|
||||||
ctypes.c_void_p,
|
ctypes.c_void_p,
|
||||||
@@ -95,13 +96,16 @@ class ConflictSet:
|
|||||||
ctypes.c_int,
|
ctypes.c_int,
|
||||||
ctypes.c_int64,
|
ctypes.c_int64,
|
||||||
)
|
)
|
||||||
|
self._lib.ConflictSet_addWrites.restype = None
|
||||||
|
|
||||||
self._lib.ConflictSet_setOldestVersion.argtypes = (
|
self._lib.ConflictSet_setOldestVersion.argtypes = (
|
||||||
ctypes.c_void_p,
|
ctypes.c_void_p,
|
||||||
ctypes.c_int64,
|
ctypes.c_int64,
|
||||||
)
|
)
|
||||||
|
self._lib.ConflictSet_setOldestVersion.restype = None
|
||||||
|
|
||||||
self._lib.ConflictSet_destroy.argtypes = (ctypes.c_void_p,)
|
self._lib.ConflictSet_destroy.argtypes = (ctypes.c_void_p,)
|
||||||
|
self._lib.ConflictSet_destroy.restype = None
|
||||||
|
|
||||||
self._lib.ConflictSet_getBytes.argtypes = (ctypes.c_void_p,)
|
self._lib.ConflictSet_getBytes.argtypes = (ctypes.c_void_p,)
|
||||||
self._lib.ConflictSet_getBytes.restype = ctypes.c_int64
|
self._lib.ConflictSet_getBytes.restype = ctypes.c_int64
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ def test_update_zero_should_commit():
|
|||||||
for i in range(256 - 17, 256):
|
for i in range(256 - 17, 256):
|
||||||
cs2.addWrites(int(1), write(bytes([i])))
|
cs2.addWrites(int(1), write(bytes([i])))
|
||||||
# Scan until first point write
|
# Scan until first point write
|
||||||
cs2.check(read(0, b"\x00", bytes([256 - 17])))
|
assert cs2.check(read(0, b"\x00", bytes([256 - 17]))) == [Result.COMMIT]
|
||||||
|
|
||||||
|
|
||||||
def test_update_zero_should_conflict():
|
def test_update_zero_should_conflict():
|
||||||
@@ -81,7 +81,7 @@ def test_update_zero_should_conflict():
|
|||||||
# "zero" is now 2**31 + 100
|
# "zero" is now 2**31 + 100
|
||||||
cs1.addWrites(2**32 + 101, write(b"", b"\x02"), write(b"\x01"))
|
cs1.addWrites(2**32 + 101, write(b"", b"\x02"), write(b"\x01"))
|
||||||
# rangeVersion of \x01 is now 2**31 + 100 ("max" of (2**31 + 100, 2**32 + 101))
|
# rangeVersion of \x01 is now 2**31 + 100 ("max" of (2**31 + 100, 2**32 + 101))
|
||||||
cs1.check(read(2**32 + 1, b"\x00"))
|
assert cs1.check(read(2**32 + 1, b"\x00")) == [Result.CONFLICT]
|
||||||
# but 2**32 + 1 ">" 2**31 + 100 , and it incorrectly commits
|
# but 2**32 + 1 ">" 2**31 + 100 , and it incorrectly commits
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user