1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00
Commit Graph

2251 Commits

Author SHA1 Message Date
4dffc35f2e Convert references to https from http 2022-12-14 06:58:35 -08:00
dc39409a03 Print checksum value for single frame files in cli with -v -l options 2022-12-12 10:53:57 -08:00
4d82a4d3f2 minor : reorder --help
more logical context grouping
2022-11-22 07:23:45 -08:00
b1182fe242 Merge pull request #3300 from yiyuaner/dev
Fix the wrong check for buffer overrun in UTIL_mergeFileNamesTable
2022-11-02 15:28:02 -04:00
5334339421 Rewrite checking condition bufStart pointer NULL 2022-11-01 02:31:09 +03:00
361d86998a Fix the wrong check for buffer overrun in UTIL_mergeFileNamesTable 2022-10-24 20:37:15 +08:00
9abecfbb7e replaced Zstandard by zstd in man page
identified by @paulmenzel in #3286
2022-10-11 23:32:18 -07:00
2bd70eff06 zstd-pgo: also clean zstd binary from objects
Just a precaution, because it works anyway.
2022-10-06 00:38:23 +07:00
2ffcb2d6a8 fixed zstd-pgo target for GCC
Since your Makefile uses obj/$(HASH_DIR) for object files, this code does not work correctly for GCC. Because profiles are saved in one directory, and are expected in another when reading.

`$(RM) zstd *.o` - this line doesn't delete object files.

Clang stores profiles in the current directory, so the problem doesn't appear when compiling with Clang.

Also this code will work if BUILD_DIR is set.
2022-10-05 17:32:16 +07:00
358787764f Fix for zstd CLI accepts bogus values for numeric parameters (#3268)
* add checks to mal-formed numeric values for memory and memlimit parameters

Signed-off-by: Ly Cao <lycao@fb.com>

* changed errorMsg to a literal string instead of static string in main

* moved bogus numeric error to NEXT_UINT32 + add macro NEXT_TSIZE

Signed-off-by: Ly Cao <lycao@fb.com>

Signed-off-by: Ly Cao <lycao@fb.com>
Co-authored-by: Ly Cao <lycao@fb.com>
2022-09-21 13:20:01 -07:00
f7251f88b9 Merge pull request #3247 from haampie/fix/grep
Fix make variable
2022-09-19 10:47:38 -07:00
5129b4ab10 simplify clean target maintenance within programs/ 2022-09-12 12:19:35 -07:00
efef80b75e Fix make variable 2022-08-19 12:06:43 +02:00
3b4e47092e Document pass-through behavior (#3242)
Adds documentation to help and man pages for legacy pass-through behavior
when force is set and destination is stdout. Documents --pass-through in
man pages
2022-08-15 10:29:54 -07:00
03cc84fddb Add explicit --pass-through flag and default to enabled for *cat (#3223)
Fixes #3211.

Adds the `--[no-]pass-through` flag which enables/disables pass-through mode.

* `zstdcat`, `zcat`, and `gzcat` default to `--pass-through`.
  Pass-through mode can be disabled by passing `--no-pass-through`.
* All other binaries default to not setting pass-through mode.
  However, we preserve the legacy behavior of enabling pass-through
  mode when writing to stdout with `-f` set, unless pass-through
  mode is explicitly disabled with `--no-pass-through`.

Adds a new test for this behavior that should codify the behavior we want.
2022-08-04 17:15:59 -07:00
d0dcc9d775 fix issue #3144 (#3226)
* fix issue #3144

* add test case for verbose-wlog

Co-authored-by: zengyijing <yijingzeng@fb.com>
2022-08-04 13:51:14 -07:00
e818fa8eb0 Merge pull request #3232 from facebook/fileiotypes_nomemh
fileio_types.h : avoid dependency on mem.h
2022-08-03 22:57:16 +02:00
3dfcafacd7 fileio_types.h : avoid dependency on mem.h
fileio_types.h cannot be parsed by itself
because it relies on basic types defined in `lib/common/mem.h`.
As for #3231, it likely wasn't detected because `mem.h` was probably included before within target files.
But this is not proper.

A "easy" solution would be to add the missing include,
but each dependency should be considered "bad" by default,
and only allowed if it brings some tangible value.

In this case, since these types are only used to declare internal structure variables
which are effectively only flags,
I believe it's really not valuable to add a dependency on `mem.h` for this purpose
while the standard `int` type can do the same job.

I was expecting some compiler warnings following this change,
but it turns out we don't use `-Wconversion` by default on `zstd` source code,
so there is none.

Nevertheless, I enabled `-Wconversion` locally and proceeded to fix a few conversion warnings in the process.

Adding `-Wconversion` to the list of flags used for `zstd` is something I would be favorable over the long term,
but it cannot be done overnight,
because the nb of places where this warning is triggered is daunting.
Better progressively reduce the nb of triggered `-Wconversion` warnings before enabling this flag by default.
2022-08-03 21:39:35 +02:00
a925362534 minor : fixed missing include
I presume it was not detected before
because "fileio.h" is probably always included after "util.h".
2022-08-03 20:52:15 +02:00
28ceb63503 Merge pull request #3220 from embg/issue3200
Disallow empty string as argument for --output-dir-flat and --output-dir-mirror
2022-08-01 14:04:57 -04:00
ae4670466c stdin multiple file fixes (#3222)
* Fixes for https://github.com/facebook/zstd/issues/3206 - bugs when handling stdin as part of multiple files.

* new line at end of multiple-files.sh
2022-07-29 16:13:07 -07:00
f9f27de91c Disallow empty output directory 2022-07-29 14:48:33 -07:00
d4a5bc4efc Add warning when multi-thread decompression is requested (#3208)
When user pass in argument for both decompression and multi-thread, print a warning message
to indicate that multi-threaded decompression is not supported.

* Add warning when multi-thread decompression is requested
* add test case for multi-threaded decoding warning
   Expectation is for -d -T0 we will not throw any warning,
   and see warning for any other -d -T(>1) inputs
2022-07-29 12:51:58 -07:00
2b9fde932b Fix small file passthrough (#3215) 2022-07-29 12:22:46 -07:00
b1bbb0eb4c [AIX] Fix Compiler Flags and Bugs on AIX to Pass All Tests (#3219)
* Fixing compiler warnings

* Replace the old -s flag with the -Wl,-s flag

* Fixing compiler warnings

* Fixing the linker strip flag and tests/code not working as expected on AIX
2022-07-29 12:21:59 -07:00
e1873ad576 Fix buffer underflow for null dir1 2022-07-29 11:10:47 -07:00
6d75b36b7f Clarify -B docstring 2022-07-14 00:22:21 -04:00
d7eb829af5 Detect multiple dictIDs in one file 2022-07-08 12:20:50 -05:00
cc8c98485a zstd -lv <file> to show dictID 2022-07-05 21:28:33 -05:00
bb3839a78c make -C programs zstd.1 2022-06-29 14:55:14 -04:00
574ecbb0fc display a warning message when using C90 clock_t for MT speed measurements. 2022-06-19 11:38:06 -07:00
27bf96e72b updated --single-thread man 2022-06-07 17:45:15 -07:00
14894d63c1 Typo in man 2022-05-20 16:53:48 +08:00
eb726c6a20 updated man pages
had to run the conversion script on Ubuntu, as it doesn't run correctly on macos anymore.
2022-04-13 18:57:27 -07:00
0df2fd6088 updated man page, providing more details for --train mode
following questions from #3111.

Note : only the source markdown has been updated,
the actual man page zstd.1 still need to be processed.
2022-04-13 18:51:59 -07:00
460780f804 Merge pull request #3094 from dirkmueller/usage_cleanup
Split help in long and short version, cleanup formatting
2022-04-05 07:09:54 -07:00
f133bc8c9c zstd.1: Remove superfluous *not* in description of --long[=#]
Resolves: https://github.com/facebook/zstd/issues/3101
2022-04-03 07:29:51 +02:00
7fbe60d577 Split help in long and short version, cleanup formatting
Adopt the more standard Usage: formatting style
List short and long options alongside where available
Print lists as a table
Use command style description
2022-03-29 12:57:47 +02:00
f229daaf42 Merge pull request #3052 from dirkmueller/gzip_keep
Keep original file if -c or --stdout is given
2022-03-28 10:35:21 -07:00
3a64aa29a6 On more mistake (Node -> Note) 2022-03-13 00:08:55 +01:00
b772f53952 Typo and grammar fixes 2022-03-12 08:58:04 +01:00
3f4f8b04ed Keep original file if -c or --stdout is given
Set removeSrcFile back to false when -c or --stdout is used to improve
compatibility with gzip(1) behavior.

gzip(1) is removing the original file on compression unless --stdout or
/-c is used. zstd is defaulting to keep the file unless --rm is used or
when it is called via a gzip symlink, in which it is removing by
default. Specifying -c/--stdout turns this behavior off.
2022-03-09 23:38:59 +01:00
8814aa5bfa Merge pull request #3059 from dirkmueller/gzip_fast_best
Implement more gzip compatibility (#3037)
2022-03-08 15:32:06 -05:00
d109cef201 fix the assertion in readLinesFromFile (#3084)
* fix the assertion in readLinesFromFile

When the file is not terminated by endline, readLineFromFile will append
a '\0' for the last line.  In this case pos + lineLength == dstCapacity.

* test: don't print very long text garbage
2022-03-04 14:56:44 -05:00
da737c7ab8 [programs] Fix infinite loop when empty input is passed to trainer
When an empty input file was passed to the dictionary trainer, it would infinite loop.
The added test case exposes the bug, and is fixed with this PR.
2022-03-02 11:05:26 -08:00
e653e97f77 Implement more gzip compatibility (#3037)
-n --no-name is the current behavior already, so we can implement
this as a noop.

--best is an alias for -9 in gzip

add basic cli tests.
2022-02-09 23:09:18 +01:00
fcef19966c Merge pull request #3042 from u1f35c/fix2968
Fix required decompression memory usage reported by -vv + --long
2022-02-04 07:50:58 -08:00
4c4d403ecb Fix typos 2022-02-02 19:32:31 +02:00
470eb8330a Fix required decompression memory usage reported by -vv + --long
The use of --long alters the window size internally in the underlying
library (lib/compress/zstd_compress.c:ZSTD_getCParamsFromCCtxParams),
which changes the memory required for decompression. This means that the
reported requirement from the zstd binary when -vv is specified is
incorrect.

A full fix for this would be to add an API call to be able to retrieve
the required decompression memory from the library, but as a
lighterweight fix we can just take account of the fact we've enabled
long mode and update our verbose output appropriately.

Fixes #2968
2022-02-02 12:39:27 +00:00
cc0657f27d AsyncIO compression part 2 - added async read and asyncio to compression code (#3022)
* Compression asyncio:
- Added asyncio functionality for compression flow
- Added ReadPool for async reads, implemented in both comp and decomp flows
2022-01-31 15:43:41 -08:00