expressir 1.2.11-x64-mingw32 → 1.3.0.pre.2-x64-mingw32

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: f907f82a401631893a23dd690bb8cb617e31c49d935fa6ab3694278b1cca5668
4
- data.tar.gz: 84ebfda3ca64318857a2f973c12b8c59e2e3e1562a005dbe4b0286f6f1500c7b
3
+ metadata.gz: c1d81d3044a8afce37998e14e5943d4e47abc81f6695f3756f1707ff6cf61ecd
4
+ data.tar.gz: b08b7f30d1270023307bd76b56efb9631280d7957289c783ba8dd467ff5edfba
5
5
  SHA512:
6
- metadata.gz: 650876af3404012a75692d8b211f4197eca62f453ba8b21c3d3c711f6e5b39f976dd3309c48562f3bd9ced1a343f06e4c25e420baee39affc3ad792a8be2914f
7
- data.tar.gz: 6bbd2f11d8b6b28e54598460b2641065660569517a09fee7082c95825f1715b9afe57f4226803f1a538e3af6d2acd7387868e26dd1176615799e0e1b90770da7
6
+ metadata.gz: '032766947c2896bd74091edadf42d0f50fd8eb1f39d7656577a34b39e3b97dee43daa2fa66e3642f0872682e4e08f3b974a4f320c80a944e03afef35a00bf84c'
7
+ data.tar.gz: 6c8b9cf00f356fa80b2e5c999fec701c962e9f4c58af43bd29ee641f92a038592153061e2320fc9ebc5c3636d99ea27076587fdce2c351439862ff54bd69b997
@@ -2,8 +2,15 @@ name: rake
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master, main ]
5
+ branches: [ main ]
6
+ paths-ignore:
7
+ - 'docs/**'
8
+ - '**.adoc'
9
+ - '**.md'
10
+ - .github/workflows/alpine.yml
11
+ - .github/workflows/release.yml
6
12
  pull_request:
13
+ workflow_dispatch:
7
14
 
8
15
  concurrency:
9
16
  group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
@@ -114,7 +121,7 @@ jobs:
114
121
  strategy:
115
122
  fail-fast: false
116
123
  matrix:
117
- host: [ linux, windows, darwin ]
124
+ platform: [ linux-gnu, windows, darwin ]
118
125
  steps:
119
126
  - name: Checkout
120
127
  uses: actions/checkout@v4
@@ -141,12 +148,12 @@ jobs:
141
148
  sudo swapon --all --verbose
142
149
 
143
150
  - name: Build gem with native extension
144
- run: bundle exec rake gem:${{ matrix.host }}
151
+ run: bundle exec rake gem:${{ matrix.platform }}
145
152
 
146
153
  - name: Package gem with native extension
147
154
  uses: actions/upload-artifact@v3
148
155
  with:
149
- name: pkg-${{ matrix.host }}
156
+ name: pkg-${{ matrix.platform }}
150
157
  path: pkg/*.gem
151
158
 
152
159
  verify-ruby:
@@ -227,8 +234,8 @@ jobs:
227
234
  ruby bin/rspec
228
235
  cat .rspec_status || echo ".rspec_status was not found"
229
236
 
230
- verify-linux:
231
- name: verify Linux binary gem on ruby-${{ matrix.ruby }}
237
+ verify-linux-gnu:
238
+ name: verify Linux (gnu) binary gem on ruby-${{ matrix.ruby }}
232
239
  needs: pack
233
240
  runs-on: ubuntu-latest
234
241
  strategy:
@@ -252,11 +259,11 @@ jobs:
252
259
  - name: Download packaged gem
253
260
  uses: actions/download-artifact@v3
254
261
  with:
255
- name: pkg-linux
262
+ name: pkg-linux-gnu
256
263
  path: pkg
257
264
 
258
265
  - name: Install binary gem
259
- run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM").gem
266
+ run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM")-gnu.gem
260
267
 
261
268
  - name: Verify
262
269
  run: |
@@ -271,8 +278,6 @@ jobs:
271
278
  runs-on: windows-latest
272
279
  strategy:
273
280
  fail-fast: false
274
- # Ruby 3.1 fails
275
- # https://github.com/lutaml/expressir/issues/103
276
281
  matrix:
277
282
  ruby: [ '3.2', '3.1', '3.0', '2.7' ]
278
283
  steps:
@@ -30,8 +30,8 @@ jobs:
30
30
 
31
31
  - if: ${{ github.event_name == 'workflow_dispatch' }} # unfortunatelly cannot keep this condition on job level
32
32
  run: |
33
- git config user.name github-actions
34
- git config user.email github-actions@github.com
33
+ git config --global user.name github-actions
34
+ git config --global user.email github-actions@github.com
35
35
  gem install gem-release
36
36
  gem bump --version ${{ github.event.inputs.next_version }} --tag --push
37
37
 
@@ -41,12 +41,11 @@ jobs:
41
41
  strategy:
42
42
  fail-fast: false
43
43
  matrix:
44
- host: [ linux, windows, darwin ]
44
+ platform: [ linux-gnu, windows, darwin ]
45
45
  steps:
46
46
  - uses: actions/checkout@v4
47
47
  with:
48
48
  submodules: recursive
49
- ref: main # https://github.com/actions/checkout/issues/439#issuecomment-830862188
50
49
 
51
50
  - uses: ruby/setup-ruby@master
52
51
  with:
@@ -56,15 +55,23 @@ jobs:
56
55
 
57
56
  - run: bundle install --jobs 4 --retry 3
58
57
 
59
- # build gem WITHOUT pre-built native extension
60
- - run: gem build expressir.gemspec
58
+ - name: Build gem and save version
59
+ if: matrix.platform == 'linux-gnu'
60
+ run: |
61
+ gem build expressir.gemspec | grep -o 'Version: .*' | awk '{print $2}' > version
61
62
 
62
- - if: matrix.host == 'linux'
63
+ - if: matrix.platform == 'linux-gnu'
63
64
  uses: actions/upload-artifact@v3
64
65
  with:
65
66
  name: pkg-ruby
66
67
  path: expressir-*.gem
67
68
 
69
+ - if: matrix.platform == 'linux-gnu'
70
+ uses: actions/upload-artifact@v3
71
+ with:
72
+ name: version
73
+ path: version
74
+
68
75
  - name: Enable swap
69
76
  run: |
70
77
  sudo fallocate -l 15g /compile.swap
@@ -74,11 +81,11 @@ jobs:
74
81
  sudo swapon --all --verbose
75
82
 
76
83
  # build gem WITH pre-built native extension
77
- - run: bundle exec rake gem:${{ matrix.host }}
84
+ - run: bundle exec rake gem:${{ matrix.platform }}
78
85
 
79
86
  - uses: actions/upload-artifact@v3
80
87
  with:
81
- name: pkg-${{ matrix.host }}
88
+ name: pkg-${{ matrix.platform }}
82
89
  path: pkg/*.gem
83
90
 
84
91
  publish:
@@ -92,7 +99,7 @@ jobs:
92
99
 
93
100
  - uses: actions/download-artifact@v3
94
101
  with:
95
- name: pkg-linux
102
+ name: pkg-linux-gnu
96
103
  path: pkg
97
104
 
98
105
  - uses: actions/download-artifact@v3
@@ -109,12 +116,11 @@ jobs:
109
116
  with:
110
117
  ruby-version: '3.1'
111
118
 
112
- - run: ls -l pkg/
113
-
114
119
  - name: Publish to rubygems.org
115
120
  env:
116
121
  RUBYGEMS_API_KEY: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
117
122
  run: |
123
+ ls -l pkg/
118
124
  mkdir -p ~/.gem
119
125
  cat > ~/.gem/credentials << EOF
120
126
  ---
@@ -123,3 +129,59 @@ jobs:
123
129
  chmod 0600 ~/.gem/credentials
124
130
  gem signin
125
131
  for gem in pkg/*.gem; do gem push $gem -V; done
132
+
133
+ verify:
134
+ name: Verify published gem on ${{ matrix.os }}
135
+ needs: publish
136
+ runs-on: ${{ matrix.os }}
137
+ strategy:
138
+ fail-fast: false
139
+ matrix:
140
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
141
+ steps:
142
+ - name: Install Ruby
143
+ uses: ruby/setup-ruby@master
144
+ with:
145
+ ruby-version: 3.1
146
+ bundler-cache: true
147
+ bundler: ${{ env.BUNDLER_VER }}
148
+
149
+ - name: Download version
150
+ uses: actions/download-artifact@v3
151
+ with:
152
+ name: version
153
+ path: version
154
+
155
+ - name: Install gem
156
+ run: gem install expressir -v $(cat version)
157
+
158
+ - name: Verify
159
+ run: |
160
+ cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
161
+ ruby bin/rspec
162
+ cat .rspec_status || echo ".rspec_status was not found"
163
+
164
+ verify-alpine:
165
+ name: Verify published gem on Alpine
166
+ needs: publish
167
+ runs-on: ubuntu-latest
168
+ container:
169
+ image: alpine:3.17
170
+ steps:
171
+ - name: Install packages
172
+ run: apk --no-cache add bash build-base git ruby-dev gcc g++ automake
173
+
174
+ - name: Download version
175
+ uses: actions/download-artifact@v3
176
+ with:
177
+ name: version
178
+ path: version
179
+
180
+ - name: Install gem
181
+ run: gem install expressir -v $(cat version)
182
+
183
+ - name: Verify
184
+ run: |
185
+ cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
186
+ ruby bin/rspec
187
+ cat .rspec_status || echo ".rspec_status was not found"
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require "yard"
6
6
 
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
 
9
- task default: :spec
9
+ task default: %i[compile spec]
10
10
 
11
11
  GEMSPEC = Gem::Specification.load("expressir.gemspec")
12
12
 
data/expressir.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "expressir"
7
7
  spec.version = Expressir::VERSION
8
8
  spec.authors = ["Ribose Inc."]
9
- spec.email = ["open.source@ribose.com'"]
9
+ spec.email = ["open.source@ribose.com"]
10
10
 
11
11
  spec.summary = "ISO EXPRESS parser and tools in Ruby."
12
12
  spec.description = "Expressir (“EXPRESS in Ruby”) is a Ruby parser for EXPRESS and a set of Ruby tools for accessing ISO EXPRESS data models."
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ # native precompiled gems package shared libraries in <gem_dir>/lib/nokogiri/<ruby_version>
5
+ ::RUBY_VERSION =~ /(\d+\.\d+)/
6
+ require_relative "#{Regexp.last_match(1)}/express_parser"
7
+ rescue LoadError => e
8
+ # if /musl/.match?(RUBY_PLATFORM)
9
+ # warn(<<~EOM)
10
+ #
11
+ # ERROR: It looks like you're trying to use Expressir as a precompiled native gem on a musl system.
12
+ #
13
+ # #{e.message}
14
+ #
15
+ # If that's the case, then please install Expressir via the `ruby` platform gem:
16
+ # gem install expressir --platform=ruby
17
+ # or:
18
+ # bundle config set force_ruby_platform true
19
+ #
20
+ #
21
+ # EOM
22
+ # raise e
23
+ # end
24
+
25
+ # use "require" instead of "require_relative" because non-native gems will place C extension files
26
+ # in Gem::BasicSpecification#extension_dir after compilation (during normal installation), which
27
+ # is in $LOAD_PATH but not necessarily relative to this file
28
+ require "expressir/express/express_parser"
29
+ end
30
+
@@ -1,9 +1,4 @@
1
- begin
2
- RUBY_VERSION =~ /(\d+\.\d+)/
3
- require_relative "#{$1}/express_parser"
4
- rescue LoadError
5
- require_relative "express_parser"
6
- end
1
+ require_relative 'extension'
7
2
  require 'expressir/express/visitor'
8
3
  require 'expressir/express/resolve_references_model_visitor'
9
4
 
@@ -1,9 +1,4 @@
1
- begin
2
- RUBY_VERSION =~ /(\d+\.\d+)/
3
- require_relative "#{$1}/express_parser"
4
- rescue LoadError
5
- require_relative "express_parser"
6
- end
1
+ require_relative 'extension'
7
2
  require "expressir/model"
8
3
  require "set"
9
4
 
@@ -31,8 +26,6 @@ require "set"
31
26
  # - prevents segfault in ANTLR4 C++ runtime, not sure why they are caused
32
27
  # - e.g. see visit_schema_decl
33
28
 
34
- require 'objspace'
35
-
36
29
  module Expressir
37
30
  module Express
38
31
  class Visitor < ::ExpressParser::Visitor
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "1.2.11".freeze
2
+ VERSION = "1.3.0.pre.2".freeze
3
3
  end
@@ -2,7 +2,7 @@ require "rbconfig"
2
2
  require "shellwords"
3
3
 
4
4
  WINDOWS_PLATFORM_REGEX = /mingw|mswin/.freeze
5
- LINUX_PLATFORM_REGEX = /linux/.freeze
5
+ LINUX_GNU_PLATFORM_REGEX = /linux-gnu/.freeze
6
6
  DARWIN_PLATFORM_REGEX = /darwin/.freeze
7
7
  GLIBC_MIN_VERSION = "2.17".freeze
8
8
 
@@ -15,8 +15,8 @@ CrossRuby = Struct.new(:version, :host) do
15
15
  !!(platform =~ WINDOWS_PLATFORM_REGEX)
16
16
  end
17
17
 
18
- def linux?
19
- !!(platform =~ LINUX_PLATFORM_REGEX)
18
+ def linux_gnu?
19
+ !!(platform =~ LINUX_GNU_PLATFORM_REGEX)
20
20
  end
21
21
 
22
22
  def darwin?
@@ -59,10 +59,10 @@ CrossRuby = Struct.new(:version, :host) do
59
59
  else
60
60
  "x64-mingw32"
61
61
  end
62
- when /\Ax86_64.*linux/
63
- "x86_64-linux"
64
- when /\A(arm64|aarch64).*linux/
65
- "aarch64-linux"
62
+ when "x86_64-linux-gnu"
63
+ "x86_64-linux-gnu"
64
+ when "aarch64-linux-gnu"
65
+ "aarch64-linux-gnu"
66
66
  when /\Ax86_64-darwin/
67
67
  "x86_64-darwin"
68
68
  when /\Aarm64-darwin/
@@ -72,12 +72,24 @@ CrossRuby = Struct.new(:version, :host) do
72
72
  end
73
73
  end
74
74
 
75
+ def tag
76
+ @tag ||=
77
+ case platform
78
+ when "x86_64-linux-gnu"
79
+ "x86_64-linux"
80
+ when "aarch64-linux-gnu"
81
+ "aarch64-linux"
82
+ else
83
+ platform
84
+ end
85
+ end
86
+
75
87
  def tool(name)
76
88
  (@binutils_prefix ||=
77
89
  case platform
78
90
  when /x64-mingw(32|-ucrt)/
79
91
  "x86_64-w64-mingw32-"
80
- when /(x86_64|aarch64)-linux/
92
+ when /(x86_64|aarch64)-linux-gnu/
81
93
  # We do believe that we are on Linux and can use native tools
82
94
  ""
83
95
  when /x86_64.*darwin/
@@ -93,9 +105,9 @@ CrossRuby = Struct.new(:version, :host) do
93
105
  case platform
94
106
  when /64-mingw(32|-ucrt)/
95
107
  "pei-x86-64"
96
- when "x86_64-linux"
108
+ when "x86_64-linux-gnu"
97
109
  "elf64-x86-64"
98
- when "aarch64-linux"
110
+ when "aarch64-linux-gnu"
99
111
  "elf64-little"
100
112
  when "x86_64-darwin"
101
113
  "Mach-O 64-bit x86-64"
@@ -142,7 +154,7 @@ CrossRuby = Struct.new(:version, :host) do
142
154
  case platform
143
155
  when WINDOWS_PLATFORM_REGEX
144
156
  verify_entry_windows(dump, dll)
145
- when LINUX_PLATFORM_REGEX
157
+ when LINUX_GNU_PLATFORM_REGEX
146
158
  verify_entry_linux(dll)
147
159
  when DARWIN_PLATFORM_REGEX
148
160
  verify_entry_darwin(dll)
@@ -188,7 +200,7 @@ CrossRuby = Struct.new(:version, :host) do
188
200
  end
189
201
 
190
202
  def allowed_dlls_linux
191
- suffix = (platform == "x86_64-linux" ? "x86-64" : "aarch64")
203
+ suffix = (platform == "x86_64-linux-gnu" ? "x86-64" : "aarch64")
192
204
  [
193
205
  "ld-linux-#{suffix}.so",
194
206
  "libc.so",
@@ -210,7 +222,7 @@ CrossRuby = Struct.new(:version, :host) do
210
222
  case platform
211
223
  when WINDOWS_PLATFORM_REGEX
212
224
  allowed_dlls_windows
213
- when LINUX_PLATFORM_REGEX
225
+ when LINUX_GNU_PLATFORM_REGEX
214
226
  allowed_dlls_linux
215
227
  when DARWIN_PLATFORM_REGEX
216
228
  allowed_dlls_darwin
@@ -236,7 +248,7 @@ CrossRuby = Struct.new(:version, :host) do
236
248
  case platform
237
249
  when DARWIN_PLATFORM_REGEX
238
250
  actual_dlls_darwin(dll)
239
- when LINUX_PLATFORM_REGEX
251
+ when LINUX_GNU_PLATFORM_REGEX
240
252
  actual_dlls_linux(dump)
241
253
  when WINDOWS_PLATFORM_REGEX
242
254
  actual_dlls_windows(dump)
@@ -291,7 +303,7 @@ def verify_dll(dll, cross_ruby)
291
303
  cross_ruby.verify_imports(dump, dll)
292
304
  # Not sure if it is required, probably not
293
305
  # I am keeping related code as a reference for future advances
294
- # cross_ruby.verify_glibc_version(dump, dll) if cross_ruby.linux?
306
+ # cross_ruby.verify_glibc_version(dump, dll) if cross_ruby.linux_gnu?
295
307
 
296
308
  puts "#{dll}: passed shared library sanity checks"
297
309
  end
@@ -315,7 +327,7 @@ UBUNTU_PREREQ = "sudo apt-get update -y && sudo apt-get install -y automake auto
315
327
 
316
328
  def pre_req(plat)
317
329
  case plat
318
- when /\linux/
330
+ when /linux/
319
331
  "if [[ $(awk -F= '/^NAME/{print $2}' /etc/os-release) == '\"Ubuntu\"' ]]; then #{UBUNTU_PREREQ}; else #{REDHAT_PREREQ}; fi"
320
332
  else
321
333
  UBUNTU_PREREQ.to_s
@@ -323,14 +335,16 @@ def pre_req(plat)
323
335
  end
324
336
 
325
337
  namespace "gem" do
326
- CROSS_RUBIES.find_all { |cr| cr.windows? || cr.linux? || cr.darwin? }.map(&:platform).uniq.each do |plat|
338
+ CROSS_RUBIES.find_all { |cr| cr.windows? || cr.linux_gnu? || cr.darwin? }.map { |cr| { platform: cr.platform, tag: cr.tag } }
339
+ .uniq { |hash| hash[:platform] }.each do |hash|
340
+ plat = hash[:platform]
341
+ tag = hash[:tag]
327
342
  desc "build native gem for #{plat} platform"
328
343
  task plat do
329
- RakeCompilerDock.sh <<~RCD, platform: plat
344
+ RakeCompilerDock.sh <<~RCD, platform: tag
330
345
  #{pre_req(plat)} &&
331
346
  gem install bundler --no-document &&
332
- bundle &&
333
- bundle exec rake gem:#{plat}:builder MAKE="nice make -j`nproc`"
347
+ bundle && bundle exec rake gem:#{plat}:builder MAKE="nice make -j`nproc`"
334
348
  RCD
335
349
  end
336
350
 
@@ -346,7 +360,7 @@ namespace "gem" do
346
360
  multitask "windows" => CROSS_RUBIES.find_all(&:windows?).map(&:platform).uniq
347
361
 
348
362
  desc "build native gems for linux"
349
- multitask "linux" => CROSS_RUBIES.find_all(&:linux?).map(&:platform).uniq
363
+ multitask "linux-gnu" => CROSS_RUBIES.find_all(&:linux_gnu?).map(&:platform).uniq
350
364
 
351
365
  desc "build native gems for darwin"
352
366
  multitask "darwin" => CROSS_RUBIES.find_all(&:darwin?).map(&:platform).uniq
@@ -361,6 +375,7 @@ Rake::ExtensionTask.new("express_parser", GEMSPEC) do |ext|
361
375
  ext.cross_compile = true
362
376
  ext.cross_platform = CROSS_RUBIES.map(&:platform).uniq
363
377
  ext.cross_config_options << "--enable-cross-build"
378
+
364
379
  ext.cross_compiling do |spec|
365
380
  spec.files.reject! { |path| File.fnmatch?("ext/*", path) }
366
381
  spec.dependencies.reject! { |dep| dep.name == "rice" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.11
4
+ version: 1.3.0.pre.2
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-12 00:00:00.000000000 Z
11
+ date: 2023-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -209,7 +209,7 @@ dependencies:
209
209
  description: Expressir (“EXPRESS in Ruby”) is a Ruby parser for EXPRESS and a set
210
210
  of Ruby tools for accessing ISO EXPRESS data models.
211
211
  email:
212
- - open.source@ribose.com'
212
+ - open.source@ribose.com
213
213
  executables:
214
214
  - expressir
215
215
  extensions: []
@@ -243,6 +243,7 @@ files:
243
243
  - lib/expressir/express/2.7/express_parser.so
244
244
  - lib/expressir/express/3.0/express_parser.so
245
245
  - lib/expressir/express/cache.rb
246
+ - lib/expressir/express/extension.rb
246
247
  - lib/expressir/express/formatter.rb
247
248
  - lib/expressir/express/hyperlink_formatter.rb
248
249
  - lib/expressir/express/model_visitor.rb
@@ -377,9 +378,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
377
378
  version: 3.1.dev
378
379
  required_rubygems_version: !ruby/object:Gem::Requirement
379
380
  requirements:
380
- - - ">="
381
+ - - ">"
381
382
  - !ruby/object:Gem::Version
382
- version: '0'
383
+ version: 1.3.1
383
384
  requirements: []
384
385
  rubygems_version: 3.3.26
385
386
  signing_key: