Commit Graph

458 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto fbe21a0321 tools/lrama: bundle Lrama 0.6.9 (copied from CRuby source) 2024-06-10 14:26:26 +09:00
dearblue 0fcf54b47d Allow to change the output directory name of the libmruby file
Add the `MRuby::Build#libdir_name` accessor and the `MRUBY_SYSTEM_LIBDIR_NAME` environment variable.

Resolved #6240
2024-06-09 22:49:46 +09:00
Yukihiro "Matz" Matsumoto 31d85c20db Merge pull request #6202 from jbampton/clean-yardoc-folder
Remove the `.yardoc` folder with `rake doc:clean:api`
2024-03-13 09:08:07 +09:00
John Bampton 5895e8ebeb Remove the .yardoc folder with rake doc:clean:api 2024-03-12 06:43:35 +10:00
John Bampton d2206cd359 tasks/doc.rake: standardize the rake doc error messages 2024-03-12 05:30:54 +10:00
dearblue c805d4dbba Corrected wrong MRUBY_PACKAGE_DIR
ref. #6064
2023-09-25 21:50:31 +09:00
dearblue 7ac536e3ca Fix libmruby name for VisualC++ 2023-09-17 17:42:25 +09:00
dearblue fdec32a8f2 "expose_header_files" task split per build
If there are multiple build targets, it should be preferable to have the task processed at each of them.
2023-06-18 21:22:31 +09:00
Robert Rowe fb727a169f Spacing fix 2023-05-25 19:47:32 -07:00
Robert Rowe bcb5674676 Update Android building
New minimum SDK. NDK longer supports mips, plain armeabi, nor GCC. Fix tooling.
2023-05-25 19:45:14 -07:00
dearblue 0f2c1caa96 Make MRuby::Build#enable_debug compiler flag setting abstract
Previously, compiler flags were only added for GCC or similar.
The situation has not changed, but it has become easier to improve.

I expect `MRuby::Command::Compiler#setup_debug` to be defined as a singleton method inside the block given to `MRuby::Toolchain.new`.
2023-04-09 11:21:50 +09:00
John Bampton 7082e95fa2 Fix word case: yard -> YARD
https://yardoc.org/
2023-04-04 18:20:52 +10:00
dearblue 73b2e0bf76 Shrink <BUILD-DIR>/mrbgems/gem_init.c if possible
If none of the GEMs have `mrblib/` or `src/` directories, generate `mrb_init_mrbgems()` which does nothing, and omit `mrb_final_mrbgems()`.

The impetus was to avoid `gem_funcs[]` becoming a zero-length array, which is not allowed by the C standard.
The problem is caused by #5938.
2023-04-02 20:28:14 +09:00
Yukihiro "Matz" Matsumoto a8d840da19 Merge pull request #5928 from dearblue/task/install
Improved `rake install`
2023-03-13 08:05:20 +09:00
dearblue 1432baec1d Perform chores with mrb_final_mrbgems() function
The main purpose is to ignore exceptions raised by the GEMS finalizer.
2023-03-12 14:31:10 +09:00
dearblue c474ae8cc4 Perform chores with mrb_init_mrbgems() function
Make the `mrb_init_mrbgems()` function do the cleanup and error handling.
Instead, simplify processing in the `GENERATED_TMP_mrb_XXX_gem_init()` function.

Previously, `mrb_load_irep()` or `mrb_load_proc()` would kill the process when an exception occurred.
With this patch, it is now caught by `mrb_core_init_protect()`.
2023-03-12 10:25:54 +09:00
dearblue 396ca2809f Add the generator path to the build/***/gem_init.c file 2023-02-28 22:11:14 +09:00
dearblue 11513bae43 Make bin/mruby-config output a directory based on itself 2023-02-12 23:25:01 +09:00
dearblue 3d996a84cc Takes the environment variable DESTDIR in rake install
If the environment variable `DESTDIR` is set, the writing destination is `<DESTDIR>/<PREFIX>/...`.
It is assumed to be used for package work.
2023-02-12 21:02:31 +09:00
dearblue 0e9a71e50a Install other build targets with rake install:full
Build targets other than "host" will be installed under `<PREFIX>/mruby/<build-name>`.
This can be changed with `build.install_prefix = dir`.
2023-02-12 21:02:30 +09:00
dearblue 7fd7409bf2 Files copied by task install should be from the build directory 2023-02-12 21:02:29 +09:00
dearblue aac2fd7055 Copy header files to the build directory
This is so that the build directory can be regarded as a temporary installation directory to work in.

Directories set in `MRuby::Gem::Specification#export_include_paths` are used as they are if they are subdirectories placed under `gem.dir`.
Files are placed under `<build-dir>/include/mruby/gems/<gem-name>/<gem-include_paths>` to separate each GEM.

When GEM is compiled by building `libmruby.a`, the same `include_paths` will be set as before, so it is expected that no unintended references will be made.
2023-02-12 21:02:28 +09:00
dearblue c020d8507e Separate rake install related stuff into tasks/install.rake 2023-02-12 21:02:27 +09:00
John Bampton d318e992ea Use rubygems.org links for yard-mruby and yard-coderay
The RubyGems website gives a much better overview of both Gems

A lot more quick links and statistics.

https://rubygems.org/gems/yard-mruby

https://rubygems.org/gems/yard-coderay
2022-12-30 12:39:54 +10:00
John Bampton 6da82230e8 Add more building documentation 2022-12-30 11:14:12 +10:00
John Bampton e9b69c611d rake doc: C API needs both Doxygen and Graphviz
https://www.doxygen.nl/

https://graphviz.org/download/
2022-12-30 10:08:15 +10:00
Yukihiro "Matz" Matsumoto 4aad86a3e1 Merge pull request #5880 from jbampton/android-rake-style
style: pass `&:to_i` as an argument to collect instead of a block
2022-12-27 09:56:06 +09:00
John Bampton 10250f835c style: pass &:to_i as an argument to collect instead of a block 2022-12-26 19:12:56 +10:00
John Bampton b5af16b93a Add generate_active_gems_txt to rake --tasks 2022-12-26 17:16:50 +10:00
John Bampton 6c10351c88 Add benchmark to rake --tasks 2022-12-26 15:41:37 +10:00
dearblue 5e62990748 Add task rake doc:update-opcode.md
Allow to update `doc/internal/opcode.md` file mechanically from `include/mruby/ops.h` file.

At the same time, the `doc/internal/opcode.md` file has been updated.
Consecutive hyphens at the end of the table were removed as they would have created noise as markdown flavours.
2022-11-20 21:58:13 +09:00
John Bampton 1bf9ed196c tasks: enable rake docs to open on macOS
The `xdg-open` command is not available on macOS.

macOS uses the `open` command.

Add info to install doxygen on macOS with Homebrew.

https://formulae.brew.sh/formula/doxygen
2022-10-26 15:39:10 +10:00
John Bampton 791410ba3f Remove whitespace
pre-commit run --all-files
2022-08-04 00:51:03 +10:00
SAkira a.k.a. Akira Suzuki 4610fa55b9 Enabled building for Android again with NDK 25.0. 2022-08-03 08:23:54 +09:00
Yukihiro "Matz" Matsumoto 273ca4d4f6 tasks/toolchains/gcc.rake: remove -lm on Windows; #5757 2022-07-30 07:33:45 +09:00
dearblue 267dd15767 Allow build settings to define if benchmarks are covered or not
Each build target can be explicitly disabled from benchmarking with `MRuby::Build#disable_benchmark`.

Also, the build target "host", which was previously excluded, is now included in the benchmark.
2022-03-06 15:35:05 +09:00
dearblue 1f0d265a83 Raise an exception if there is no benchmark target 2022-03-06 15:29:35 +09:00
dearblue e39581242d Display file paths for benchmark results 2022-03-06 15:28:56 +09:00
dearblue dfddb04063 Use standardized approach for get build configuration name 2022-03-06 15:27:50 +09:00
Dante Catalfamo 89ea8fa34a Add instructions for installing doxygen on RHEL/Fedora/CentOS 2021-08-13 14:53:20 -04:00
dearblue 4c25ace8b3 Expose all header files of the gems for small compilation
After building mruby, if the user compiles and links to `libmruby.a`, expose the included directory of the captured gems.
This is a change to the `<build-dir> /lib/libmruby.flags.mak` file and will result in being added to `bin/mruby-config --cflags`.
This eliminates the need for the user to look up the path and add the compiler flag if the user wants to take advantage of her gems publishing features.

In the main build with `rake CONFIG=...`, there is no problem because it can only be seen from the gems that depends directly and indirectly as before.
However, when compiling independently by the user using `bin/mruby-config`, a header file name collision may occur if a unique header directory is added.
2021-08-09 21:16:45 +09:00
John Bampton 9d32d440eb feat(CI): add the GitHub Super Linter
The GitHub Super Linter is a more robust and better supported
tool than the current GitHub Actions we are using.

Running these checks:

ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true

https://github.com/marketplace/actions/super-linter
https://github.com/github/super-linter

Added the GitHub Super Linter badge to the README.

Also updated the pre-commit framework and added
more documentation on pre-commit.

Added one more pre-commit check: check-executables-have-shebangs

Added one extra check for merge conflicts to our
GitHub Actions.

EditorConfig and Markdown linting.

Minor grammar and spelling fixes.

Update linter.yml
2021-04-16 16:37:52 +09:00
Yukihiro "Matz" Matsumoto 9a9c842cb0 Rakefile: remove GitLab configuration; close #5409
This CI could consume too much CPU time on GitLab. Maybe we should add
resource concious CI configuration on GitLab.
2021-04-13 07:16:21 +09:00
Yukihiro "Matz" Matsumoto 58ab97e300 mruby-config: add --cc and --ld options.
* `--cc` print compiler name
* `--ld` print linker name
2021-04-06 17:25:53 +09:00
Yukihiro "Matz" Matsumoto 384865997d build: provide global defines by build.defines. 2021-03-22 10:58:47 +09:00
John Bampton 15f7b0182d chore: fix spelling 2021-03-07 04:58:15 +10:00
KOBAYASHI Shuji a6a76d8fd2 Add -s option to mrbc for make variable static 2021-02-14 11:55:53 +09:00
Yukihiro "Matz" Matsumoto 5c130e8e7b Do not collect linker options from binary gems; close #5210
Binary gems are mrbgems that set `spec.bins` in their `mrbgem.rake`,
and usually their names are prefixed with `mruby-bin-`.
2021-02-12 10:33:53 +09:00
KOBAYASHI Shuji 3cf0e85ed7 Explicit top level task to clarify in tasks/test.rake 2021-02-07 19:11:54 +09:00
dearblue 9d1a659bc7 Ignore if conf.enable_test does not exist
Because if the configuration file didn't contain any `conf.enable_test`, `rake test` would report an exception and exit.

```console
% cat my_config.rb
MRuby::Build.new { toolchain }

% rake MRUBY_CONFIG=my_config.rb test

  ...SNIP...

rake aborted!
NoMethodError: undefined method `invoke' for nil:NilClass
/var/tmp/mruby/tasks/test.rake:24:in `block (3 levels) in <top (required)>'
Tasks: TOP => test => test:build => test:build:lib
(See full trace by running task with --trace)
```
2021-02-06 18:09:27 +09:00