jsonnet 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2872d26e221e6ec8bbd30265edd0109eb9f1c68fa19fcfaa888c9921f096f771
4
- data.tar.gz: b91f326aa5a64a97f9f088a17b6462e8cf77d8e82679c11231cc68eff2b495e5
3
+ metadata.gz: 8557e0025fed7a2481d2bb42fc736399ef68203c42a982d9e7b3cbb7b4d9fb5c
4
+ data.tar.gz: 74c3995ba7b43df06fc928aab1790506508df78d05536df4915e5684c2c0a0a5
5
5
  SHA512:
6
- metadata.gz: dab85234e40a4b05ae60a4fe7423af108df27b9e3d2db119e6d18edb40f9abbb92c20a5cf7c25fb5d20e3a090031fae42ec93fab135ea3c6682adaf3ec006693
7
- data.tar.gz: 8aea3bbab4b7661a4ee6d055bd6fdd9b5c0834feae98f266b5d162563b860b932689f4fcd4096a3f2dcdf12fb5e960b2fbb7f7e65ce23d1d177d5f85128dbb56
6
+ metadata.gz: 2a99ecc45d1a1e5c0518335e3a3332e6a48b199e29c50c4d3dadeaa52580ab5d1175b4205a109fc50678dff711f3814c4417e382258b8b7c959585450a4bce54
7
+ data.tar.gz: 80be3522daea154d4f7e6d4ce58bfcd217980468edce4c2db04fe00737c2a3d4130c656e165678ce114b74538e596db7216010770a79922b94984bc2bd087ca6
data/README.md CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
  $ gem install jsonnet
25
25
  ```
26
26
 
27
- By default this gem will compile and install Jsonnet (v0.16.0) as part of
27
+ By default this gem will compile and install Jsonnet (v0.18.0) as part of
28
28
  installation. However you can use the system version of Jsonnet if you prefer.
29
29
  This would be the recommended route if you want to use a different version
30
30
  of Jsonnet or are having problems installing this.
@@ -27,7 +27,7 @@ invoke_callback(VALUE args)
27
27
  {
28
28
  long len = RARRAY_LEN(args);
29
29
  VALUE callback = rb_ary_entry(args, 0);
30
- return rb_funcall2(callback, id_call, len - 1, RARRAY_PTR(args) + 1);
30
+ return rb_funcall2(callback, id_call, (int)(len - 1), RARRAY_PTR(args) + 1);
31
31
  }
32
32
 
33
33
  /*
@@ -13,9 +13,28 @@ unless using_system_libraries?
13
13
  require 'mini_portile2'
14
14
  message "Using mini_portile version #{MiniPortile::VERSION}\n"
15
15
 
16
- recipe = MiniPortile.new('jsonnet', 'v0.17.0')
17
- recipe.files = ['https://github.com/google/jsonnet/archive/v0.17.0.tar.gz']
16
+ recipe = MiniPortile.new('jsonnet', 'v0.18.0')
17
+ recipe.files = ['https://github.com/google/jsonnet/archive/v0.18.0.tar.gz']
18
18
  class << recipe
19
+ CORE_OBJS = %w[
20
+ desugarer.o formatter.o lexer.o libjsonnet.o parser.o pass.o static_analysis.o string_utils.o vm.o
21
+ ].map {|name| File.join('core', name) }
22
+ MD5_OBJS = %w[
23
+ md5.o
24
+ ].map {|name| File.join('third_party', 'md5', name) }
25
+ C4_CORE_OBJS = %w[
26
+ base64.o
27
+ char_traits.o
28
+ error.o
29
+ format.o
30
+ language.o
31
+ memory_resource.o
32
+ memory_util.o
33
+ time.o
34
+ ].map {|name| File.join('third_party', 'rapidyaml', 'rapidyaml', 'ext', 'c4core', 'src', 'c4', name) }
35
+ RAPID_YAML_OBJS = %w[
36
+ common.o parse.o preprocess.o tree.o
37
+ ].map {|name| File.join('third_party', 'rapidyaml', 'rapidyaml', 'src', 'c4', 'yml', name) }
19
38
 
20
39
  def compile
21
40
  # We want to create a file a library we can link to. Jsonnet provides us
@@ -24,7 +43,7 @@ unless using_system_libraries?
24
43
  # we compile the c into .o files and then create an archive that can
25
44
  # be linked to
26
45
  execute('compile', make_cmd)
27
- execute('archive', 'ar rcs libjsonnet.a core/desugarer.o core/formatter.o core/lexer.o core/libjsonnet.o core/parser.o core/pass.o core/static_analysis.o core/string_utils.o core/vm.o third_party/md5/md5.o')
46
+ execute('archive', 'ar rcs libjsonnet.a ' + target_object_files.join(' '))
28
47
  end
29
48
 
30
49
  def configured?
@@ -41,6 +60,15 @@ unless using_system_libraries?
41
60
  FileUtils.cp(File.join(work_path, 'include', 'libjsonnet.h'), include_path)
42
61
  FileUtils.cp(File.join(work_path, 'include', 'libjsonnet_fmt.h'), include_path)
43
62
  end
63
+
64
+ private
65
+ def target_object_files
66
+ if version >= 'v0.18.0'
67
+ CORE_OBJS + MD5_OBJS + C4_CORE_OBJS + RAPID_YAML_OBJS
68
+ else
69
+ CORE_OBJS + MD5_OBJS
70
+ end
71
+ end
44
72
  end
45
73
 
46
74
  recipe.cook
@@ -48,12 +76,6 @@ unless using_system_libraries?
48
76
  # but the makefile to fail. These commands add the necessary paths to do both
49
77
  $LIBPATH = ["#{recipe.path}/lib"] | $LIBPATH
50
78
  $CPPFLAGS << " -I#{recipe.path}/include"
51
-
52
- # This resolves an issue where you can get improper linkage when compiling
53
- # and get an error like "undefined symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE"
54
- # experienced on ubuntu.
55
- # See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=193950
56
- $LIBS << " -lstdc++"
57
79
  end
58
80
 
59
81
  abort 'libjsonnet.h not found' unless have_header('libjsonnet.h')
data/ext/jsonnet/vm.c CHANGED
@@ -7,6 +7,10 @@
7
7
 
8
8
  #include "ruby_jsonnet.h"
9
9
 
10
+ #ifndef NORETURN
11
+ # define NORETURN(x) x
12
+ #endif
13
+
10
14
  /*
11
15
  * defines the core part of Jsonnet::VM
12
16
  */
@@ -385,7 +389,7 @@ vm_fmt_snippet(VALUE self, VALUE snippet, VALUE fname)
385
389
  void
386
390
  rubyjsonnet_init_vm(VALUE mJsonnet)
387
391
  {
388
- cVM = rb_define_class_under(mJsonnet, "VM", rb_cData);
392
+ cVM = rb_define_class_under(mJsonnet, "VM", rb_cObject);
389
393
  rb_define_singleton_method(cVM, "new", vm_s_new, -1);
390
394
  rb_define_private_method(cVM, "eval_file", vm_evaluate_file, 3);
391
395
  rb_define_private_method(cVM, "eval_snippet", vm_evaluate, 3);
@@ -424,7 +428,7 @@ rubyjsonnet_init_vm(VALUE mJsonnet)
424
428
  }
425
429
 
426
430
  static void
427
- raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
431
+ NORETURN(raise_error)(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
428
432
  {
429
433
  VALUE ex;
430
434
  const int state = rubyjsonnet_jump_tag(msg);
@@ -451,13 +455,13 @@ raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding
451
455
  * @sa rescue_callback
452
456
  */
453
457
  static void
454
- raise_eval_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
458
+ NORETURN(raise_eval_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
455
459
  {
456
460
  raise_error(eEvaluationError, vm, msg, enc);
457
461
  }
458
462
 
459
463
  static void
460
- raise_format_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
464
+ NORETURN(raise_format_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
461
465
  {
462
466
  raise_error(eFormatError, vm, msg, enc);
463
467
  }
@@ -1,3 +1,3 @@
1
1
  module Jsonnet
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonnet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Yugui Sonoda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-23 00:00:00.000000000 Z
11
+ date: 2022-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_portile2
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.1.2
132
+ rubygems_version: 3.3.7
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Jsonnet library