extzstd 0.3.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -3
  3. data/contrib/zstd/CHANGELOG +39 -2
  4. data/contrib/zstd/CONTRIBUTING.md +3 -3
  5. data/contrib/zstd/Makefile +34 -20
  6. data/contrib/zstd/README.md +6 -2
  7. data/contrib/zstd/SECURITY.md +15 -0
  8. data/contrib/zstd/lib/Makefile +40 -28
  9. data/contrib/zstd/lib/README.md +14 -1
  10. data/contrib/zstd/lib/common/allocations.h +1 -1
  11. data/contrib/zstd/lib/common/bitstream.h +49 -29
  12. data/contrib/zstd/lib/common/compiler.h +114 -22
  13. data/contrib/zstd/lib/common/cpu.h +36 -0
  14. data/contrib/zstd/lib/common/debug.c +6 -0
  15. data/contrib/zstd/lib/common/debug.h +20 -11
  16. data/contrib/zstd/lib/common/error_private.h +45 -36
  17. data/contrib/zstd/lib/common/fse.h +3 -2
  18. data/contrib/zstd/lib/common/fse_decompress.c +19 -17
  19. data/contrib/zstd/lib/common/huf.h +14 -1
  20. data/contrib/zstd/lib/common/mem.h +0 -9
  21. data/contrib/zstd/lib/common/pool.c +1 -1
  22. data/contrib/zstd/lib/common/pool.h +1 -1
  23. data/contrib/zstd/lib/common/portability_macros.h +2 -0
  24. data/contrib/zstd/lib/common/threading.c +8 -2
  25. data/contrib/zstd/lib/common/xxhash.c +5 -11
  26. data/contrib/zstd/lib/common/xxhash.h +2341 -1007
  27. data/contrib/zstd/lib/common/zstd_internal.h +5 -5
  28. data/contrib/zstd/lib/compress/fse_compress.c +8 -7
  29. data/contrib/zstd/lib/compress/huf_compress.c +54 -25
  30. data/contrib/zstd/lib/compress/zstd_compress.c +282 -161
  31. data/contrib/zstd/lib/compress/zstd_compress_internal.h +29 -27
  32. data/contrib/zstd/lib/compress/zstd_compress_superblock.c +224 -113
  33. data/contrib/zstd/lib/compress/zstd_cwksp.h +19 -13
  34. data/contrib/zstd/lib/compress/zstd_double_fast.c +17 -5
  35. data/contrib/zstd/lib/compress/zstd_double_fast.h +11 -0
  36. data/contrib/zstd/lib/compress/zstd_fast.c +14 -6
  37. data/contrib/zstd/lib/compress/zstd_lazy.c +129 -87
  38. data/contrib/zstd/lib/compress/zstd_lazy.h +103 -28
  39. data/contrib/zstd/lib/compress/zstd_ldm.c +8 -2
  40. data/contrib/zstd/lib/compress/zstd_opt.c +216 -112
  41. data/contrib/zstd/lib/compress/zstd_opt.h +31 -7
  42. data/contrib/zstd/lib/compress/zstdmt_compress.c +94 -79
  43. data/contrib/zstd/lib/decompress/huf_decompress.c +188 -126
  44. data/contrib/zstd/lib/decompress/huf_decompress_amd64.S +38 -19
  45. data/contrib/zstd/lib/decompress/zstd_decompress.c +84 -32
  46. data/contrib/zstd/lib/decompress/zstd_decompress_block.c +231 -208
  47. data/contrib/zstd/lib/decompress/zstd_decompress_block.h +1 -1
  48. data/contrib/zstd/lib/decompress/zstd_decompress_internal.h +2 -0
  49. data/contrib/zstd/lib/dictBuilder/cover.c +16 -12
  50. data/contrib/zstd/lib/dictBuilder/cover.h +2 -8
  51. data/contrib/zstd/lib/dictBuilder/fastcover.c +2 -2
  52. data/contrib/zstd/lib/dictBuilder/zdict.c +12 -6
  53. data/contrib/zstd/lib/legacy/zstd_legacy.h +30 -0
  54. data/contrib/zstd/lib/legacy/zstd_v01.c +2 -0
  55. data/contrib/zstd/lib/legacy/zstd_v02.c +4 -16
  56. data/contrib/zstd/lib/legacy/zstd_v03.c +4 -16
  57. data/contrib/zstd/lib/legacy/zstd_v04.c +4 -11
  58. data/contrib/zstd/lib/legacy/zstd_v05.c +1 -0
  59. data/contrib/zstd/lib/legacy/zstd_v06.c +2 -9
  60. data/contrib/zstd/lib/legacy/zstd_v07.c +2 -10
  61. data/contrib/zstd/lib/libzstd.mk +34 -11
  62. data/contrib/zstd/lib/zstd.h +129 -60
  63. data/ext/extconf.rb +19 -1
  64. data/ext/extzstd.c +38 -14
  65. data/ext/extzstd.h +33 -6
  66. data/ext/extzstd_stream.c +74 -31
  67. metadata +4 -5
  68. data/contrib/zstd/appveyor.yml +0 -205
  69. data/ext/depend +0 -2
data/ext/extzstd_stream.c CHANGED
@@ -9,12 +9,13 @@ enum {
9
9
  };
10
10
 
11
11
  static inline VALUE
12
- aux_str_buf_recycle(VALUE str, size_t capacity)
12
+ aux_str_buf_recycle(VALUE *str, size_t capacity)
13
13
  {
14
- if (!RTEST(str) || rb_obj_frozen_p(str) || !rb_type_p(str, RUBY_T_STRING)) {
15
- return rb_str_buf_new(capacity);
14
+ if (!RTEST(*str) || rb_obj_frozen_p(*str) || !rb_type_p(*str, RUBY_T_STRING)) {
15
+ *str = rb_str_buf_new(capacity);
16
+ return *str;
16
17
  } else {
17
- return aux_str_modify_expand(str, capacity);
18
+ return aux_str_modify_expand(*str, capacity);
18
19
  }
19
20
  }
20
21
 
@@ -128,10 +129,6 @@ enc_init(int argc, VALUE argv[], VALUE self)
128
129
  rb_obj_classname(self), (void *)self);
129
130
  }
130
131
 
131
- AUX_TRY_WITH_GC(
132
- p->context = ZSTD_createCStream(),
133
- "failed ZSTD_createCStream()");
134
-
135
132
  const void *predictp;
136
133
  size_t predictsize;
137
134
  if (NIL_P(predict)) {
@@ -143,13 +140,39 @@ enc_init(int argc, VALUE argv[], VALUE self)
143
140
  RSTRING_GETMEM(predict, predictp, predictsize);
144
141
  }
145
142
 
143
+ AUX_TRY_WITH_GC(
144
+ p->context = ZSTD_createCStream(),
145
+ "failed ZSTD_createCStream()");
146
+
146
147
  if (extzstd_params_p(params)) {
147
148
  ZSTD_parameters *paramsp = extzstd_getparams(params);
148
- size_t s = ZSTD_initCStream_advanced(p->context, predictp, predictsize, *paramsp, -1);
149
- extzstd_check_error(s);
149
+ ZSTD_CCtx *zstd = p->context;
150
+ p->context = NULL; // 一時的に無効化する
151
+
152
+ aux_ZSTD_CCtx_reset(zstd, ZSTD_reset_session_and_parameters);
153
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_windowLog, paramsp->cParams.windowLog);
154
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_chainLog, paramsp->cParams.chainLog);
155
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_hashLog, paramsp->cParams.hashLog);
156
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_searchLog, paramsp->cParams.searchLog);
157
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_minMatch, paramsp->cParams.minMatch);
158
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_targetLength, paramsp->cParams.targetLength);
159
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_strategy, paramsp->cParams.strategy);
160
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_contentSizeFlag, paramsp->fParams.contentSizeFlag);
161
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_checksumFlag, paramsp->fParams.checksumFlag);
162
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_dictIDFlag, !paramsp->fParams.noDictIDFlag);
163
+ aux_ZSTD_CCtx_loadDictionary(zstd, predictp, predictsize);
164
+
165
+ p->context = zstd;
150
166
  } else {
151
- size_t s = ZSTD_initCStream_usingDict(p->context, predictp, predictsize, aux_num2int(params, 1));
152
- extzstd_check_error(s);
167
+ int clevel = aux_num2int(params, ZSTD_CLEVEL_DEFAULT);
168
+ ZSTD_CCtx *zstd = p->context;
169
+ p->context = NULL; // 一時的に無効化する
170
+
171
+ aux_ZSTD_CCtx_reset(zstd, ZSTD_reset_session_and_parameters);
172
+ aux_ZSTD_CCtx_setParameter(zstd, ZSTD_c_compressionLevel, clevel);
173
+ aux_ZSTD_CCtx_loadDictionary(zstd, predictp, predictsize);
174
+
175
+ p->context = zstd;
153
176
  }
154
177
 
155
178
  p->predict = predict;
@@ -170,7 +193,7 @@ enc_write(VALUE self, VALUE src)
170
193
  ZSTD_inBuffer input = { RSTRING_PTR(src), RSTRING_LEN(src), 0 };
171
194
 
172
195
  while (input.pos < input.size) {
173
- p->destbuf = aux_str_buf_recycle(p->destbuf, ZSTD_CStreamOutSize() * 2);
196
+ aux_str_buf_recycle(&p->destbuf, ZSTD_CStreamOutSize() * 2);
174
197
  rb_str_set_len(p->destbuf, 0);
175
198
  rb_obj_infect(self, src);
176
199
  rb_obj_infect(p->destbuf, self);
@@ -195,7 +218,7 @@ enc_sync(VALUE self)
195
218
  */
196
219
 
197
220
  struct encoder *p = encoder_context(self);
198
- aux_str_buf_recycle(p->destbuf, ZSTD_CStreamOutSize());
221
+ aux_str_buf_recycle(&p->destbuf, ZSTD_CStreamOutSize());
199
222
  rb_str_set_len(p->destbuf, 0);
200
223
  rb_obj_infect(p->destbuf, self);
201
224
  ZSTD_outBuffer output = { RSTRING_PTR(p->destbuf), rb_str_capacity(p->destbuf), 0 };
@@ -216,7 +239,7 @@ enc_close(VALUE self)
216
239
  */
217
240
 
218
241
  struct encoder *p = encoder_context(self);
219
- aux_str_buf_recycle(p->destbuf, ZSTD_CStreamOutSize());
242
+ aux_str_buf_recycle(&p->destbuf, ZSTD_CStreamOutSize());
220
243
  rb_str_set_len(p->destbuf, 0);
221
244
  rb_obj_infect(p->destbuf, self);
222
245
  ZSTD_outBuffer output = { RSTRING_PTR(p->destbuf), rb_str_capacity(p->destbuf), 0 };
@@ -241,11 +264,18 @@ static VALUE
241
264
  enc_reset(VALUE self, VALUE pledged_srcsize)
242
265
  {
243
266
  /*
244
- * ZSTDLIB_API size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
267
+ * ZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);
245
268
  */
246
269
 
247
- size_t s = ZSTD_resetCStream(encoder_context(self)->context, NUM2ULL(pledged_srcsize));
270
+ size_t s = ZSTD_CCtx_reset(encoder_context(self)->context, ZSTD_reset_session_only);
248
271
  extzstd_check_error(s);
272
+
273
+ if (pledged_srcsize == Qnil) {
274
+ ZSTD_CCtx_setPledgedSrcSize(encoder_context(self)->context, ZSTD_CONTENTSIZE_UNKNOWN);
275
+ } else {
276
+ ZSTD_CCtx_setPledgedSrcSize(encoder_context(self)->context, NUM2ULL(pledged_srcsize));
277
+ }
278
+
249
279
  return self;
250
280
  }
251
281
 
@@ -281,6 +311,10 @@ init_encoder(void)
281
311
  rb_define_alias(cStreamEncoder, "flush", "sync");
282
312
  rb_define_alias(cStreamEncoder, "end", "close");
283
313
  rb_define_alias(cStreamEncoder, "finish", "close");
314
+
315
+ (void)encoder_alloc_dummy;
316
+ (void)getencoderp;
317
+ (void)encoder_p;
284
318
  }
285
319
 
286
320
  /*
@@ -291,7 +325,7 @@ static VALUE cStreamDecoder;
291
325
 
292
326
  struct decoder
293
327
  {
294
- ZSTD_DStream *context;
328
+ ZSTD_DCtx *context;
295
329
  VALUE inport;
296
330
  VALUE readbuf;
297
331
  VALUE predict;
@@ -313,7 +347,7 @@ dec_free(void *pp)
313
347
  {
314
348
  struct decoder *p = (struct decoder *)pp;
315
349
  if (p->context) {
316
- ZSTD_freeDStream(p->context);
350
+ ZSTD_freeDCtx(p->context);
317
351
  p->context = NULL;
318
352
  }
319
353
  xfree(p);
@@ -352,6 +386,8 @@ static VALUE
352
386
  dec_init(int argc, VALUE argv[], VALUE self)
353
387
  {
354
388
  /*
389
+ * ZSTDLIB_API size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
390
+ *
355
391
  * ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);
356
392
  * ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
357
393
  */
@@ -379,16 +415,19 @@ dec_init(int argc, VALUE argv[], VALUE self)
379
415
  }
380
416
 
381
417
  AUX_TRY_WITH_GC(
382
- p->context = ZSTD_createDStream(),
383
- "failed ZSTD_createDStream()");
418
+ p->context = ZSTD_createDCtx(),
419
+ "failed ZSTD_createDCtx()");
384
420
 
421
+ //ZSTD_DCtx_reset
422
+ //ZSTD_DCtx_loadDictionary
385
423
  if (NIL_P(predict)) {
386
- size_t s = ZSTD_initDStream(p->context);
387
- extzstd_check_error(s);
424
+ //size_t s = ZSTD_initDStream(p->context);
425
+ //extzstd_check_error(s);
388
426
  } else {
389
427
  rb_check_type(predict, RUBY_T_STRING);
390
428
  predict = rb_str_new_frozen(predict);
391
- size_t s = ZSTD_initDStream_usingDict(p->context, RSTRING_PTR(predict), RSTRING_LEN(predict));
429
+ //size_t s = ZSTD_initDStream_usingDict(p->context, RSTRING_PTR(predict), RSTRING_LEN(predict));
430
+ size_t s = ZSTD_DCtx_loadDictionary(p->context, RSTRING_PTR(predict), RSTRING_LEN(predict));
392
431
  extzstd_check_error(s);
393
432
  }
394
433
 
@@ -401,8 +440,8 @@ dec_init(int argc, VALUE argv[], VALUE self)
401
440
  static int
402
441
  dec_read_fetch(VALUE o, struct decoder *p)
403
442
  {
404
- if (!p->inbuf.src || NIL_P(p->readbuf) || p->inbuf.pos >= RSTRING_LEN(p->readbuf)) {
405
- p->readbuf = aux_str_buf_recycle(p->readbuf, EXT_PARTIAL_READ_SIZE);
443
+ if (!p->inbuf.src || NIL_P(p->readbuf) || p->inbuf.pos >= (size_t)RSTRING_LEN(p->readbuf)) {
444
+ aux_str_buf_recycle(&p->readbuf, EXT_PARTIAL_READ_SIZE);
406
445
  VALUE st = AUX_FUNCALL(p->inport, id_read, INT2FIX(EXT_PARTIAL_READ_SIZE), p->readbuf);
407
446
  if (NIL_P(st)) { return -1; }
408
447
  rb_check_type(st, RUBY_T_STRING);
@@ -420,13 +459,14 @@ dec_read_fetch(VALUE o, struct decoder *p)
420
459
  static size_t
421
460
  dec_read_decode(VALUE o, struct decoder *p, char *buf, ssize_t size)
422
461
  {
462
+
423
463
  if (p->reached_eof != 0) {
424
464
  return 0;
425
465
  }
426
466
 
427
467
  ZSTD_outBuffer output = { buf, size, 0 };
428
468
 
429
- while (size < 0 || output.pos < size) {
469
+ while (size < 0 || output.pos < (size_t)size) {
430
470
  if (dec_read_fetch(o, p) != 0) {
431
471
  if (p->reached_eof == 0) {
432
472
  rb_raise(rb_eRuntimeError,
@@ -563,10 +603,9 @@ dec_close(VALUE self)
563
603
  static VALUE
564
604
  dec_reset(VALUE self)
565
605
  {
566
- /*
567
- * ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);
568
- */
569
- size_t s = ZSTD_resetDStream(decoder_context(self)->context);
606
+ //> ZSTDLIB_API size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset);
607
+
608
+ size_t s = ZSTD_DCtx_reset(decoder_context(self)->context, ZSTD_reset_session_only);
570
609
  extzstd_check_error(s);
571
610
  return self;
572
611
  }
@@ -605,6 +644,10 @@ init_decoder(void)
605
644
  rb_define_method(cStreamDecoder, "reset", dec_reset, 0);
606
645
  rb_define_method(cStreamDecoder, "sizeof", dec_sizeof, 0);
607
646
  rb_define_method(cStreamDecoder, "pos", dec_pos, 0);
647
+
648
+ (void)decoder_alloc_dummy;
649
+ (void)getdecoderp;
650
+ (void)decoder_p;
608
651
  }
609
652
 
610
653
  /*
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extzstd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - dearblue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-21 00:00:00.000000000 Z
11
+ date: 2024-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -71,8 +71,8 @@ files:
71
71
  - contrib/zstd/Makefile
72
72
  - contrib/zstd/Package.swift
73
73
  - contrib/zstd/README.md
74
+ - contrib/zstd/SECURITY.md
74
75
  - contrib/zstd/TESTING.md
75
- - contrib/zstd/appveyor.yml
76
76
  - contrib/zstd/lib/BUCK
77
77
  - contrib/zstd/lib/Makefile
78
78
  - contrib/zstd/lib/README.md
@@ -167,7 +167,6 @@ files:
167
167
  - contrib/zstd/lib/zdict.h
168
168
  - contrib/zstd/lib/zstd.h
169
169
  - contrib/zstd/lib/zstd_errors.h
170
- - ext/depend
171
170
  - ext/extconf.rb
172
171
  - ext/extzstd.c
173
172
  - ext/extzstd.h
@@ -214,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
213
  - !ruby/object:Gem::Version
215
214
  version: '0'
216
215
  requirements: []
217
- rubygems_version: 3.4.13
216
+ rubygems_version: 3.5.9
218
217
  signing_key:
219
218
  specification_version: 4
220
219
  summary: ruby bindings for Zstandard (zstd)
@@ -1,205 +0,0 @@
1
- # Following tests are run _only_ on `release` branch
2
- # and on selected feature branch named `appveyorTest` or `visual*`
3
-
4
- -
5
- version: 1.0.{build}
6
- branches:
7
- only:
8
- - release
9
- - master
10
- - /appveyor*/
11
- - /visual*/
12
- environment:
13
- matrix:
14
- - COMPILER: "gcc"
15
- HOST: "mingw"
16
- PLATFORM: "x64"
17
- SCRIPT: "make allzstd MOREFLAGS=-static"
18
- ARTIFACT: "true"
19
- BUILD: "true"
20
- - COMPILER: "gcc"
21
- HOST: "mingw"
22
- PLATFORM: "x86"
23
- SCRIPT: "make allzstd MOREFLAGS=-static"
24
- ARTIFACT: "true"
25
- BUILD: "true"
26
-
27
- - COMPILER: "clang-cl"
28
- HOST: "cmake-visual"
29
- PLATFORM: "x64"
30
- CONFIGURATION: "Release"
31
- CMAKE_GENERATOR: "Visual Studio 15 2017"
32
- CMAKE_GENERATOR_PLATFORM: "x64"
33
- CMAKE_GENERATOR_TOOLSET: "LLVM"
34
- APPVEYOR_BUILD_WORKER_IMAGE: "Visual Studio 2017"
35
-
36
- install:
37
- - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
38
- - SET PATH_ORIGINAL=%PATH%
39
- - if [%HOST%]==[mingw] (
40
- SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" &&
41
- SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" &&
42
- COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\make.exe &&
43
- COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\make.exe
44
- )
45
- - IF [%HOST%]==[visual] IF [%PLATFORM%]==[x64] (
46
- SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;"
47
- )
48
-
49
- build_script:
50
- - if [%HOST%]==[mingw] (
51
- ( if [%PLATFORM%]==[x64] (
52
- SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%"
53
- ) else if [%PLATFORM%]==[x86] (
54
- SET "PATH=%PATH_MINGW32%;%PATH_ORIGINAL%"
55
- ) )
56
- )
57
- - if [%HOST%]==[mingw] if [%BUILD%]==[true] (
58
- make -v &&
59
- sh -c "%COMPILER% -v" &&
60
- ECHO Building zlib to static link &&
61
- SET "CC=%COMPILER%" &&
62
- sh -c "cd .. && git clone --depth 1 --branch v1.2.11 https://github.com/madler/zlib" &&
63
- sh -c "cd ../zlib && make -f win32/Makefile.gcc libz.a"
64
- ECHO Building zstd &&
65
- SET "CPPFLAGS=-I../../zlib" &&
66
- SET "LDFLAGS=../../zlib/libz.a" &&
67
- sh -c "%SCRIPT%" &&
68
- ( if [%COMPILER%]==[gcc] if [%ARTIFACT%]==[true]
69
- ECHO Creating artifacts &&
70
- ECHO %cd% &&
71
- lib\dll\example\build_package.bat &&
72
- make -C programs DEBUGFLAGS= clean zstd &&
73
- cd programs\ && 7z a -tzip -mx9 zstd-win-binary-%PLATFORM%.zip zstd.exe &&
74
- appveyor PushArtifact zstd-win-binary-%PLATFORM%.zip &&
75
- cp zstd.exe ..\bin\zstd.exe &&
76
- git clone --depth 1 --branch release https://github.com/facebook/zstd &&
77
- cd zstd &&
78
- git archive --format=tar release -o zstd-src.tar &&
79
- ..\zstd -19 zstd-src.tar &&
80
- appveyor PushArtifact zstd-src.tar.zst &&
81
- certUtil -hashfile zstd-src.tar.zst SHA256 > zstd-src.tar.zst.sha256.sig &&
82
- appveyor PushArtifact zstd-src.tar.zst.sha256.sig &&
83
- cd ..\..\bin\ &&
84
- 7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * &&
85
- appveyor PushArtifact zstd-win-release-%PLATFORM%.zip
86
- )
87
- )
88
- - if [%HOST%]==[cmake-visual] (
89
- ECHO *** &&
90
- ECHO *** Building %CMAKE_GENERATOR% ^(%CMAKE_GENERATOR_TOOLSET%^) %PLATFORM%\%CONFIGURATION% &&
91
- PUSHD build\cmake &&
92
- cmake -DBUILD_TESTING=ON . &&
93
- cmake --build . --config %CONFIGURATION% -j4 &&
94
- POPD &&
95
- ECHO ***
96
- )
97
-
98
- test_script:
99
- - ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION%
100
- - SET "CC=gcc"
101
- - SET "CXX=g++"
102
- - if [%TEST%]==[cmake] (
103
- mkdir build\cmake\build &&
104
- cd build\cmake\build &&
105
- SET FUZZERTEST=-T2mn &&
106
- SET ZSTREAM_TESTTIME=-T2mn &&
107
- cmake -G "Visual Studio 14 2015 Win64" .. &&
108
- cd ..\..\.. &&
109
- make clean
110
- )
111
-
112
-
113
- # The following tests are for regular pushes
114
- # into `dev` or some feature branch
115
- # There run less tests, for shorter feedback loop
116
-
117
- -
118
- version: 1.0.{build}
119
- environment:
120
- matrix:
121
- - COMPILER: "visual"
122
- HOST: "visual"
123
- PLATFORM: "x64"
124
- CONFIGURATION: "Debug"
125
- - COMPILER: "visual"
126
- HOST: "visual"
127
- PLATFORM: "Win32"
128
- CONFIGURATION: "Debug"
129
- - COMPILER: "visual"
130
- HOST: "visual"
131
- PLATFORM: "x64"
132
- CONFIGURATION: "Release"
133
- - COMPILER: "visual"
134
- HOST: "visual"
135
- PLATFORM: "Win32"
136
- CONFIGURATION: "Release"
137
-
138
- - COMPILER: "gcc"
139
- HOST: "cygwin"
140
- PLATFORM: "x64"
141
-
142
- - COMPILER: "clang-cl"
143
- HOST: "cmake-visual"
144
- PLATFORM: "x64"
145
- CONFIGURATION: "Release"
146
- CMAKE_GENERATOR: "Visual Studio 15 2017"
147
- CMAKE_GENERATOR_PLATFORM: "x64"
148
- CMAKE_GENERATOR_TOOLSET: "LLVM"
149
- APPVEYOR_BUILD_WORKER_IMAGE: "Visual Studio 2017"
150
-
151
- install:
152
- - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
153
- - SET PATH_ORIGINAL=%PATH%
154
- - if [%HOST%]==[cygwin] (
155
- ECHO Installing Cygwin Packages &&
156
- C:\cygwin64\setup-x86_64.exe -qnNdO -R "C:\cygwin64" -g -P ^
157
- gcc,^
158
- cmake,^
159
- make
160
- )
161
- - IF [%HOST%]==[visual] IF [%PLATFORM%]==[x64] (
162
- SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;"
163
- )
164
-
165
- build_script:
166
- - ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION%
167
- - if [%HOST%]==[cygwin] (
168
- set CHERE_INVOKING=yes &&
169
- set CC=%COMPILER% &&
170
- C:\cygwin64\bin\bash --login -c "
171
- set -e;
172
- cd build/cmake;
173
- CFLAGS='-Werror' cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_FUZZER_FLAGS=-T20s -DZSTD_ZSTREAM_FLAGS=-T20s -DZSTD_FULLBENCH_FLAGS=-i0 .;
174
- make VERBOSE=1 -j;
175
- ctest -V -L Medium;
176
- "
177
- )
178
- - if [%HOST%]==[cmake-visual] (
179
- ECHO *** &&
180
- ECHO *** Building %CMAKE_GENERATOR% ^(%CMAKE_GENERATOR_TOOLSET%^) %PLATFORM%\%CONFIGURATION% &&
181
- PUSHD build\cmake &&
182
- cmake -DBUILD_TESTING=ON . &&
183
- cmake --build . --config %CONFIGURATION% -j4 &&
184
- POPD &&
185
- ECHO ***
186
- )
187
- - if [%HOST%]==[visual] (
188
- ECHO *** &&
189
- ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% &&
190
- ECHO *** &&
191
- msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
192
- DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
193
- msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
194
- DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe
195
- )
196
-
197
-
198
- test_script:
199
- - ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION%
200
- - SET "FUZZERTEST=-T10s"
201
- - if [%HOST%]==[mingw] (
202
- set "CC=%COMPILER%" &&
203
- make clean &&
204
- make check
205
- )
data/ext/depend DELETED
@@ -1,2 +0,0 @@
1
- extzstd.o: extzstd.c extzstd.h
2
- extzstd_stream.o: extzstd_stream.c extzstd.h extzstd_nogvls.h