Skip to content

Commit e47e674

Browse files
authored
Merge pull request #2995 from facebook/v1.5.2-rc
Zstandard v1.5.2
2 parents 791626d + 40bc9ee commit e47e674

Some content is hidden

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

48 files changed

+942
-565
lines changed

CHANGELOG

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v1.5.2 (Jan, 2022)
2+
perf: Regain Minimal memset()-ing During Reuse of Compression Contexts (@Cyan4973, #2969)
3+
build: Build Zstd with `noexecstack` on All Architectures (@felixhandte, #2964)
4+
doc: Clarify Licensing (@terrelln, #2981)
5+
16
v1.5.1 (Dec, 2021)
27
perf: rebalanced compression levels, to better match the intended speed/level curve, by @senhuang42
38
perf: faster huffman decoder, using x64 assembly, by @terrelln

CONTRIBUTING.md

+38-53
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Our contribution process works in three main stages:
6868
```
6969
2. Code Review and CI tests
7070
* Ensure CI tests pass:
71-
* Before sharing anything to the community, make sure that all CI tests pass on your local fork.
72-
See our section on setting up your CI environment for more information on how to do this.
71+
* Before sharing anything to the community, create a pull request in your own fork against the dev branch
72+
and make sure that all GitHub Actions CI tests pass. See the Continuous Integration section below for more information.
7373
* Ensure that static analysis passes on your development machine. See the Static Analysis section
7474
below to see how to do this.
7575
* Create a pull request:
@@ -140,6 +140,42 @@ It can be useful to look at additional static analyzers once in a while (and we
140140
141141
This is different from running a static analyzer once in a while, looking at the output, and __cherry picking__ a few warnings that seem helpful, either because they detected a genuine risk of bug, or because it helps expressing the code in a way which is more readable or more difficult to misuse. These kind of reports can be useful, and are accepted.
142142
143+
## Continuous Integration
144+
CI tests run every time a pull request (PR) is created or updated. The exact tests
145+
that get run will depend on the destination branch you specify. Some tests take
146+
longer to run than others. Currently, our CI is set up to run a short
147+
series of tests when creating a PR to the dev branch and a longer series of tests
148+
when creating a PR to the release branch. You can look in the configuration files
149+
of the respective CI platform for more information on what gets run when.
150+
151+
Most people will just want to create a PR with the destination set to their local dev
152+
branch of zstd. You can then find the status of the tests on the PR's page. You can also
153+
re-run tests and cancel running tests from the PR page or from the respective CI's dashboard.
154+
155+
Almost all of zstd's CI runs on GitHub Actions (configured at `.github/workflows`), which will automatically run on PRs to your
156+
own fork. A small number of tests run on other services (e.g. Travis CI, Circle CI, Appveyor).
157+
These require work to set up on your local fork, and (at least for Travis CI) cost money.
158+
Therefore, if the PR on your local fork passes GitHub Actions, feel free to submit a PR
159+
against the main repo.
160+
161+
### Third-party CI
162+
A small number of tests cannot run on GitHub Actions, or have yet to be migrated.
163+
For these, we use a variety of third-party services (listed below). It is not necessary to set
164+
these up on your fork in order to contribute to zstd; however, we do link to instructions for those
165+
who want earlier signal.
166+
167+
| Service | Purpose | Setup Links | Config Path |
168+
|-----------|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
169+
| Travis CI | Used for testing on non-x86 architectures such as PowerPC | https://docs.travis-ci.com/user/tutorial/#to-get-started-with-travis-ci-using-github <br> https://github.com/marketplace/travis-ci | `.travis.yml` |
170+
| AppVeyor | Used for some Windows testing (e.g. cygwin, mingw) | https://www.appveyor.com/blog/2018/10/02/github-apps-integration/ <br> https://github.com/marketplace/appveyor | `appveyor.yml` |
171+
| Cirrus CI | Used for testing on FreeBSD | https://github.com/marketplace/cirrus-ci/ | `.cirrus.yml` |
172+
| Circle CI | Historically was used to provide faster signal,<br/> but we may be able to migrate these to Github Actions | https://circleci.com/docs/2.0/getting-started/#setting-up-circleci <br> https://youtu.be/Js3hMUsSZ2c <br> https://circleci.com/docs/2.0/enable-checks/ | `.circleci/config.yml` |
173+
174+
Note: the instructions linked above mostly cover how to set up a repository with CI from scratch.
175+
The general idea should be the same for setting up CI on your fork of zstd, but you may have to
176+
follow slightly different steps. In particular, please ignore any instructions related to setting up
177+
config files (since zstd already has configs for each of these services).
178+
143179
## Performance
144180
Performance is extremely important for zstd and we only merge pull requests whose performance
145181
landscape and corresponding trade-offs have been adequately analyzed, reproduced, and presented.
@@ -339,57 +375,6 @@ counter `L1-dcache-load-misses`
339375
340376
TODO
341377
342-
343-
## Setting up continuous integration (CI) on your fork
344-
Zstd uses a number of different continuous integration (CI) tools to ensure that new changes
345-
are well tested before they make it to an official release. Specifically, we use the platforms
346-
travis-ci, circle-ci, and appveyor.
347-
348-
Changes cannot be merged into the main dev branch unless they pass all of our CI tests.
349-
The easiest way to run these CI tests on your own before submitting a PR to our dev branch
350-
is to configure your personal fork of zstd with each of the CI platforms. Below, you'll find
351-
instructions for doing this.
352-
353-
### travis-ci
354-
Follow these steps to link travis-ci with your github fork of zstd
355-
356-
1. Make sure you are logged into your github account
357-
2. Go to https://travis-ci.org/
358-
3. Click 'Sign in with Github' on the top right
359-
4. Click 'Authorize travis-ci'
360-
5. Click 'Activate all repositories using Github Apps'
361-
6. Select 'Only select repositories' and select your fork of zstd from the drop down
362-
7. Click 'Approve and Install'
363-
8. Click 'Sign in with Github' again. This time, it will be for travis-pro (which will let you view your tests on the web dashboard)
364-
9. Click 'Authorize travis-pro'
365-
10. You should have travis set up on your fork now.
366-
367-
### circle-ci
368-
TODO
369-
370-
### appveyor
371-
Follow these steps to link circle-ci with your github fork of zstd
372-
373-
1. Make sure you are logged into your github account
374-
2. Go to https://www.appveyor.com/
375-
3. Click 'Sign in' on the top right
376-
4. Select 'Github' on the left panel
377-
5. Click 'Authorize appveyor'
378-
6. You might be asked to select which repositories you want to give appveyor permission to. Select your fork of zstd if you're prompted
379-
7. You should have appveyor set up on your fork now.
380-
381-
### General notes on CI
382-
CI tests run every time a pull request (PR) is created or updated. The exact tests
383-
that get run will depend on the destination branch you specify. Some tests take
384-
longer to run than others. Currently, our CI is set up to run a short
385-
series of tests when creating a PR to the dev branch and a longer series of tests
386-
when creating a PR to the release branch. You can look in the configuration files
387-
of the respective CI platform for more information on what gets run when.
388-
389-
Most people will just want to create a PR with the destination set to their local dev
390-
branch of zstd. You can then find the status of the tests on the PR's page. You can also
391-
re-run tests and cancel running tests from the PR page or from the respective CI's dashboard.
392-
393378
## Issues
394379
We use GitHub issues to track public bugs. Please ensure your description is
395380
clear and has sufficient instructions to be able to reproduce the issue.

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let package = Package(
2525
name: "libzstd",
2626
path: "lib",
2727
sources: [ "common", "compress", "decompress", "dictBuilder" ],
28-
publicHeadersPath: "modulemap",
28+
publicHeadersPath: ".",
2929
cSettings: [
3030
.headerSearchPath(".")
3131
])

build/cmake/lib/CMakeLists.txt

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ include_directories(${LIBRARY_DIR} ${LIBRARY_DIR}/common)
2222

2323
file(GLOB CommonSources ${LIBRARY_DIR}/common/*.c)
2424
file(GLOB CompressSources ${LIBRARY_DIR}/compress/*.c)
25-
file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S)
25+
if (MSVC)
26+
file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c)
27+
add_compile_options(-DZSTD_DISABLE_ASM)
28+
else ()
29+
file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S)
30+
endif ()
2631
file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c)
2732

2833
set(Sources
@@ -106,7 +111,7 @@ if (MSVC)
106111
endif ()
107112

108113
# With MSVC static library needs to be renamed to avoid conflict with import library
109-
if (MSVC OR (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
114+
if (MSVC OR (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MINGW))
110115
set(STATIC_LIBRARY_BASE_NAME zstd_static)
111116
else ()
112117
set(STATIC_LIBRARY_BASE_NAME zstd)

build/meson/lib/meson.build

+9-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ libzstd_sources = [join_paths(zstd_rootdir, 'lib/common/entropy_common.c'),
3737
join_paths(zstd_rootdir, 'lib/compress/zstd_opt.c'),
3838
join_paths(zstd_rootdir, 'lib/compress/zstd_ldm.c'),
3939
join_paths(zstd_rootdir, 'lib/decompress/huf_decompress.c'),
40-
join_paths(zstd_rootdir, 'lib/decompress/huf_decompress_amd64.S'),
4140
join_paths(zstd_rootdir, 'lib/decompress/zstd_decompress.c'),
4241
join_paths(zstd_rootdir, 'lib/decompress/zstd_decompress_block.c'),
4342
join_paths(zstd_rootdir, 'lib/decompress/zstd_ddict.c'),
@@ -46,6 +45,15 @@ libzstd_sources = [join_paths(zstd_rootdir, 'lib/common/entropy_common.c'),
4645
join_paths(zstd_rootdir, 'lib/dictBuilder/divsufsort.c'),
4746
join_paths(zstd_rootdir, 'lib/dictBuilder/zdict.c')]
4847

48+
# really we need anything that defines __GNUC__ as that is what ZSTD_ASM_SUPPORTED is gated on
49+
# but these are the two compilers that are supported in tree and actually handle this correctly
50+
# Otherwise, explicitly disable assmebly.
51+
if [compiler_gcc, compiler_clang].contains(cc_id)
52+
libzstd_sources += join_paths(zstd_rootdir, 'lib/decompress/huf_decompress_amd64.S')
53+
else
54+
add_project_arguments('-DZSTD_DISABLE_ASM', language: 'c')
55+
endif
56+
4957
# Explicit define legacy support
5058
add_project_arguments('-DZSTD_LEGACY_SUPPORT=@0@'.format(legacy_level),
5159
language: 'c')

contrib/linux-kernel/test/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LINUX_ZSTD_OBJECTS0 := $(LINUX_ZSTD_FILES:.c=.o)
2424
LINUX_ZSTD_OBJECTS := $(LINUX_ZSTD_OBJECTS0:.S=.o)
2525

2626
%.o: %.S
27-
$(CC) -c $(CPPFLAGS) $(CFLAGS) $^ -o $@
27+
$(COMPILE.S) $(OUTPUT_OPTION) $<
2828

2929
liblinuxzstd.a: $(LINUX_ZSTD_OBJECTS)
3030
$(AR) $(ARFLAGS) $@ $^

0 commit comments

Comments
 (0)