lutaml / expressir

Ruby parser for the ISO EXPRESS language
3 stars 2 forks source link

[URGENT] problems with platform gems #42

Closed CAMOBAP closed 3 years ago

CAMOBAP commented 3 years ago

A couple of issues was discovered for platform gems:

  1. incompatible library version - ubuntu
  2. The specified module could not be found. - windows
  3. GHA workflows need to be updated to brew install autoconf automake - macos

https://github.com/metanorma/metanorma-standoc/runs/1623761565?check_suite_focus=true

CAMOBAP commented 3 years ago

Per we must provide prebuilt for each minor ruby version 2.4 2.5 2.6 2.7... (now I understand the advantages of ffi gem)

Also, I unpacked nogokiri gem and it contains prebuilt for each minor ruby version

drwxr-xr-x 3 camobap staff 96B Dec 30 10:51 2.5 drwxr-xr-x 3 camobap staff 96B Dec 30 10:51 2.6 drwxr-xr-x 3 camobap staff 96B Dec 30 10:51 2.7 drwxr-xr-x 3 camobap staff 96B Dec 30 10:51 3.0

I will spend some time to provide it (find some official docs) after this I see the only way is to set up cross-compiling on mac os GHA

CAMOBAP commented 3 years ago

Note platform gems temporaly deleted with:

CAMOBAP commented 3 years ago

What I have found so far:

  1. cross-compile approach works good for c extension https://github.com/sparklemotion/nokogiri/blob/master/rakelib/cross-ruby.rake
  2. in our case https://github.com/jasonroelofs/rice override some compilation settings and break this approach, researching this right now

If we compare two approaches:

Criteria rake-compiler-docker GHA
Run locally (on demand) + -
Support from community + -
Compilation time - +[1]

[1] - depends on VM availability

To me, rake-compiler-docker approach looks more promissing

CAMOBAP commented 3 years ago

@zakjan could you please help to understand what is the best way to test that expressir command works as expected? I have tried:

But looks like it produces nothing. What is the best way to do end to end test?

P.S. rspec isn't an option for me because I need to test that cross-compiled native gem works

zakjan commented 3 years ago

Currently the new native parser is exposed only in Ruby code, there is no external command using it yet in Expressir directly.

express-to-owl uses the previous parser accepting xml only as input. The new parser and model are built in a way so that it could be used also for owl transformation, but it hasn't been implemented yet.

For your testing you can create your own Ruby file:

require "expressir/express_exp/parser"

input_file = ARGV.shift

repo = Expressir::ExpressExp::Parser.from_exp(input_file)
schema = repo.schemas.first
puts schema.id

This should output schema name.

CAMOBAP commented 3 years ago

Ok, what I did so far:

CAMOBAP commented 3 years ago

After release gem install expressir --platform x86_64-darwin still require to build native extension, I will check tomorrow, maybe it's related to some caching issues on rubygem.org side

Update: but works for linux in docker, I will check windows tomorrow too

Update2: macos works now also