]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
2 months agoFail on errors when building fuzzers 3979/head
Yonatan Komornik [Mon, 18 Mar 2024 22:25:22 +0000 (15:25 -0700)] 
Fail on errors when building fuzzers

Fails on errors when building fuzzers with `fuzz.py` (adds `Werror`).
Currently allows `declaration-after-statement`, `c++-compat` and
`deprecated` as they are abundant in code (some fixes to
`declaration-after-statement` are presented in this commit).

2 months agoFix bugs in simple decompression fuzzer (#3978)
Yonatan Komornik [Mon, 18 Mar 2024 22:36:40 +0000 (15:36 -0700)] 
Fix bugs in simple decompression fuzzer (#3978)

Fixes 2 issue in `simple_decompress.c`:
1. Wrong type used for storing the results of `ZSTD_findDecompressedSize` resulting in never matching to `ZSTD_CONTENTSIZE_ERROR` or `ZSTD_CONTENTSIZE_UNKNOWN`.

2. Experimental API is used (`ZSTD_findDecompressedSize`) without defining `ZSTD_STATIC_LINKING_ONLY`.

2 months agopzstd: use c++14 without conditions
Alexander Kanavin [Mon, 19 Jun 2023 15:10:09 +0000 (17:10 +0200)] 
pzstd: use c++14 without conditions

Doing this check with a direct c++ snippet is prone to portability problems:

- \043 is not portable between shells: dash expands it to #,
bash does not;

- using # directly works with make 4.3 but does not with make 4.2.

Let's just use the c++ version that covers both the code and the gtest.

2 months agoImplement one-shot fallback for magicless format (#3971)
Elliot Gorokhovsky [Mon, 18 Mar 2024 14:55:53 +0000 (10:55 -0400)] 
Implement one-shot fallback for magicless format (#3971)

2 months ago[cmake] Fix up PR #3716
Nick Terrell [Thu, 14 Mar 2024 19:12:55 +0000 (12:12 -0700)] 
[cmake] Fix up PR #3716

* Make a variable `PublicHeaders` for Zstd's public headers
* Add `PublicHeaders` to `Headers`, which was missing
* Only export `${LIBRARY_DIR}` publicly, not `common/`
* Switch the `target_include_directories()` to `INTERFACE` because zstd uses relative includes internally, so doesn't need any include directories to build
* Switch installation to use the `PublicHeaders` variable, and test that the right headers are installed

2 months agoMakes it possible to use the lib through FetchContent or ExternalProject_Add
dsvi [Fri, 4 Aug 2023 22:47:46 +0000 (01:47 +0300)] 
Makes it possible to use the lib through FetchContent or ExternalProject_Add

2 months agoMerge pull request #3973 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Mon, 18 Mar 2024 07:44:55 +0000 (00:44 -0700)] 
Merge pull request #3973 from facebook/dependabot/github_actions/github/codeql-action-3.24.7

Bump github/codeql-action from 3.24.6 to 3.24.7

2 months agoMerge pull request #3972 from facebook/dependabot/github_actions/actions/cache-4
Yann Collet [Mon, 18 Mar 2024 07:44:12 +0000 (00:44 -0700)] 
Merge pull request #3972 from facebook/dependabot/github_actions/actions/cache-4

Bump actions/cache from 3 to 4

2 months agoBump github/codeql-action from 3.24.6 to 3.24.7 3973/head
dependabot[bot] [Mon, 18 Mar 2024 05:37:56 +0000 (05:37 +0000)] 
Bump github/codeql-action from 3.24.6 to 3.24.7

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.6 to 3.24.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8a470fddafa5cbb6266ee11b37ef4d8aae19c571...3ab4101902695724f9365a384f86c1074d94e18c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoBump actions/cache from 3 to 4 3972/head
dependabot[bot] [Mon, 18 Mar 2024 05:37:52 +0000 (05:37 +0000)] 
Bump actions/cache from 3 to 4

Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoMerge pull request #3969 from facebook/v156_prep
Yann Collet [Fri, 15 Mar 2024 17:26:49 +0000 (10:26 -0700)] 
Merge pull request #3969 from facebook/v156_prep

bump version number

2 months agoMerge pull request #3966 from facebook/debug_lineNumber
Yann Collet [Fri, 15 Mar 2024 17:26:06 +0000 (10:26 -0700)] 
Merge pull request #3966 from facebook/debug_lineNumber

add line number to debug traces

2 months agoupdate CHANGELOG for v1.5.6 3969/head
Yann Collet [Fri, 15 Mar 2024 00:01:34 +0000 (17:01 -0700)] 
update CHANGELOG for v1.5.6

2 months agoupdated version to v1.5.6
Yann Collet [Thu, 14 Mar 2024 22:38:14 +0000 (15:38 -0700)] 
updated version to v1.5.6

2 months agoRemove duplicate and incorrect docs in zstd_decompress.c (#3967)
Elliot Gorokhovsky [Thu, 14 Mar 2024 19:55:01 +0000 (15:55 -0400)] 
Remove duplicate and incorrect docs in zstd_decompress.c (#3967)

2 months agoadd line number to debug traces 3966/head
Yann Collet [Thu, 14 Mar 2024 19:11:11 +0000 (12:11 -0700)] 
add line number to debug traces

2 months ago[cmake] Always create libzstd target
Nick Terrell [Thu, 14 Mar 2024 15:47:04 +0000 (08:47 -0700)] 
[cmake] Always create libzstd target

If both `ZSTD_BUILD_SHARED` and `ZSTD_BUILD_STATIC` are set, then cmake exports the libraries `libzstd_shared` and `libzstd_static` only.
It does not export `libzstd`, which is only exported when exactly one of `ZSTD_BUILD_SHARED` and `ZSTD_BUILD_STATIC` is set.
This PR exports `libzstd` in that case, based on the value of the standard CMake variable [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html).
This ensures that `libzstd` can always be used to refer to the exported zstd library, since the build errors if neither `ZSTD_BUILD_SHARED` nor `ZSTD_BUILD_STATIC` are set.

I tested all the possible combinations of `ZSTD_BUILD_SHARED`, `ZSTD_BUILD_STATIC`, and `BUILD_SHARED_LIBS` and they always worked as expected:
* If only exactly one of `ZSTD_BUILD_SHARED` and `ZSTD_BUILD_STATIC` is set, that is used as `libzstd`.
* Otherwise, libzstd is set based on `BUILD_SHARED_LIBS`.

Fixes #3859.

2 months agoMerge pull request #3964 from felixhandte/promote-tgt-c-blk-size-to-stable
Felix Handte [Thu, 14 Mar 2024 17:06:46 +0000 (13:06 -0400)] 
Merge pull request #3964 from felixhandte/promote-tgt-c-blk-size-to-stable

Promote `ZSTD_c_targetCBlockSize` Parameter to Stable API

2 months agoMerge pull request #3963 from felixhandte/also-handle-hidden-files-output-dir-mirror
Felix Handte [Thu, 14 Mar 2024 14:21:00 +0000 (10:21 -0400)] 
Merge pull request #3963 from felixhandte/also-handle-hidden-files-output-dir-mirror

Remove Erroneous Exclusion of Hidden Files and Folders in `--output-dir-mirror`

2 months agoMerge pull request #3962 from facebook/cover_lessIncludes
Yann Collet [Wed, 13 Mar 2024 23:52:54 +0000 (16:52 -0700)] 
Merge pull request #3962 from facebook/cover_lessIncludes

reduce the amount of #include in cover.h

2 months agoMerge pull request #3960 from felixhandte/use-utimensat-on-posix-2001
Felix Handte [Wed, 13 Mar 2024 21:10:35 +0000 (17:10 -0400)] 
Merge pull request #3960 from felixhandte/use-utimensat-on-posix-2001

Use `utimensat()` on FreeBSD

2 months agoPromote `ZSTD_c_targetCBlockSize` Parameter to Stable API 3964/head
W. Felix Handte [Wed, 13 Mar 2024 20:56:54 +0000 (16:56 -0400)] 
Promote `ZSTD_c_targetCBlockSize` Parameter to Stable API

This feature has demonstrated itself to be useful in web compression and we
want to encourage other folks to use it. But we currently make it difficult
to do so since it's locked away in the experimental API.

The API itself is really straightforward and I think it's fine to commit to
maintaining support / compatibility for this API even if in the future the
underlying implementation may continue to evolve.

Note that this commit changes its enum name and also its numeric value. Users
who respected the instructions of using the experimental API should be fine
with both of these changes since they should only have referred to it by the.

Conceivably someone could have done bad feature detection of this capability
by doing `#ifdef ZSTD_c_targetCBlockSize` which will now return false since
it's no longer a macro... but I think that's an acceptable hypothetical
breakage.

2 months agoRemove Erroneous Exclusion of Hidden Files and Folders in `--output-dir-mirror` 3963/head
W. Felix Handte [Wed, 13 Mar 2024 20:33:30 +0000 (16:33 -0400)] 
Remove Erroneous Exclusion of Hidden Files and Folders in `--output-dir-mirror`

2 months agoAdd a Few Tests
W. Felix Handte [Wed, 13 Mar 2024 20:32:04 +0000 (16:32 -0400)] 
Add a Few Tests

2 months agoUse `utimensat()` on FreeBSD 3960/head
W. Felix Handte [Tue, 12 Mar 2024 21:01:17 +0000 (14:01 -0700)] 
Use `utimensat()` on FreeBSD

FreeBSD only claims to support POSIX 2001 [0]. But they do in fact support
`utimensat()`. This adds a specific check to opt them in to using it. This
value was selected by consulting [1].

See discussion on #3952.

Further addresses #3748.

[0] https://github.com/freebsd/freebsd-src/blob/937a0055858a098027f464abf0b2b1ec5d36748f/sys/sys/unistd.h#L96

[1] https://docs.freebsd.org/en/books/porters-handbook/versions/

2 months ago[asm][aarch64] Mark that BTI and PAC are supported
Nick Terrell [Wed, 13 Mar 2024 16:58:34 +0000 (09:58 -0700)] 
[asm][aarch64] Mark that BTI and PAC are supported

Mark that `huf_decompress_amd64.S` supports BTI and PAC, which it trivially does because it is empty for aarch64.

The issue only requested BTI markings, but it also makes sense to mark PAC, which is the only other feature.

Also run add a test for this mode to the ARM64 QEMU test. Before this PR it warns on `huf_decompress_amd64.S`, after it doesn't.

Fixes Issue #3841.

2 months agoreduce the amount of includes in "cover.h" 3962/head
Yann Collet [Wed, 13 Mar 2024 18:29:28 +0000 (11:29 -0700)] 
reduce the amount of includes in "cover.h"

2 months agoMerge pull request #3958 from facebook/doc3698
Yann Collet [Wed, 13 Mar 2024 14:15:45 +0000 (07:15 -0700)] 
Merge pull request #3958 from facebook/doc3698

updated documentation

2 months agoMerge pull request #3956 from facebook/fix3702
Yann Collet [Wed, 13 Mar 2024 14:15:06 +0000 (07:15 -0700)] 
Merge pull request #3956 from facebook/fix3702

Do not truncate file name in verbose mode

2 months ago[CI] Run tests with CMake on Windows
Nick Terrell [Tue, 12 Mar 2024 19:38:21 +0000 (12:38 -0700)] 
[CI] Run tests with CMake on Windows

Build and run tests on Windows with CMake

2 months ago[cpu] Backport fix for rbx clobbering on Windows with Clang
Nick Terrell [Tue, 12 Mar 2024 19:16:55 +0000 (12:16 -0700)] 
[cpu] Backport fix for rbx clobbering on Windows with Clang

Backport folly fix for rbx clobbering: https://github.com/facebook/folly/commit/f22f88b8b9d70160388f0f149bc9abaeb82c250b

This supercedes PR #3646.

2 months agoMerge pull request #3954 from facebook/zeroSeq_sample
Yann Collet [Tue, 12 Mar 2024 22:31:01 +0000 (15:31 -0700)] 
Merge pull request #3954 from facebook/zeroSeq_sample

Add the zeroSeq sample

2 months agoUpdates `ZSTD_RowFindBestMatch` comment (#3947)
Yonatan Komornik [Tue, 12 Mar 2024 22:10:07 +0000 (15:10 -0700)] 
Updates `ZSTD_RowFindBestMatch` comment (#3947)

Updates the comment on the head of `ZSTD_RowFindBestMatch` to make sure it's aligned with recent changes to the hash table.

2 months agoExercise ZSTD_findDecompressedSize() in the simple decompression fuzzer (#3959)
Elliot Gorokhovsky [Tue, 12 Mar 2024 21:07:06 +0000 (17:07 -0400)] 
Exercise ZSTD_findDecompressedSize() in the simple decompression fuzzer (#3959)

* Improve decompression fuzzer

* Fix legacy frame header fuzzer crash, add unit test

2 months agofix duplicated paragraph 3958/head
Yann Collet [Tue, 12 Mar 2024 20:09:10 +0000 (13:09 -0700)] 
fix duplicated paragraph

reported by @zougloub

2 months agoupdated documentation
Yann Collet [Tue, 12 Mar 2024 19:27:33 +0000 (12:27 -0700)] 
updated documentation

following recommendations by @zougloub at #3698

2 months agoExport ZSTD_LEGACY_SUPPORT in tests/Makefile (#3955)
Elliot Gorokhovsky [Tue, 12 Mar 2024 18:36:54 +0000 (14:36 -0400)] 
Export ZSTD_LEGACY_SUPPORT in tests/Makefile (#3955)

This doesn't affect most of the targets, but will help me sleep better at night knowing that future refactors won't break the legacy support.

Should have been included in https://github.com/facebook/zstd/pull/3943 but I noticed after that merged, so putting up a separate PR.

2 months agono longer truncate file name in verbose mode 3956/head
Yann Collet [Tue, 12 Mar 2024 18:27:42 +0000 (11:27 -0700)] 
no longer truncate file name in verbose mode

fix #3702

2 months agoAdd common file extensions to --exclude-compressed (#3951)
daniellerozenblit [Tue, 12 Mar 2024 17:49:06 +0000 (13:49 -0400)] 
Add common file extensions to --exclude-compressed (#3951)

2 months agoremoved golden-decompression/.gitignore 3954/head
Yann Collet [Tue, 12 Mar 2024 17:47:27 +0000 (10:47 -0700)] 
removed golden-decompression/.gitignore

replaced by an exclusion rule in tests/.gitignore

2 months agoMerge pull request #3901 from robandpdx-org/convert-facebook-zstd-to-actions
Yann Collet [Tue, 12 Mar 2024 16:54:40 +0000 (09:54 -0700)] 
Merge pull request #3901 from robandpdx-org/convert-facebook-zstd-to-actions

Convert the CircleCI workflow to a GitHub Actions workflow

2 months agoMerge pull request #3952 from felixhandte/stop-hardcoding-posix-version-on-bsd
Felix Handte [Tue, 12 Mar 2024 16:49:19 +0000 (12:49 -0400)] 
Merge pull request #3952 from felixhandte/stop-hardcoding-posix-version-on-bsd

Stop Hardcoding the POSIX Version on BSDs

2 months agoadd same .gitignore rule in golden-decompression/
Yann Collet [Tue, 12 Mar 2024 16:47:54 +0000 (09:47 -0700)] 
add same .gitignore rule in golden-decompression/

as requested by @embg

2 months agoMerge pull request #3933 from facebook/fix3819
Yann Collet [Tue, 12 Mar 2024 16:46:48 +0000 (09:46 -0700)] 
Merge pull request #3933 from facebook/fix3819

prevent XXH64 from being autovectorized by XXH512 by default

2 months agoMerge pull request #3934 from facebook/risc5ci
Yann Collet [Tue, 12 Mar 2024 16:46:20 +0000 (09:46 -0700)] 
Merge pull request #3934 from facebook/risc5ci

add RISC-V emulation tests to Github CI

2 months agoMerge pull request #3936 from facebook/debug5
Yann Collet [Tue, 12 Mar 2024 16:45:20 +0000 (09:45 -0700)] 
Merge pull request #3936 from facebook/debug5

minor: fix incorrect debug level

2 months agoMerge pull request #3942 from facebook/fix3719
Yann Collet [Tue, 12 Mar 2024 16:44:52 +0000 (09:44 -0700)] 
Merge pull request #3942 from facebook/fix3719

Fix #3719 : mixing -c, -o and --rm

2 months agoMerge pull request #3946 from facebook/cmake_hpux
Yann Collet [Tue, 12 Mar 2024 16:44:20 +0000 (09:44 -0700)] 
Merge pull request #3946 from facebook/cmake_hpux

cmake refactor: move HP-UX specific logic into its own function

2 months agoMerge pull request #3948 from facebook/tests_2927
Yann Collet [Tue, 12 Mar 2024 16:43:59 +0000 (09:43 -0700)] 
Merge pull request #3948 from facebook/tests_2927

add tests inspired from #2927

2 months agoAdd the zeroSeq sample
Yann Collet [Tue, 12 Mar 2024 16:28:25 +0000 (09:28 -0700)] 
Add the zeroSeq sample

that should have been part of #3674

2 months agoMerge pull request #3937 from facebook/offset0
Yann Collet [Tue, 12 Mar 2024 16:25:06 +0000 (09:25 -0700)] 
Merge pull request #3937 from facebook/offset0

new method to deal with offset==0 erroneous edge case

2 months agochore: fix some typos (#3949)
acceptacross [Tue, 12 Mar 2024 15:44:42 +0000 (23:44 +0800)] 
chore: fix some typos (#3949)

Signed-off-by: acceptacross <csqcqs@gmail.com>
2 months agoPin tsan and msan CI jobs to ubuntu-20.04 (#3945)
Elliot Gorokhovsky [Tue, 12 Mar 2024 15:25:00 +0000 (11:25 -0400)] 
Pin tsan and msan CI jobs to ubuntu-20.04 (#3945)

2 months agoUse ZSTD_LEGACY_SUPPORT=5 in make test (#3943)
Elliot Gorokhovsky [Tue, 12 Mar 2024 14:08:26 +0000 (10:08 -0400)] 
Use ZSTD_LEGACY_SUPPORT=5 in make test (#3943)

2 months agoadd tests inspired from #2927 3948/head
Yann Collet [Tue, 12 Mar 2024 00:57:57 +0000 (17:57 -0700)] 
add tests inspired from #2927

centered around -T# and --fast=# arguments

2 months agoFix AsyncIO reading seed queueing (#3940)
Yonatan Komornik [Mon, 11 Mar 2024 23:28:32 +0000 (16:28 -0700)] 
Fix AsyncIO reading seed queueing (#3940)

Fixes a bug in AsyncIO where we queue reads after opening a file so our queue will always be saturated (or as saturated as possible).
Previous code was looping up to `availableJobsCount` not realizing `availableJobsCount` was also decreasing in each iteration, so instead of queueing 10 jobs we'd queue 5 (and instead of 2 we'd queue 1).
This PR fixes the loop to queue as long as `availableJobsCount` is not 0.

2 months agocmake refactor: move HP-UX specific logic into its own function 3946/head
Yann Collet [Mon, 11 Mar 2024 23:11:15 +0000 (16:11 -0700)] 
cmake refactor: move HP-UX specific logic into its own function

reduce visual clutter of corner case configuration.

2 months agoMerge pull request #3862 from likema/fix-hpux-parisc
Yann Collet [Mon, 11 Mar 2024 22:55:58 +0000 (15:55 -0700)] 
Merge pull request #3862 from likema/fix-hpux-parisc

Fix building on HP-UX 11.11 PA-RISC

2 months agoStop Hardcoding the POSIX Version on BSDs 3952/head
W. Felix Handte [Mon, 11 Mar 2024 19:20:06 +0000 (15:20 -0400)] 
Stop Hardcoding the POSIX Version on BSDs

BSDs should all have a `unistd.h` header.

2 months agominor man page clarification 3942/head
Yann Collet [Mon, 11 Mar 2024 19:23:37 +0000 (12:23 -0700)] 
minor man page clarification

2 months agoadded tests
Yann Collet [Mon, 11 Mar 2024 19:17:34 +0000 (12:17 -0700)] 
added tests

2 months agofix #3719
Yann Collet [Mon, 11 Mar 2024 18:38:55 +0000 (11:38 -0700)] 
fix #3719

only disable `--rm` at end of command line parsing,
so that `-c` only disables `--rm` if it's effectively selected,
and not if it's overriden by a later `-o FILE` command.

2 months agoMerge pull request #3860 from likema/fix-xxhash-aix-51
Yann Collet [Sat, 9 Mar 2024 23:34:02 +0000 (15:34 -0800)] 
Merge pull request #3860 from likema/fix-xxhash-aix-51

Fix building xxhash on AIX 5.1

2 months agoMerge pull request #3929 from facebook/llu_vscode
Yann Collet [Sat, 9 Mar 2024 22:24:57 +0000 (14:24 -0800)] 
Merge pull request #3929 from facebook/llu_vscode

fix LLU->ULL

2 months agoMerge pull request #3928 from facebook/doc3727
Yann Collet [Sat, 9 Mar 2024 22:24:38 +0000 (14:24 -0800)] 
Merge pull request #3928 from facebook/doc3727

update -V documentation

2 months agoproduced golden sample for the offset==0 decoder test 3937/head
Yann Collet [Sat, 9 Mar 2024 08:33:44 +0000 (00:33 -0800)] 
produced golden sample for the offset==0 decoder test

is correctly detected as corrupted by new version,
and is accepted (changed into offset==1) by older version.

updated documentation accordingly, with an hexadecimal representation.

2 months agoupdate documentation
Yann Collet [Fri, 8 Mar 2024 23:55:30 +0000 (15:55 -0800)] 
update documentation

2 months agonew method to deal with offset==0
Yann Collet [Fri, 8 Mar 2024 22:55:38 +0000 (14:55 -0800)] 
new method to deal with offset==0

in this new method, when an `offset==0` is detected,
it's converted into (size_t)(-1), instead of 1.

The logic is that (size_t)(-1) is effectively an extremely large positive number,
which will not pass the offset distance test at next stage (`execSequence()`).
Checked the source code, and offset is always checked (as it should),
using a formula which is not vulnerable to arithmetic overflow:
```
RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart),
```

The benefit is that such a case (offset==0) is always detected as corrupted data
as opposed to relying on the checksum to detect the error.

2 months agoMerge pull request #3824 from elasota/specify-zero-offset
Yann Collet [Fri, 8 Mar 2024 23:25:48 +0000 (15:25 -0800)] 
Merge pull request #3824 from elasota/specify-zero-offset

Specify offset 0 as invalid and specify required fixup behavior

2 months agoMerge pull request #3816 from elasota/fix-state-table
Yann Collet [Fri, 8 Mar 2024 23:02:00 +0000 (15:02 -0800)] 
Merge pull request #3816 from elasota/fix-state-table

Fix state table formatting

2 months agominor: fix incorrect debug level 3936/head
Yann Collet [Fri, 8 Mar 2024 22:29:44 +0000 (14:29 -0800)] 
minor: fix incorrect debug level

2 months agoadded RISC-V emulation tests on Github CI 3934/head
Yann Collet [Fri, 8 Mar 2024 00:54:44 +0000 (16:54 -0800)] 
added RISC-V emulation tests on Github CI

2 months agoprevent XXH64 from being autovectorized by XXH512 by default 3933/head
Yann Collet [Fri, 8 Mar 2024 00:43:13 +0000 (16:43 -0800)] 
prevent XXH64 from being autovectorized by XXH512 by default

backport fix https://github.com/Cyan4973/xxHash/pull/924 from libxxhash

2 months agoMerge pull request #3840 from aimuz/fix-reserved
Yann Collet [Tue, 5 Mar 2024 21:40:12 +0000 (13:40 -0800)] 
Merge pull request #3840 from aimuz/fix-reserved

lib/decompress: check for reserved bit corruption in zstd

2 months agofix LLU->ULL 3929/head
Yann Collet [Mon, 4 Mar 2024 08:16:01 +0000 (00:16 -0800)] 
fix LLU->ULL

LLU is a correct prefix according to C99 & C11 standards (but not C90).
However, older versions of Visual Studio do not work with it.
Replace by ULL, which doesn't have this issue.

Fixes https://github.com/facebook/zstd/issues/3647

2 months agoupdate -V documentation 3928/head
Yann Collet [Mon, 4 Mar 2024 07:24:40 +0000 (23:24 -0800)] 
update -V documentation

to answer #3727 comment

2 months agoMerge pull request #3927 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Mon, 4 Mar 2024 07:18:03 +0000 (23:18 -0800)] 
Merge pull request #3927 from facebook/dependabot/github_actions/github/codeql-action-3.24.6

Bump github/codeql-action from 3.24.5 to 3.24.6

2 months agoBump github/codeql-action from 3.24.5 to 3.24.6 3927/head
dependabot[bot] [Mon, 4 Mar 2024 05:34:30 +0000 (05:34 +0000)] 
Bump github/codeql-action from 3.24.5 to 3.24.6

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.5 to 3.24.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/47b3d888fe66b639e431abf22ebca059152f1eea...8a470fddafa5cbb6266ee11b37ef4d8aae19c571)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoMerge pull request #3753 from facebook/make2
Yann Collet [Mon, 4 Mar 2024 03:13:00 +0000 (19:13 -0800)] 
Merge pull request #3753 from facebook/make2

minor Makefile refactoring

2 months agoMerge pull request #3804 from facebook/dependabot/github_actions/ossf/scorecard-actio...
Yann Collet [Mon, 4 Mar 2024 02:57:19 +0000 (18:57 -0800)] 
Merge pull request #3804 from facebook/dependabot/github_actions/ossf/scorecard-action-2.3.1

Bump ossf/scorecard-action from 2.2.0 to 2.3.1

2 months agoMerge pull request #3918 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Mon, 4 Mar 2024 02:56:06 +0000 (18:56 -0800)] 
Merge pull request #3918 from facebook/dependabot/github_actions/github/codeql-action-3.24.5

Bump github/codeql-action from 3.23.0 to 3.24.5

2 months agoMerge pull request #3926 from facebook/checkoutVersion
Yann Collet [Mon, 4 Mar 2024 02:54:05 +0000 (18:54 -0800)] 
Merge pull request #3926 from facebook/checkoutVersion

fix version of actions/checkout

2 months agofix version of actions/checkout 3926/head
Yann Collet [Mon, 4 Mar 2024 02:47:08 +0000 (18:47 -0800)] 
fix version of actions/checkout

2 months agoMerge pull request #3811 from teo-tsirpanis/unified-target
Yann Collet [Sun, 3 Mar 2024 23:04:22 +0000 (15:04 -0800)] 
Merge pull request #3811 from teo-tsirpanis/unified-target

Export a `zstd::libzstd` CMake target if only static or dynamic linkage is specified.

3 months agoMerge branch 'dev' into unified-target 3811/head
Theodore Tsirpanis [Tue, 27 Feb 2024 23:25:15 +0000 (01:25 +0200)] 
Merge branch 'dev' into unified-target

3 months agoDefine the unified target inside the CMake project, and export it.
Theodore Tsirpanis [Tue, 27 Feb 2024 21:39:59 +0000 (23:39 +0200)] 
Define the unified target inside the CMake project, and export it.

This is less error-prone.

3 months agoMerge pull request #3916 from facebook/no_sprintf
Yann Collet [Tue, 27 Feb 2024 21:28:32 +0000 (13:28 -0800)] 
Merge pull request #3916 from facebook/no_sprintf

removed sprintf usage from zstdcli.c

3 months agoMerge pull request #3917 from facebook/targetCBlock_moreRegular
Yann Collet [Mon, 26 Feb 2024 23:38:00 +0000 (15:38 -0800)] 
Merge pull request #3917 from facebook/targetCBlock_moreRegular

More regular block sizes with `targetCBlockSize`

3 months agosizeBlockSequences() also tracks uncompressed size 3917/head
Yann Collet [Mon, 26 Feb 2024 22:31:12 +0000 (14:31 -0800)] 
sizeBlockSequences() also tracks uncompressed size

and only defines a sub-block boundary when
it believes that it is compressible.

It's effectively an optimization,
avoiding a compression cycle to reach the same conclusion.

3 months agominor refactor for clarity
Yann Collet [Mon, 26 Feb 2024 22:06:34 +0000 (14:06 -0800)] 
minor refactor for clarity

since we can ensure that nbSubBlocks>0

3 months agooptimization: bail out faster in presence of incompressible data
Yann Collet [Mon, 26 Feb 2024 21:27:59 +0000 (13:27 -0800)] 
optimization: bail out faster in presence of incompressible data

3 months agonit: comment indentation
Yann Collet [Mon, 26 Feb 2024 21:23:59 +0000 (13:23 -0800)] 
nit: comment indentation

as reported by @terrelln

3 months agominor: reformulate nbSubBlocks assignment
Yann Collet [Mon, 26 Feb 2024 21:21:14 +0000 (13:21 -0800)] 
minor: reformulate nbSubBlocks assignment

3 months agofix extraneous semicolon ';'
Yann Collet [Mon, 26 Feb 2024 20:26:54 +0000 (12:26 -0800)] 
fix extraneous semicolon ';'

as reported by @terrelln

3 months agoBump github/codeql-action from 3.23.0 to 3.24.5 3918/head
dependabot[bot] [Mon, 26 Feb 2024 05:59:24 +0000 (05:59 +0000)] 
Bump github/codeql-action from 3.23.0 to 3.24.5

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.23.0 to 3.24.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e5f05b81d5b6ff8cfa111c80c22c5fd02a384118...47b3d888fe66b639e431abf22ebca059152f1eea)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 months agofix minor visual static analyzer warning
Yann Collet [Mon, 26 Feb 2024 03:45:32 +0000 (19:45 -0800)] 
fix minor visual static analyzer warning

it's a false positive,
but change the code nonetheless to make it more obvious to the static analyzer.

3 months agotargetCBlockSize: modified splitting strategy to generate blocks of more regular...
Yann Collet [Mon, 26 Feb 2024 01:33:41 +0000 (17:33 -0800)] 
targetCBlockSize: modified splitting strategy to generate blocks of more regular size

notably avoiding to feature a larger first block

3 months agoremoved sprintf usage from zstdcli.c 3916/head
Yann Collet [Sun, 25 Feb 2024 07:03:40 +0000 (23:03 -0800)] 
removed sprintf usage from zstdcli.c

some static analyzers flag this standard C90 function as unsafe.

3 months agoMerge pull request #3915 from facebook/targetCBlockSize
Yann Collet [Sun, 25 Feb 2024 02:07:35 +0000 (18:07 -0800)] 
Merge pull request #3915 from facebook/targetCBlockSize

Improve speed of ZSTD_c_targetCBlockSize

3 months agoreduced minimum compressed block size 3915/head
Yann Collet [Sat, 24 Feb 2024 09:59:16 +0000 (01:59 -0800)] 
reduced minimum compressed block size

with the intention to match the transport layer size,
such as Ethernet and 4G mobile networks.