Skip to content

Updating Fiber #517

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

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions mrbgems/ngx_mruby_mrblib/mrblib/mrb_nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,4 @@ module Kernel
def get_server_class
Nginx
end

def _ngx_mrb_prepare_fiber(nginx_handler)
fiber_handler = Fiber.new { nginx_handler.call }

lambda do
# BUG?: return nginx_handler directly from fiber, not proc in any case.
result = fiber_handler.resume
[fiber_handler.alive?, result]
end
end
end
65 changes: 43 additions & 22 deletions mruby/.github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,50 @@
benchmark:
- benchmark/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- benchmark/**/*
build:
- Makefile
- Rakefile
- build_config/**/*
- lib/**/*
- tasks/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- Makefile
- Rakefile
- build_config/**/*
- lib/**/*
- tasks/**/*
core:
- include/**/*
- mrblib/**/*
- src/**/*
- test/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- include/**/*
- mrblib/**/*
- src/**/*
- test/**/*
doc:
- CONTRIBUTING.md
- LEGAL
- LICENSE
- NEWS
- README.md
- SECURITY.md
- TODO.md
- doc/**/*
- examples/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- CONTRIBUTING.md
- LEGAL
- LICENSE
- NEWS
- README.md
- SECURITY.md
- TODO.md
- doc/**/*
- examples/**/*
github:
- .github/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- .github/**/*
mrbgems:
- mrbgems/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- mrbgems/**/*
oss-fuzz:
- oss-fuzz/**/*
- any:
- changed-files:
- any-glob-to-any-file:
- oss-fuzz/**/*
2 changes: 1 addition & 1 deletion mruby/.github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
2 changes: 1 addition & 1 deletion mruby/.github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter/slim@v5.3.1
uses: super-linter/super-linter/slim@v5.7.2
env:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
Expand Down
10 changes: 5 additions & 5 deletions mruby/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: identity
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -30,15 +30,15 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
rev: v1.5.4
hooks:
- id: forbid-tabs
exclude: Makefile$|Makefile\..+$|makefile$|\.mk$
- id: remove-tabs
args: [--whitespaces-count, '2']
exclude: Makefile$|Makefile\..+$|makefile$|\.mk$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
name: Run codespell
Expand All @@ -51,7 +51,7 @@ repos:
name: Local policy is to exclude extension from all shell files
types: [shell]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
rev: v0.37.0
hooks:
- id: markdownlint
name: Run markdownlint
Expand All @@ -69,7 +69,7 @@ repos:
types: [markdown]
files: \.(md|mdown|markdown)$
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
rev: v1.33.0
hooks:
- id: yamllint
name: Run yamllint
Expand Down
13 changes: 7 additions & 6 deletions mruby/AUTHORS
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Authors of mruby (mruby developers)

## The List of Contributors sorted by number of commits (as of 2023-08-26 b85b682)
## The List of Contributors sorted by number of commits (as of 2023-11-20 6a3a810)

9287 Yukihiro "Matz" Matsumoto (@matz)*
9408 Yukihiro "Matz" Matsumoto (@matz)*
586 KOBAYASHI Shuji (@shuujii)
494 dearblue (@dearblue)*
508 dearblue (@dearblue)*
378 Daniel Bovensiepen (@bovi)*
346 Takeshi Watanabe (@take-cheeze)*
334 Masaki Muranaka (@monaka)
328 Tomoyuki Sahara (@tsahara)*
234 Jun Hiroe (@suzukaze)
220 Cremno (@cremno)*
209 Yuki Kurihara (@ksss)+
159 John Bampton (@jbampton)
165 John Bampton (@jbampton)
151 Yasuhiro Matsumoto (@mattn)*
113 Carson McDonald (@carsonmcdonald)
103 Tomasz Dąbrowski (@dabroz)*
Expand Down Expand Up @@ -115,9 +115,11 @@
4 Dante Catalfamo (@dantecatalfamo)
4 Goro Kikuchi (@gorogit)
4 Herwin Weststrate (@herwinw)
4 Horimoto Yasuhiro (@komainu8)
4 Jon Moss (@maclover7)
4 Ken Muramatsu (@ken-mu)+
4 Kohei Suzuki (@eagletmt)
4 Lanza (@LanzaSchneider)
4 Li Yazhou (@flaneur2020)
4 Marcus Stollsteimer (@stomar)
4 NARUSE, Yui (@nurse)
Expand All @@ -132,12 +134,10 @@
3 David Turnbull (@AE9RB)
3 Franck Verrot (@franckverrot)
3 HASUMI Hitoshi (@hasumikin)
3 Horimoto Yasuhiro (@komainu8)
3 J. Mutua (@katmutua)+
3 Jan Berdajs (@mrbrdo)
3 Jonas Minnberg (@sasq64)
3 Joseph McCullough (@joequery)
3 Lanza (@LanzaSchneider)
3 Mark McCurry (@fundamental)
3 Nobuhiro Iwamatsu (@iwamatsu)
3 Per Lundberg (@perlun)*
Expand Down Expand Up @@ -283,6 +283,7 @@
1 Yevhen Viktorov (@yevgenko)
1 Yoji SHIDARA (@darashi)
1 Yoshiori SHOJI (@yoshiori)
1 Yuji Yokoo (@yujiyokoo)
1 Yukang (@chenyukang)
1 Yurii Nakonechnyi (@inobelar)
1 Yusuke Suzuki (@Constellation)+
Expand Down
6 changes: 1 addition & 5 deletions mruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y python3-pip she

WORKDIR /app

COPY Gemfile .

COPY Gemfile.lock .

COPY .pre-commit-config.yaml .
COPY Gemfile Gemfile.lock .pre-commit-config.yaml ./

RUN bundle install && pip3 install pre-commit && git init . && pre-commit install-hooks

Expand Down
2 changes: 1 addition & 1 deletion mruby/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2023 mruby developers
Copyright (c) 2010- mruby developers

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
20 changes: 10 additions & 10 deletions mruby/build_config/host-shared.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# NOTE: Currently, this configuration file does not support VisualC++!
# Your help is needed!

MRuby::Build.new do |conf|
# load specific toolchain settings

# Gets set by the VS command prompts.
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
conf.toolchain

# include the GEM box
conf.gembox 'default'

# C compiler settings
conf.cc do |cc|
cc.flags = '-fPIC'
conf.compilers.each do |cc|
cc.flags << '-fPIC'
end

conf.archiver do |archiver|
archiver.command = 'gcc'
archiver.command = cc.command
archiver.archive_options = '-shared -o %{outfile} %{objs}'
end

Expand All @@ -29,6 +26,9 @@
# file separator
# conf.file_separator = '/'

# enable this if better compatibility with C++ is desired
#conf.enable_cxx_exception

# Turn on `enable_debug` for better debugging
conf.enable_debug
conf.enable_bintest
Expand Down
96 changes: 96 additions & 0 deletions mruby/build_config/nintendo_wii.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Cross Compiling configuration for the Nintendo Wii
# This configuration requires devkitPPC
# https://devkitpro.org/wiki/Getting_Started
#
#
MRuby::CrossBuild.new("wii") do |conf|
toolchain :gcc

DEVKITPRO_PATH = "/opt/devkitpro"
BIN_PATH = "#{DEVKITPRO_PATH}/devkitPPC/bin"

# C compiler
conf.cc do |cc|
cc.command = "#{BIN_PATH}/powerpc-eabi-gcc"
cc.compile_options = %(%{flags} -o "%{outfile}" -c "%{infile}")
end

# C++ compiler
conf.cxx do |cxx|
cxx.command = "#{BIN_PATH}/powerpc-eabi-g++"
cxx.include_paths = conf.cc.include_paths.dup
cxx.flags = conf.cc.flags.dup
cxx.defines = conf.cc.defines.dup
cxx.compile_options = conf.cc.compile_options.dup
end

# Linker
conf.linker do |linker|
linker.command = "#{BIN_PATH}/powerpc-eabi-gcc"
end

# No executables
conf.bins = []

# Do not build executable test
conf.build_mrbtest_lib_only

# Disable C++ exception
conf.disable_cxx_exception

# All current core gems with ones with build issues commented out
conf.gem 'mrbgems/mruby-array-ext/'
conf.gem 'mrbgems/mruby-bigint/'
conf.gem 'mrbgems/mruby-bin-config/'
conf.gem 'mrbgems/mruby-bin-debugger/'
conf.gem 'mrbgems/mruby-bin-mirb/'
conf.gem 'mrbgems/mruby-bin-mrbc/'
conf.gem 'mrbgems/mruby-bin-mruby/'
conf.gem 'mrbgems/mruby-bin-strip/'
conf.gem 'mrbgems/mruby-binding/'
conf.gem 'mrbgems/mruby-catch/'
conf.gem 'mrbgems/mruby-class-ext/'
conf.gem 'mrbgems/mruby-cmath/'
conf.gem 'mrbgems/mruby-compar-ext/'
conf.gem 'mrbgems/mruby-compiler/'
conf.gem 'mrbgems/mruby-complex/'
conf.gem 'mrbgems/mruby-data/'
#conf.gem 'mrbgems/mruby-dir/'
conf.gem 'mrbgems/mruby-enum-chain/'
conf.gem 'mrbgems/mruby-enum-ext/'
conf.gem 'mrbgems/mruby-enum-lazy/'
conf.gem 'mrbgems/mruby-enumerator/'
conf.gem 'mrbgems/mruby-errno/'
conf.gem 'mrbgems/mruby-error/'
conf.gem 'mrbgems/mruby-eval/'
conf.gem 'mrbgems/mruby-exit/'
conf.gem 'mrbgems/mruby-fiber/'
conf.gem 'mrbgems/mruby-hash-ext/'
#conf.gem 'mrbgems/mruby-io/'
conf.gem 'mrbgems/mruby-kernel-ext/'
conf.gem 'mrbgems/mruby-math/'
conf.gem 'mrbgems/mruby-metaprog/'
conf.gem 'mrbgems/mruby-method/'
conf.gem 'mrbgems/mruby-numeric-ext/'
conf.gem 'mrbgems/mruby-object-ext/'
conf.gem 'mrbgems/mruby-objectspace/'
conf.gem 'mrbgems/mruby-os-memsize/'
conf.gem 'mrbgems/mruby-pack/'
conf.gem 'mrbgems/mruby-print/'
conf.gem 'mrbgems/mruby-proc-binding/'
conf.gem 'mrbgems/mruby-proc-ext/'
conf.gem 'mrbgems/mruby-random/'
conf.gem 'mrbgems/mruby-range-ext/'
conf.gem 'mrbgems/mruby-rational/'
conf.gem 'mrbgems/mruby-set/'
conf.gem 'mrbgems/mruby-sleep/'
#conf.gem 'mrbgems/mruby-socket/'
conf.gem 'mrbgems/mruby-sprintf/'
conf.gem 'mrbgems/mruby-string-ext/'
conf.gem 'mrbgems/mruby-struct/'
conf.gem 'mrbgems/mruby-symbol-ext/'
conf.gem 'mrbgems/mruby-test-inline-struct/'
#conf.gem 'mrbgems/mruby-test/'
conf.gem 'mrbgems/mruby-time/'
conf.gem 'mrbgems/mruby-toplevel-ext/'
end
28 changes: 14 additions & 14 deletions mruby/doc/guides/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ $ mrdb sample.rb

You can execute the shell commands listed below:

|command|description|
|:-:|:--|
|run|execute programs|
|step|execute stepping|
|continue|execute continuing program|
|break|configure the breaking point|
|delete|deleting the breaking points|
|disable|disabling the breaking points|
|enable|enabling the breaking points|
|info breakpoints|showing list of the breaking points|
|print|evaluating and printing the values of the mruby expressions in the script|
|list|displaying the source cords|
|help|showing help|
|quit|terminating the mruby debugger|
| command | description |
|:----------------:|:--------------------------------------------------------------------------|
| run | execute programs |
| step | execute stepping |
| continue | execute continuing program |
| break | configure the breaking point |
| delete | deleting the breaking points |
| disable | disabling the breaking points |
| enable | enabling the breaking points |
| info breakpoints | showing list of the breaking points |
| print | evaluating and printing the values of the mruby expressions in the script |
| list | displaying the source cords |
| help | showing help |
| quit | terminating the mruby debugger |

### 2.2.2 Debugging mruby Binary Files (mrb file) with mrdb

Expand Down
Loading