Skip to content

Commit

Permalink
Merge pull request #2515 from facebook/dev
Browse files Browse the repository at this point in the history
ZStandard v1.4.9
  • Loading branch information
felixhandte committed Mar 2, 2021
2 parents 97a3da1 + 74d65ea commit e4558ff
Show file tree
Hide file tree
Showing 229 changed files with 2,548 additions and 824 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
command: |
make gnu90build; make clean
make gnu99build; make clean
make ppc64build; make clean
make ppcbuild ; make clean
make armbuild ; make clean
make ppc64build V=1; make clean
make ppcbuild V=1; make clean
make armbuild V=1; make clean
make -C tests test-legacy test-longmatch; make clean
make -C lib libzstd-nomt; make clean
# This step is only run on release tags.
Expand Down
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ task:
name: FreeBSD (shortest)
freebsd_instance:
matrix:
image_family: freebsd-12-1
image_family: freebsd-12-2
# The stable 11.3 image causes "Agent is not responding" so use a snapshot
image_family: freebsd-11-3-snap
install_script: pkg install -y gmake coreutils
Expand Down
95 changes: 42 additions & 53 deletions .github/workflows/generic-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ jobs:
- uses: actions/checkout@v2
- name: make check on 32-bit
run: |
make libc6install
sudo apt update
APT_PACKAGES="gcc-multilib" make apt-install
CFLAGS="-m32 -O1 -fstack-protector" make check V=1
gcc-6-7-libzstd:
gcc-7-libzstd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: gcc-6 + gcc-7 + libzstdmt compilation
- name: gcc-7 + libzstdmt compilation
run: |
make gcc6install gcc7install
CC=gcc-6 CFLAGS=-Werror make -j all
make clean
make gcc7install
CC=gcc-7 CFLAGS=-Werror make -j all
make clean
LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
Expand All @@ -71,30 +70,28 @@ jobs:
make gcc8install
CC=gcc-8 CFLAGS="-Werror" make -j all
make clean
CC=gcc-8 make -j uasan-test-zstd </dev/null
CC=gcc-8 make -j uasan-test-zstd </dev/null V=1
gcc-6-asan-ubsan-testzstd-32bit:
gcc-asan-ubsan-testzstd-32bit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: gcc-6 + ASan + UBSan + Test Zstd, 32bit mode
- name: ASan + UBSan + Test Zstd, 32bit mode
run: |
make gcc6install libc6install
CC=gcc-6 CFLAGS="-Werror -m32" make -j all32
make libc6install
CFLAGS="-Werror -m32" make -j all32
make clean
CC=gcc-6 make -j uasan-test-zstd32
make -j uasan-test-zstd32 V=1
clang-38-msan-testzstd:
runs-on: ubuntu-16.04 # fails on 18.04
clang-msan-testzstd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clang-3.8 + MSan + Test Zstd
- name: clang + MSan + Test Zstd
run: |
# make clang38install (doesn't work)
sudo apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main"
sudo apt-get update
sudo apt-get install clang-3.8
CC=clang-3.8 make clean msan-test-zstd HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0
sudo apt-get install clang
CC=clang make msan-test-zstd HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0 V=1
# Note : external libraries must be turned off when using MSAN tests,
# because they are not msan-instrumented,
Expand All @@ -120,26 +117,14 @@ jobs:
make gcc8install
CC=gcc-8 FUZZER_FLAGS="--long-tests" make clean uasan-fuzztest
gcc-6-asan-ubsan-fuzz32:
gcc-asan-ubsan-fuzz32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: gcc-6 + ASan + UBSan + Fuzz Test 32bit
run: |
make gcc6install libc6install
CC=gcc-6 CFLAGS="-O2 -m32" FUZZER_FLAGS="--long-tests" make uasan-fuzztest
clang-38-msan-fuzz:
runs-on: ubuntu-16.04 # fails on 18.04
steps:
- uses: actions/checkout@v2
- name: clang-3.8 + MSan + Fuzz Test
- name: ASan + UBSan + Fuzz Test 32bit
run: |
# make clang38install (doesn't work)
sudo apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main"
sudo apt-get update
sudo apt-get install clang-3.8
CC=clang-3.8 make clean msan-fuzztest
make libc6install
CFLAGS="-O2 -m32" FUZZER_FLAGS="--long-tests" make uasan-fuzztest
asan-ubsan-msan-regression:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -205,21 +190,25 @@ jobs:
tar -xf shellcheck-v0.7.1.linux.x86_64.tar.xz
shellcheck-v0.7.1/shellcheck --shell=sh --severity=warning --exclude=SC2010 tests/playTests.sh
icc:
name: icc-check
runs-on: ubuntu-latest
steps:
- name: install icc
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -qqq update
sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install -y intel-basekit intel-hpckit
- uses: actions/checkout@v2
- name: make check
run: |
make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check
# For reference : icc tests
# icc tests are currently failing on Github Actions, likely to issues during installation stage
# To be fixed later
#
# icc:
# name: icc-check
# runs-on: ubuntu-latest
# steps:
# - name: install icc
# run: |
# export DEBIAN_FRONTEND=noninteractive
# sudo apt-get -qqq update
# sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
# sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
# sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
# sudo apt-get update
# sudo apt-get install -y intel-basekit intel-hpckit
# - uses: actions/checkout@v2
# - name: make check
# run: |
# make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check
11 changes: 4 additions & 7 deletions .github/workflows/generic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,21 @@ jobs:
make -C tests test-zbuff
tsan:
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: thread sanitizer
run: |
sudo apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main"
sudo apt-get update
sudo apt-get install clang-3.8
CC=clang-3.8 make tsan-test-zstream
CC=clang-3.8 make tsan-fuzztest
CC=clang make tsan-test-zstream
CC=clang make tsan-fuzztest
zlib-wrapper:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: zlib wrapper test
run: |
make gpp6install valgrindinstall
make valgrindinstall
make -C zlibWrapper test
make -C zlibWrapper valgrindTest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sanitizer: [address, undefined, memory]
sanitizer: [address, undefined]
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
id: build
Expand Down
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ matrix:
script:
- make check

- name: make test (complete)
script:
# DEVNULLRIGHTS : will request sudo rights to test permissions on /dev/null
- DEVNULLRIGHTS=test make test

- name: Minimal Decompressor Macros # ~5mn
script:
- make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
v1.4.9 (Mar 1, 2021)
bug: Use `umask()` to Constrain Created File Permissions (#2495, @felixhandte)
bug: Make Simple Single-Pass Functions Ignore Advanced Parameters (#2498, @terrelln)
api: Add (De)Compression Tracing Functionality (#2482, @terrelln)
api: Support References to Multiple DDicts (#2446, @senhuang42)
api: Add Function to Generate Skippable Frame (#2439, @senhuang42)
perf: New Algorithms for the Long Distance Matcher (#2483, @mpu)
perf: Performance Improvements for Long Distance Matcher (#2464, @mpu)
perf: Don't Shrink Window Log when Streaming with a Dictionary (#2451, @terrelln)
cli: Fix `--output-dir-mirror`'s Rejection of `..`-Containing Paths (#2512, @felixhandte)
cli: Allow Input From Console When `-f`/`--force` is Passed (#2466, @felixhandte)
cli: Improve Help Message (#2500, @senhuang42)
tests: Remove Flaky Tests (#2455, #2486, #2445, @Cyan4973)
tests: Correctly Invoke md5 Utility on NetBSD (#2492, @niacat)
tests: Avoid Using `stat -c` on NetBSD (#2513, @felixhandte)
build: Zstd CLI Can Now be Linked to Dynamic `libzstd` (#2457, #2454 @Cyan4973)
build: Hide and Avoid Using Static-Only Symbols (#2501, #2504, @skitt)
build: CMake: Enable Only C for lib/ and programs/ Projects (#2498, @concatime)
build: CMake: Use `configure_file()` to Create the `.pc` File (#2462, @lazka)
build: Fix Fuzzer Compiler Detection & Update UBSAN Flags (#2503, @terrelln)
build: Add Guards for `_LARGEFILE_SOURCE` and `_LARGEFILE64_SOURCE` (#2444, @indygreg)
build: Improve `zlibwrapper` Makefile (#2437, @Cyan4973)
contrib: Add `recover_directory` Program (#2473, @terrelln)
doc: Change License Year to 2021 (#2452 & #2465, @terrelln & @senhuang42)
doc: Fix Typos (#2459, @ThomasWaldmann)

v1.4.8 (Dec 18, 2020)
hotfix: wrong alignment of an internal buffer

Expand Down
24 changes: 11 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ################################################################
# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc.
# Copyright (c) 2015-2021, Yann Collet, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
Expand Down Expand Up @@ -48,7 +48,7 @@ allmost: allzstd zlibwrapper

# skip zwrapper, can't build that on alternate architectures without the proper zlib installed
.PHONY: allzstd
allzstd: lib-all
allzstd: lib
$(Q)$(MAKE) -C $(PRGDIR) all
$(Q)$(MAKE) -C $(TESTDIR) all

Expand All @@ -57,9 +57,8 @@ all32:
$(MAKE) -C $(PRGDIR) zstd32
$(MAKE) -C $(TESTDIR) all32

.PHONY: lib lib-release libzstd.a
lib-all : lib
lib lib-release lib-all :
.PHONY: lib lib-release
lib lib-release :
$(Q)$(MAKE) -C $(ZSTDDIR) $@

.PHONY: zstd zstd-release
Expand Down Expand Up @@ -225,10 +224,10 @@ aarch64build: clean
CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd

ppcbuild: clean
CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd
CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) -j allzstd

ppc64build: clean
CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd
CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) -j allzstd

armfuzz: clean
CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
Expand Down Expand Up @@ -287,12 +286,11 @@ uasanregressiontest:
msanregressiontest:
$(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory"

# run UBsan with -fsanitize-recover=signed-integer-overflow
# due to a bug in UBsan when doing pointer subtraction
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303
# run UBsan with -fsanitize-recover=pointer-overflow
# this only works with recent compilers such as gcc 8+

usan: clean
$(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined -Werror"
$(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=pointer-overflow -fsanitize=undefined -Werror"

asan: clean
$(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror"
Expand All @@ -310,10 +308,10 @@ asan32: clean
$(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address"

uasan: clean
$(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror"
$(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=pointer-overflow -fsanitize=address,undefined -Werror"

uasan-%: clean
LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" $(MAKE) -C $(TESTDIR) $*
LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=pointer-overflow -fsanitize=address,undefined -Werror" $(MAKE) -C $(TESTDIR) $*

tsan-%: clean
LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- COMPILER: "clang"
HOST: "mingw"
PLATFORM: "x64"
SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd"
SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"
BUILD: "true"

- COMPILER: "gcc"
Expand Down Expand Up @@ -204,7 +204,7 @@
- COMPILER: "clang"
HOST: "mingw"
PLATFORM: "x64"
SCRIPT: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd"
SCRIPT: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"

- COMPILER: "visual"
HOST: "visual"
Expand Down
4 changes: 4 additions & 0 deletions build/VS2008/zstd/zstd.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@
RelativePath="..\..\..\programs\zstdcli.c"
>
</File>
<File
RelativePath="..\..\..\programs\zstdcli_trace.c"
>
</File>
<File
RelativePath="..\..\..\lib\compress\zstdmt_compress.c"
>
Expand Down
1 change: 1 addition & 0 deletions build/VS2010/zstd/zstd.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<ClCompile Include="..\..\..\programs\dibio.c" />
<ClCompile Include="..\..\..\programs\fileio.c" />
<ClCompile Include="..\..\..\programs\zstdcli.c" />
<ClCompile Include="..\..\..\programs\zstdcli_trace.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\lib\common\pool.h" />
Expand Down
21 changes: 5 additions & 16 deletions build/cmake/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# in the COPYING file in the root directory of this source tree).
# ################################################################

project(libzstd)
project(libzstd C)

set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
Expand Down Expand Up @@ -137,7 +137,7 @@ endif ()
if (UNIX OR MINGW)
# pkg-config
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
set(EXEC_PREFIX "\\$$\{prefix}")
set(EXEC_PREFIX "\${prefix}")
set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
set(INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(VERSION "${zstd_VERSION}")
Expand All @@ -149,24 +149,13 @@ if (UNIX OR MINGW)
string(SUBSTRING "${INCLUDEDIR}" ${PREFIX_LENGTH} -1 INCLUDEDIR_SUFFIX)

if ("${INCLUDEDIR_PREFIX}" STREQUAL "${PREFIX}")
set(INCLUDEDIR_PREFIX "\\$$\{prefix}")
set(INCLUDEDIR "\${prefix}${INCLUDEDIR_SUFFIX}")
endif()
if ("${LIBDIR_PREFIX}" STREQUAL "${PREFIX}")
set(LIBDIR_PREFIX "\\$$\{exec_prefix}")
set(LIBDIR "\${exec_prefix}${LIBDIR_SUFFIX}")
endif()

add_custom_target(libzstd.pc ALL
${CMAKE_COMMAND}
-DIN=${LIBRARY_DIR}/libzstd.pc.in
-DOUT="libzstd.pc"
-DPREFIX="${PREFIX}"
-DEXEC_PREFIX="${EXEC_PREFIX}"
-DINCLUDEDIR="${INCLUDEDIR_PREFIX}${INCLUDEDIR_SUFFIX}"
-DLIBDIR="${LIBDIR_PREFIX}${LIBDIR_SUFFIX}"
-DVERSION="${VERSION}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake
COMMENT "Creating pkg-config file")

configure_file("${LIBRARY_DIR}/libzstd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif ()

Expand Down
1 change: 0 additions & 1 deletion build/cmake/lib/pkgconfig.cmake

This file was deleted.

0 comments on commit e4558ff

Please sign in to comment.