Commit Graph

6241 Commits

Author SHA1 Message Date
Lzu Tao
7b6a8840c5 Fix #1428 - zstdgrep returned 1 on match and unmatch
- Use ZCAT for testing zstdgrep in case of non-install yet
- tests: Add file test for zstdgrep
2019-01-06 23:22:55 +07:00
Yann Collet
f8c8796dfe
Merge pull request #1491 from cemeyer/freebsd_num_cores
Fix #1425 - Use physical core count API on FreeBSD
2019-01-05 11:48:01 -08:00
Conrad Meyer
fe82637069 Fix #1425 - Use physical core count API on FreeBSD
Similar to Apple, use the native physical core count sysctl, when available.

This is a little repetitive (it's basically the __APPLE__ method plus the
otherBSD method concatenated together) but seemed clearer than any way that
would totally eliminate repetition.

The __FreeBSD_version check only tests the version of the FreeBSD kernel
that zstd is compiled on; importantly, it may be run on a different version.
So the compile-time check is a little naive and needs to be able to fallback
to work on older versions of FreeBSD.  For a similar reason, it may make
sense to simply eliminate the __FreeBSD_version check entirely.  The
tradeoff is that a spurious sysctlbyname would be issued when -T0 is used on
older kernels.
2019-01-04 11:57:12 -08:00
Yann Collet
b174809fcc
Merge pull request #1490 from erikwebb/dev
Check CMake minor version support for VERSION_LESS_EQUAL
2019-01-03 13:22:07 -08:00
Erik Webb
9448a3790d Check CMake minor version support for VERSION_LESS_EQUAL
VERSION_LESS_EQUAL is only available to CMake 3.7+. This adds additional
logic to check that CMAKE_MINOR_VERSION is at least 7.

Fixes #1489
2019-01-03 15:26:20 -05:00
Yann Collet
f9e4f89252 improved comments for adjustCParams() and getCParams() 2019-01-02 12:18:40 -08:00
Yann Collet
a2f492f2b3
Merge pull request #1485 from ldv-alt/dev
contrib/pzstd/Makefile: fix build of tests
2019-01-02 10:46:41 -08:00
Yann Collet
282000d88b
Merge pull request #1475 from hjmjohnson/cmake-version-setting
Cmake version setting
2018-12-30 21:11:39 -08:00
Hans Johnson
97d1de3d22 Provide forward compatible cmake paradigms
Automatically extract version information
from the zstd.h file.  Use naming of variables
consisent with modern cmake and https://semver.org/
(Semantic Versioning 2.0.0, MAJOR, MINOR, PATCH)

Modern versions of cmake provide consistent
paradigms for configuring project external
interface values.

This set of changes provide a back port of
some of cmake 3+ paradigms back to cmake 2.8.9.
Set and allow use of the current cmake policies
for newer versions of cmake when available to
allow for modern compiler features to be
utilized when available.

NOTE: The intent is that future modifications to
cmake will enable (conditional on cmake version support)
the ability to support modern linkage, and target
export mechanisms.  Those future changes will
make incorporating zstd into other packages
much easier.

This patch also allows the more rigourous error
checking of commmon cmake errors to be preformed
by cmake (i.e. more stringent syntax checking and
create errors for common hard to find misuses of
cmake variables).

This patch also provides support for modern
compiler support options by cmake (like
enabling interprocedural optimization
if link time optimizations are known to be supported
by the compiler envirionment.  IPO can be supported
by setting the CMAKE_INTERPROCEDURAL_OPTIMIZATION variable
for newer versions of cmake.
2018-12-28 13:47:35 -06:00
Dmitry V. Levin
8b2210411a contrib/pzstd/Makefile: fix build of tests
Apparently, Options.o cannot be linked in without $(PROGDIR)/util.o
2018-12-28 19:02:22 +00:00
Yann Collet
23c73fe3e2
Merge pull request #1474 from hjmjohnson/cmake-set-default-build-type
Cmake set default build type
2018-12-28 11:02:22 -08:00
Yann Collet
6746de8dd6
Merge pull request #1478 from hjmjohnson/remove-duplicates-validation
BUG: list sub-command REMOVE_DUPLICATES requires list to be present
2018-12-28 10:50:03 -08:00
Yann Collet
c1a862385f
Merge pull request #1482 from lzutao/travisTest
travis: Use ninja from official github release
2018-12-28 10:49:01 -08:00
Yann Collet
bad7ed161a
Merge pull request #1483 from lzutao/meson-readme
meson: Update build guide
2018-12-28 09:46:13 -08:00
Yann Collet
663c55eba0
Merge pull request #1484 from lzutao/meson-pkgconf
meson: Correct generating pkgconf after Meson v0.49.0
2018-12-27 22:39:07 -08:00
Lzu Tao
142076ceae travis: Remove deprecated sudo field 2018-12-28 11:55:26 +07:00
Lzu Tao
787a72cdfe meson: Correct generating pkgconf after Meson v0.49.0 2018-12-28 11:20:33 +07:00
Lzu Tao
226cdffd69 meson: Update build guide [skip ci] 2018-12-28 11:17:11 +07:00
Lzu Tao
889a492784 travis: Use ninja from github 2018-12-28 10:25:13 +07:00
Yann Collet
470344d33e
Merge pull request #1479 from facebook/visualTest
Fix remaining Windows errors
2018-12-27 04:42:44 -08:00
Yann Collet
6b7a1d6127 fixed detection of input==output on Visual
due to bad support of inode identifiers.
On Visual, option is limited to same file name,
which is imperfect, but way better than disabling the feature entirely.

It's enough to pass associated tests.
2018-12-26 15:51:34 -08:00
Yann Collet
ae1d6bd48e fixed playTests.sh for minGW
On Windows, the equivalent of `/dev/null` is `NUL`.
When tests are run under msys2/minGW,
the environment identifies itself as Windows,
hence the script uses `NUL` instead of `/dev/null`
but the environment will consider `NUL` to be a regular file name.
Consequently, `NUL` will be overwritten during tests,
triggering an error.

This patch uses flag `-f` to force such overwrite
passing the test.
2018-12-26 15:19:09 -08:00
Yann Collet
07fdbdb737
Merge pull request #1477 from hjmjohnson/update-ZSTD_LEGACY_SUPPORT
ENH: Update to -DZSTD_LEGACY_SUPPORT=5
2018-12-26 11:40:28 -08:00
Hans Johnson
1a279ae85a BUG: list sub-command REMOVE_DUPLICATES requires list to be present
When compiling without c++ enabled, some variables are not present.
This is a check enforced in recent Cmake versions.

CMake Error at CMakeModules/AddZstdCompilationFlags.cmake:54 (list):
  list sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
  CMakeLists.txt:53 (ADD_ZSTD_COMPILATION_FLAGS)
2018-12-26 13:26:59 -06:00
Hans Johnson
77ef7847f7 Improve setting the default build type
The CMAKE_BUILD_TYPE variable is a CACHE variable
and should be set in a way that persists and is
documented in the CACHE.  Also set the default
values for the gui to ease selection of types.

These changes provide better support for GUI
configurators that support cmake.
2018-12-26 13:23:21 -06:00
Hans Johnson
304df8b883 ENH: Update to -DZSTD_LEGACY_SUPPORT=5 2018-12-26 13:18:39 -06:00
Yann Collet
1fdba696ca fixed VS2008 project
bench.c => benchfn.c + benchzstd.c
wrong util.c from prior patch

and warnings :
C4127
2018-12-25 16:14:14 -08:00
Yann Collet
ecd4df4143 added *visual* branches to long tests on Appveyor 2018-12-25 14:58:28 -08:00
Yann Collet
7df0d6f642 create appveyor test branch
which will execute same tests as `master` branch
hence including older Visual version
2018-12-25 14:20:33 -08:00
Yann Collet
0fb4b21d1a updated libzstd documentation 2018-12-25 03:10:07 -08:00
Yann Collet
a62aead907
Merge pull request #1476 from facebook/unifiedTravisYml
Unified travis.yml
2018-12-25 02:32:16 -08:00
Yann Collet
ca159fdb48
Merge pull request #1473 from facebook/minDecTest
fixed tests for minimal decoder builds
2018-12-24 16:36:03 -08:00
Yann Collet
7d51e1a5ec push more tests to master
to reduce test time for dev
2018-12-24 14:51:59 -08:00
Yann Collet
b31b98ac93
Merge pull request #1472 from hjmjohnson/modernize-cmake-syntax
Modernize cmake syntax
2018-12-24 12:24:29 -08:00
Hans Johnson
443b5c40e4 DOC: Provide documentation for cmake best practices. 2018-12-24 07:06:31 -06:00
Yann Collet
66b21b6c3e master branch selector 2018-12-24 04:04:15 -08:00
Yann Collet
81dab45b12 added master tests 2018-12-24 03:31:40 -08:00
Yann Collet
515c2aa922 fixed tests for minimal decoder builds
It's incorrect to mix targets `all` and `check` with directive -j.
They will be build in parallel
and resulting artifacts will fight each other
with different sets of build options (such as DEBUGLEVEL).
2018-12-24 02:56:21 -08:00
Yann Collet
e980ba212f
Merge pull request #1471 from facebook/nofloat
guard functions using floating point for debug mode only
2018-12-23 12:35:51 -08:00
Yann Collet
aae5bc538a
Merge pull request #1470 from facebook/U32
fix confusion between unsigned <-> U32
2018-12-23 12:35:39 -08:00
Yann Collet
92a3e3e9ca
Merge pull request #1469 from facebook/travisTest
update travis test
2018-12-22 19:57:16 -08:00
Hans Johnson
d3fc848ddd STYLE: Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.
2018-12-22 19:32:39 -06:00
Hans Johnson
2f1ff84119 STYLE: Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command names
became case-insensitive.  Now the preferred style is lower-case.
2018-12-22 19:32:39 -06:00
Yann Collet
0d212dd22d updated CHANGELOG for v1.3.8 2018-12-22 12:10:29 -08:00
Yann Collet
c9dfb7e445 guard functions using floating point for debug mode only
they are only used to print debug messages.
Requested in #1386,
2018-12-22 09:09:40 -08:00
Yann Collet
ededcfca57 fix confusion between unsigned <-> U32
as suggested in #1441.

generally U32 and unsigned are the same thing,
except when they are not ...

case : 32-bit compilation for MIPS (uint32_t == unsigned long)

A vast majority of transformation consists in transforming U32 into unsigned.
In rare cases, it's the other way around (typically for internal code, such as seeds).

Among a few issues this patches solves :
- some parameters were declared with type `unsigned` in *.h,
  but with type `U32` in their implementation *.c .
- some parameters have type unsigned*,
  but the caller user a pointer to U32 instead.

These fixes are useful.

However, the bulk of changes is about %u formating,
which requires unsigned type,
but generally receives U32 values instead,
often just for brevity (U32 is shorter than unsigned).
These changes are generally minor, or even annoying.

As a consequence, the amount of code changed is larger than I would expect for such a patch.

Testing is also a pain :
it requires manually modifying `mem.h`,
in order to lie about `U32`
and force it to be an `unsigned long` typically.
On a 64-bit system, this will break the equivalence unsigned == U32.
Unfortunately, it will also break a few static_assert(), controlling structure sizes.
So it also requires modifying `debug.h` to make `static_assert()` a noop.
And then reverting these changes.

So it's inconvenient, and as a consequence,
this property is currently not checked during CI tests.
Therefore, these problems can emerge again in the future.

I wonder if it is worth ensuring proper distinction of U32 != unsigned in CI tests.
It's another restriction for coding, adding more frustration during merge tests,
since most platforms don't need this distinction (hence contributor will not see it),
and while this can matter in theory, the number of platforms impacted seems minimal.

Thoughts ?
2018-12-21 18:09:41 -08:00
Yann Collet
c8d1fda982 update aarch64 test to xenial
in an attempt to circumvent the `ld` bug
2018-12-21 15:08:48 -08:00
Yann Collet
8f35c7f94c
Merge pull request #1466 from facebook/noDictPresent
fixed : better error message
2018-12-20 19:01:27 -08:00
Nick Terrell
87204a2afd
Merge pull request #1467 from terrelln/regression
[regression] Update results.csv
2018-12-20 18:14:13 -08:00
Nick Terrell
a24f73bece [regression] Update results.csv 2018-12-20 17:40:48 -08:00