New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MRB_WITHOUT_FLOAT option #3827

Merged
merged 11 commits into from Nov 4, 2017

Conversation

Projects
None yet
3 participants
@pandax381
Contributor

pandax381 commented Oct 11, 2017

This option removes floating point numbers from mruby.
It makes mruby easier to handle in "Microcontroller without FPU" and "Kernel Space".

configuration

MRuby::Build.new do |conf|
  toolchain :gcc

  enable_debug

  conf.cc do |cc|
    cc.defines << %w(MRB_WITHOUT_FLOAT)
  end

  conf.enable_test

  conf.gem :core => "mruby-print"
  conf.gem :core => "mruby-bin-mirb"
end

This option only supports minimal mgems.
Therefore, conf.gembox 'default' can not be specified.

results

$ MRUBY_CONFIG=custom_config.rb make test

...(snip)...

Build summary:

================================================
      Config Name: host
 Output Directory: build/host
         Binaries: mrbc, mrbtest
    Included Gems:
             mruby-print - standard print/puts/p
             mruby-compiler - mruby compiler library
             mruby-bin-mirb - mirb command
               - Binaries: mirb
             mruby-bin-mrbc - mruby compiler executable
             mruby-test - mruby test
================================================

>>> Test host <<<
mrbtest - Embeddable Ruby Test

.........................................................................................................................................................................................................................................................................................................................................................................................................................?.......................................................................................................................?.................................................................
Skip: Module#prepend super in alias  super does not currently work in aliased methods
Skip: Direct superclass of Float 15.2.9.2 Float isn't defined
Total: 593
   OK: 593
   KO: 0
Crash: 0

confirm by default setting

$ make test

...(snip)...

Build summary:

================================================
      Config Name: host
 Output Directory: build/host
         Binaries: mrbc
    Included Gems:
             mruby-sprintf - standard Kernel#sprintf method
             mruby-print - standard print/puts/p
             mruby-math - standard Math module
             mruby-time - standard Time class
             mruby-struct - standard Struct class
             mruby-enum-ext - Enumerable module extension
             mruby-string-ext - String class extension
             mruby-numeric-ext - Numeric class extension
             mruby-array-ext - Array class extension
             mruby-hash-ext - Hash class extension
             mruby-range-ext - Range class extension
             mruby-proc-ext - Proc class extension
             mruby-symbol-ext - Symbol class extension
             mruby-random - Random class
             mruby-object-ext - Object class extension
             mruby-objectspace - ObjectSpace class
             mruby-fiber - Fiber class
             mruby-enumerator - Enumerator class
             mruby-enum-lazy - Enumerator::Lazy class
             mruby-toplevel-ext - toplevel object (main) methods extension
             mruby-compiler - mruby compiler library
             mruby-bin-mirb - mirb command
               - Binaries: mirb
             mruby-error - extensional error handling
             mruby-bin-mruby - mruby command
               - Binaries: mruby
             mruby-bin-strip - irep dump debug section remover command
               - Binaries: mruby-strip
             mruby-kernel-ext - Kernel module extension
             mruby-class-ext - class/module extension
             mruby-bin-mrbc - mruby compiler executable
================================================

================================================
      Config Name: host-debug
 Output Directory: build/host-debug
    Included Gems:
             mruby-sprintf - standard Kernel#sprintf method
             mruby-print - standard print/puts/p
             mruby-math - standard Math module
             mruby-time - standard Time class
             mruby-struct - standard Struct class
             mruby-enum-ext - Enumerable module extension
             mruby-string-ext - String class extension
             mruby-numeric-ext - Numeric class extension
             mruby-array-ext - Array class extension
             mruby-hash-ext - Hash class extension
             mruby-range-ext - Range class extension
             mruby-proc-ext - Proc class extension
             mruby-symbol-ext - Symbol class extension
             mruby-random - Random class
             mruby-object-ext - Object class extension
             mruby-objectspace - ObjectSpace class
             mruby-fiber - Fiber class
             mruby-enumerator - Enumerator class
             mruby-enum-lazy - Enumerator::Lazy class
             mruby-toplevel-ext - toplevel object (main) methods extension
             mruby-compiler - mruby compiler library
             mruby-bin-mirb - mirb command
               - Binaries: mirb
             mruby-error - extensional error handling
             mruby-bin-mruby - mruby command
               - Binaries: mruby
             mruby-bin-strip - irep dump debug section remover command
               - Binaries: mruby-strip
             mruby-kernel-ext - Kernel module extension
             mruby-class-ext - class/module extension
             mruby-eval - standard Kernel#eval method
             mruby-bin-debugger - mruby debugger command
               - Binaries: mrdb
================================================

================================================
      Config Name: test
 Output Directory: build/test
         Binaries: mrbtest
    Included Gems:
             mruby-sprintf - standard Kernel#sprintf method
             mruby-print - standard print/puts/p
             mruby-math - standard Math module
             mruby-time - standard Time class
             mruby-struct - standard Struct class
             mruby-enum-ext - Enumerable module extension
             mruby-fiber - Fiber class
             mruby-enumerator - Enumerator class
             mruby-string-ext - String class extension
             mruby-numeric-ext - Numeric class extension
             mruby-array-ext - Array class extension
             mruby-hash-ext - Hash class extension
             mruby-range-ext - Range class extension
             mruby-proc-ext - Proc class extension
             mruby-symbol-ext - Symbol class extension
             mruby-random - Random class
             mruby-object-ext - Object class extension
             mruby-objectspace - ObjectSpace class
             mruby-enum-lazy - Enumerator::Lazy class
             mruby-toplevel-ext - toplevel object (main) methods extension
             mruby-compiler - mruby compiler library
             mruby-bin-mirb - mirb command
               - Binaries: mirb
             mruby-error - extensional error handling
             mruby-bin-mruby - mruby command
               - Binaries: mruby
             mruby-bin-strip - irep dump debug section remover command
               - Binaries: mruby-strip
             mruby-kernel-ext - Kernel module extension
             mruby-class-ext - class/module extension
             mruby-test - mruby test
================================================

================================================
      Config Name: bench
 Output Directory: build/bench
    Included Gems:
             mruby-sprintf - standard Kernel#sprintf method
             mruby-print - standard print/puts/p
             mruby-math - standard Math module
             mruby-time - standard Time class
             mruby-struct - standard Struct class
             mruby-enum-ext - Enumerable module extension
             mruby-string-ext - String class extension
             mruby-numeric-ext - Numeric class extension
             mruby-array-ext - Array class extension
             mruby-hash-ext - Hash class extension
             mruby-range-ext - Range class extension
             mruby-proc-ext - Proc class extension
             mruby-symbol-ext - Symbol class extension
             mruby-random - Random class
             mruby-object-ext - Object class extension
             mruby-objectspace - ObjectSpace class
             mruby-fiber - Fiber class
             mruby-enumerator - Enumerator class
             mruby-enum-lazy - Enumerator::Lazy class
             mruby-toplevel-ext - toplevel object (main) methods extension
             mruby-compiler - mruby compiler library
             mruby-bin-mirb - mirb command
               - Binaries: mirb
             mruby-error - extensional error handling
             mruby-bin-mruby - mruby command
               - Binaries: mruby
             mruby-bin-strip - irep dump debug section remover command
               - Binaries: mruby-strip
             mruby-kernel-ext - Kernel module extension
             mruby-class-ext - class/module extension
================================================

>>> Test test <<<
mrbtest - Embeddable Ruby Test

...............................................................................................?.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................?..........................................................................................................................................................................................
Skip: Struct.new removes existing constant  redefining Struct with same name cause warnings
Skip: Module#prepend super in alias  super does not currently work in aliased methods
Total: 974
   OK: 974
   KO: 0
Crash: 0
 Time: 0.39 seconds

................
Total: 16
   OK: 16
   KO: 0
Crash: 0
 Time: 0.4 seconds
@christopheraue

This comment has been minimized.

Show comment
Hide comment
@christopheraue

christopheraue Oct 11, 2017

Contributor

Had a look a the failing AppVeyor build

Fail: rest arguments of eval (mrbgems: mruby-eval)
 - Assertion[2] Failed: Expected to be equal
    Expected: ["test", "test.rb", 10]
      Actual: ["test", "test.rb", 10]

FYI, this also happened in #3820 recently. mruby-eval currently probably has a memory referencing issue. This is to be fixed elsewhere.

Contributor

christopheraue commented Oct 11, 2017

Had a look a the failing AppVeyor build

Fail: rest arguments of eval (mrbgems: mruby-eval)
 - Assertion[2] Failed: Expected to be equal
    Expected: ["test", "test.rb", 10]
      Actual: ["test", "test.rb", 10]

FYI, this also happened in #3820 recently. mruby-eval currently probably has a memory referencing issue. This is to be fixed elsewhere.

@pandax381

This comment has been minimized.

Show comment
Hide comment
@pandax381

pandax381 Nov 3, 2017

Contributor

All tests passed.

Contributor

pandax381 commented Nov 3, 2017

All tests passed.

@matz matz merged commit 625f9f6 into mruby:master Nov 4, 2017

3 checks passed

codacy/pr Good work! A positive pull request.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

matz added a commit that referenced this pull request Nov 4, 2017

matz added a commit that referenced this pull request Dec 12, 2017

matz added a commit that referenced this pull request Dec 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment